<commit_before>/**
 * (c) 2016 Tieto Fin<NAME>
 * Licensed under the MIT license.
 */
'use strict';

/**
 * @ngdoc directive
 * @name dashboard.decisionsDirective
 * @description
 * # decisionsDirective
 */
angular.module('dashboard')
    .directive('dbDecisions', [function () {

        var controller = ['$log', '$scope', 'AhjoMeetingSrv', 'StorageSrv', 'CONST', 'PROPS', '$rootScope', function ($log, $scope, AhjoMeetingSrv, StorageSrv, CONST, PROPS, $rootScope) {
            $log.log("dbDecisions: CONTROLLER");
            var self = this;
            self.loading = false;
            self.types = [];
            self.selectedItem = null;
            self.record = null;
            self.supporter = null;
            self.voting = null;
            self.isTooltips = $rootScope.isTooltips;
            self.errorCode = 0;
            var mtgTopicSelected = StorageSrv.getKey(CONST.KEY.TOPIC);
            var mtgItemSelected = StorageSrv.getKey(CONST.KEY.MEETING_ITEM);

            // FUNCTIONS

            function getDecisions(aMtg, aTopic) {
                $log.debug("dbDecisions.getDecisions", arguments);
                if (angular.isObject(aTopic) && angular.isObject(aMtg)) {
                    self.record = null;
                    self.supporter = null;
                    self.voting = null;

                    AhjoMeetingSrv.getDecisions(aMtg.meetingGuid, aTopic.topicGuid).then(function (resp) {
                        $log.log("dbDecisions.getDecisions done", resp);
                        self.record = resp.record;
                        self.supporter = resp.supporter;
                        self.voting = resp.voting;
                    }, function (error) {
                        $log.error("dbDecisions.getDecisions ", arguments);
                        self.errorCode = error.errorCode;<commit_msg>Mtg: voting data initialisation and sanity check<commit_after>/**
 * (c) 2016 <NAME>
 * Licensed under the MIT license.
 */
'use strict';

/**
 * @ngdoc directive
 * @name dashboard.decisionsDirective
 * @description
 * # decisionsDirective
 */
angular.module('dashboard')
    .directive('dbDecisions', [function () {

        var controller = ['$log', '$scope', 'AhjoMeetingSrv', 'StorageSrv', 'CONST', 'PROPS', '$rootScope', function ($log, $scope, AhjoMeetingSrv, StorageSrv, CONST, PROPS, $rootScope) {
            $log.log("dbDecisions: CONTROLLER");
            var self = this;
            self.loading = false;
            self.types = [];
            self.selectedItem = null;
            self.record = null;
            self.supporter = null;
            self.voting = null;
            self.isTooltips = $rootScope.isTooltips;
            self.errorCode = 0;
            self.record = [];
            self.supporter = [];
            self.voting = [];
            var mtgTopicSelected = StorageSrv.getKey(CONST.KEY.TOPIC);
            var mtgItemSelected = StorageSrv.getKey(CONST.KEY.MEETING_ITEM);

            // FUNCTIONS

            function getDecisions(aMtg, aTopic) {
                $log.debug("dbDecisions.getDecisions", arguments);
                if (angular.isObject(aTopic) && angular.isObject(aMtg)) {

                    AhjoMeetingSrv.getDecisions(aMtg.meetingGuid, aTopic.topicGuid).then(function (resp) {
                        $log.log("dbDecisions.getDecisions done", resp);
                        self.record = angular.isArray(resp.record) ? resp.record : [];
                        self.supporter = angular.isArray(resp.supporter) ? resp.supporter : [];
                        self.voting = angular.isArray(resp.voting) ? resp.voting : [];
                    }, function (error) {
                        $log.error("dbDecisions.getDecisions ", arguments);
                        self.errorCode = error.errorCode;
{'fraction_non_alphanumeric': 0.12437549303181698, 'fraction_numerical': 0.0026295030239284773, 'mean_word_length': 1.9038167938931299, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3203255', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1058, 'n_words': 198}