<commit_before>define(['app', 'underscore'], function(app, _) {
  app.controller('ReportsCtrl', ['$scope', 'reports', '$rootScope', 'growl',
    function($scope, reports, $rootScope, growl) {
      var self = this;

      $scope.nationalReportQueries = [{
        id: '5th',
        name: '5th National Report'
      }, {
        id: '4th',
        name: '4th National Report'
      }, {
        id: '3rd',
        name: '3rd National Report'
      }, {
        id: '2nd',
        name: '2nd National Report'
      }, {
        id: '1st',
        name: '1st National Report'
      }];

      // The range is [start, end);
      $scope.aichiTargetOptions = _.range(1, 21);


      $scope.selectedQuery = '';
      $scope.loading = false;

      $scope.setQuery = function(schema, id) {
        $scope.setSelectedQuery(schema, id);
      };

      $scope.setSelectedQuery = function(schema, qid) {
        if ($scope.selectedQuery === schema) return;
        $scope.selectedQuery = qid;
        self.getReportsByType(schema, qid);
      };

      this.getReportsByType = function(schema, type) {
        $scope.loading = true;
        var params = {
          schema: schema
        };
        params[(/AICHI/.test(type)) ? 'aichiTarget' : 'reportType'] = type;

        reports.getReports(params)
          .then(function(reports) {
            $scope.loading = false;
            if (!reports.length) growl.addInfoMessage('No reports of this type were found...');
            $rootScope.$emit('updateMap', reports);
          })
          .catch(function(err) {
            $scope.loading = false;
            growl.addErrorMessage(err + ': Please try again.');
          });
      };

      $scope.resetCenter = function() {
        $rootScope.$emit('resetCenter');
      };
    }
  ]);
});<commit_msg>adding map of guids for progress assessment<commit_after>define(['app', 'underscore'], function(app, _) {
  app.controller('ReportsCtrl', ['$scope', 'reports', '$rootScope', 'growl',
    function($scope, reports, $rootScope, growl) {
      var self = this;

      $scope.nationalReportQueries = [{
        id: '5th',
        name: '5th National Report'
      }, {
        id: '4th',
        name: '4th National Report'
      }, {
        id: '3rd',
        name: '3rd National Report'
      }, {
        id: '2nd',
        name: '2nd National Report'
      }, {
        id: '1st',
        name: '1st National Report'
      }];

      $scope.progress = [{
        "guid": "884D8D8C-F2AE-4AAC-82E3-5B73CE627D45",
        "verbal": "On track to exceed target"
      }, {
        "guid": "E49EF94E-0590-486C-903B-68C5E54EC089",
        "verbal": "On track to achieve target"
      }, {
        "guid": "486C27A7-6BDF-460D-92F8-312D337EC6E2",
        "verbal": " Progress towards target but at an insufficient rate "
      }, {
        "guid": "2D241E0A-1D17-4A0A-9D52-B570D34B23BF",
        "verbal": "No significant change"
      }, {
        "guid": "36A174B8-085A-4363-AE11-E34163A9209C",
        "verbal": "Moving away from target"
      }];

      // The range is [start, end);
      $scope.aichiTargetOptions = _.range(1, 21);


      $scope.selectedQuery = '';
      $scope.loading = false;

      $scope.setQuery = function(schema, id) {
        $scope.setSelectedQuery(schema, id);
      };

      $scope.setSelectedQuery = function(schema, qid) {
        if ($scope.selectedQuery === schema) return;
        $scope.selectedQuery = qid;
        self.getReportsByType(schema, qid);
      };

      this.getReportsByType = function(schema, type) {
        $scope.loading = true;
        var params = {
          schema: schema
        };
        params[(/AICHI/.test(type)) ? 'aichiTarget' : 'reportType'] = type;

        reports.getReports(params)
          .then(function(reports) {
            $scope.loading = false;
            if (!reports.length) growl.addInfoMessage('No reports of this type were found...');
            $rootScope.$emit('updateMap', reports);
          })
          .
        catch (function(err) {
          $scope.loading = false;
          growl.addErrorMessage(err + ': Please try again.');
        });
      };

      $scope.resetCenter = function() {
        $rootScope.$emit('resetCenter');
      };
    }
  ]);
});
{'fraction_non_alphanumeric': 0.15393654524089306, 'fraction_numerical': 0.030787309048178613, 'mean_word_length': 2.0291814946619215, 'pattern_counts': {'":': 10, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3724899', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1336, 'n_words': 270}