<commit_before>define(['text!./undb-map.html',
    'app',

    'lodash',
        "data/ccc",
    './ammap3',
    "factories/km-utilities",
    "./filter-parties",
    "./filter-actors",
    "./filter-actions",
    "./filter-aichi",
  'jquery'
], function(template, app, _,ccc) {
    'use strict';

    app.directive('undbMap', ['$http', 'realm', '$q', '$timeout', '$location', '$filter','$document', function($http, realm, $q, $timeout, $location, $filter,$document) {
        return {
            restrict: 'E',
            template: template,
            replace: true,
            scope: {},
            require: 'undbMap',
            link: function($scope, $element, $attr, reportingDisplay) { // jshint ignore:line

                $scope.loaded = false;
                $scope.subQueries = {};
                $scope.message = '';
                $scope.link = '';
                $scope.toggleCaption = 1;
                $scope.loadingObj ={};
                $scope.loading = true;



                setLoading('countries',true);
                $http.get("/api/v2015/countries", {
                    cache: true
                }).then(function(o) {
                    $scope.countries = $filter('orderBy')(o.data, 'title|lstring');
                    $http.get("/api/v2013/index", {
                        params: {
                            'q': 'schema_s:nationalAssessment',
                            'sort': 'createdDate_dt desc',
                            'fl':'nationalTarget_EN_t,progress_EN_s,government_s,identifier_s,country_s,title_s, description_s,lat_d,lng_d',
                            'wt': 'json',
                            'start': 0,
                            'rows': 1000000,
                        }
                    }).then(function(o) {
                        if(Array.isArray(o.data.response.docs))
                          for(var i=0; i<o.data.response.docs.length;i++){
                            var natAssDoc =o.data.response.docs[i];
                            if(!natAssDoc.nationalTarget_EN_t)continue;
                            natAssDoc.progress=progressToNumber(natAssDoc.progress_EN_s);
                            for(var j=0; j<$scope.countries.length;j++){
                                if($scope.countries[j].code.toLowerCase()===natAssDoc.government_s){
                                  if(!$scope.countries[j].docs)$scope.countries[j].docs=[];
                                  if($scope.countries[j].docs.length===0 )$scope.countries[j].docs.push(natAssDoc);
                                  else if($scope.countries[j].docs[0].progress< natAssDoc.progress){
                                    $scope.countries[j].docs[0]=natAssDoc;

                                  }
                                }

                            }
                          }
                          setLoading('countries',false);
                    });
                    return;
                });



                //=======================================================================
                //
                //=======================================================================
                function getEvents() {
                  setLoading('event',true);
                return $http.get("/api/v2013/index", {
                    params: {
                        'q': 'schema_s:event AND lat_d:[* TO *] AND thematicArea_ss:CBD-SUBJECT-25TH-ANN',
                        'sort': 'createdDate_dt desc',
                        'fl':'logo*,id,identifier_s,country_s,title_s, description_s,lat_d,lng_d,endDate_dt,startDate_dt,aichiTarget_ss,thematicArea_ss',
                        'wt': 'json',
                        'start': 0,
                        'rows': 1000000,
                    }
                }).then(function(o) {<commit_msg>remove test query comited in error<commit_after>define(['text!./undb-map.html',
    'app',

    'lodash',
        "data/ccc",
    './ammap3',
    "factories/km-utilities",
    "./filter-parties",
    "./filter-actors",
    "./filter-actions",
    "./filter-aichi",
  'jquery'
], function(template, app, _,ccc) {
    'use strict';

    app.directive('undbMap', ['$http', 'realm', '$q', '$timeout', '$location', '$filter','$document', function($http, realm, $q, $timeout, $location, $filter,$document) {
        return {
            restrict: 'E',
            template: template,
            replace: true,
            scope: {},
            require: 'undbMap',
            link: function($scope, $element, $attr, reportingDisplay) { // jshint ignore:line

                $scope.loaded = false;
                $scope.subQueries = {};
                $scope.message = '';
                $scope.link = '';
                $scope.toggleCaption = 1;
                $scope.loadingObj ={};
                $scope.loading = true;



                setLoading('countries',true);
                $http.get("/api/v2015/countries", {
                    cache: true
                }).then(function(o) {
                    $scope.countries = $filter('orderBy')(o.data, 'title|lstring');
                    $http.get("/api/v2013/index", {
                        params: {
                            'q': 'schema_s:nationalAssessment',
                            'sort': 'createdDate_dt desc',
                            'fl':'nationalTarget_EN_t,progress_EN_s,government_s,identifier_s,country_s,title_s, description_s,lat_d,lng_d',
                            'wt': 'json',
                            'start': 0,
                            'rows': 1000000,
                        }
                    }).then(function(o) {
                        if(Array.isArray(o.data.response.docs))
                          for(var i=0; i<o.data.response.docs.length;i++){
                            var natAssDoc =o.data.response.docs[i];
                            if(!natAssDoc.nationalTarget_EN_t)continue;
                            natAssDoc.progress=progressToNumber(natAssDoc.progress_EN_s);
                            for(var j=0; j<$scope.countries.length;j++){
                                if($scope.countries[j].code.toLowerCase()===natAssDoc.government_s){
                                  if(!$scope.countries[j].docs)$scope.countries[j].docs=[];
                                  if($scope.countries[j].docs.length===0 )$scope.countries[j].docs.push(natAssDoc);
                                  else if($scope.countries[j].docs[0].progress< natAssDoc.progress){
                                    $scope.countries[j].docs[0]=natAssDoc;

                                  }
                                }

                            }
                          }
                          setLoading('countries',false);
                    });
                    return;
                });



                //=======================================================================
                //
                //=======================================================================
                function getEvents() {
                  setLoading('event',true);
                return $http.get("/api/v2013/index", {
                    params: {
                        'q': 'schema_s:event AND lat_d:[* TO *]',
                        'sort': 'createdDate_dt desc',
                        'fl':'logo*,id,identifier_s,country_s,title_s, description_s,lat_d,lng_d,endDate_dt,startDate_dt,aichiTarget_ss,thematicArea_ss',
                        'wt': 'json',
                        'start': 0,
                        'rows': 1000000,
                    }
                }).then(function(o) {
{'fraction_non_alphanumeric': 0.17083333333333334, 'fraction_numerical': 0.009375, 'mean_word_length': 1.2758518518518518, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1659695', 'n_tokens_mistral': 2126, 'n_tokens_neox': 1943, 'n_words': 257}