<commit_before>'use strict';

// @ngInject

var PersonSearchController = function ($scope, $location, $controller, Person, npdcAppConfig) {

  $controller('NpolarBaseController', { $scope: $scope });
  $scope.resource = Person;
  npdcAppConfig.cardTitle = "Person";
  npdcAppConfig.search.local = {
    results: {
      subtitle: "jobtitle/en"
    }
  };

  let defaults = { limit: "50", sort: "-updated", fields: 'title,id,updated,jobtitle.en', facets: 'workplace,orgtree' };
  let invariants = $scope.security.isAuthenticated() ? {} : {} ;
  let query = Object.assign({}, defaults, invariants);

  let search = function (q) {
    $scope.search(Object.assign({}, query, q));
  };

  search(query);

  $scope.$on('$locationChangeSuccess', (event, data) => {
    search($location.search());
  });

};
module.exports = PersonSearchController;<commit_msg>Only search current employees<commit_after>'use strict';

// @ngInject

var PersonSearchController = function ($scope, $location, $controller, Person, npdcAppConfig) {

  $controller('NpolarBaseController', { $scope: $scope });
  $scope.resource = Person;
  npdcAppConfig.cardTitle = "Person";
  npdcAppConfig.search.local = {
    results: {
      subtitle: "jobtitle/en"
    }
  };

  let defaults = { limit: "50",
    sort: "-updated",
    fields: 'title,id,updated,jobtitle.en',
    facets: 'workplace,orgtree'
  };
  let invariants = $scope.security.isAuthenticated() ? {} : { 'filter-currently_employed': true } ;
  let query = Object.assign({}, defaults, invariants);

  let search = function (q) {
    $scope.search(Object.assign({}, query, q));
  };

  search(query);

  $scope.$on('$locationChangeSuccess', (event, data) => {
    search($location.search());
  });

};
module.exports = PersonSearchController;
{'fraction_non_alphanumeric': 0.17297908422837763, 'fraction_numerical': 0.0022611644997173543, 'mean_word_length': 4.299401197604791, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5433514', 'n_tokens_mistral': 579, 'n_tokens_neox': 554, 'n_words': 112}