<commit_before>'use strict';
(function() {
// STATES
  var states = angular.module('cla.states'),
    operatorStates = angular.module('cla.states.operator'),
    providerStates = angular.module('cla.states.provider');

  states.getStates = function(APP_BASE_URL) {
    var defs = {};

    defs.Layout = {
      name: 'layout',
      abstract: true,
      templateUrl: 'base.html',
      controller: 'LayoutCtrl'
    };

    defs.CaseListState = {
      name: 'case_list',
      parent: 'layout',
      url: APP_BASE_URL+'?person_ref?search?ordering?page',
      templateUrl: 'case_list.html',
      controller: 'CaseListCtrl',
      resolve: {
        cases: ['$stateParams', 'Case', function($stateParams, Case){
          var params = {
            person_ref: $stateParams.person_ref,
            search: $stateParams.search,
            ordering: $stateParams.ordering,
            page: $stateParams.page
          };

          // by default, if no search params is defined, get dashboard cases
          // this can be easily customised by backend
          if (!params.search) {
            params.dashboard = 1;
          }

          return Case.query(params).$promise;
        }],
        person: ['cases', '$stateParams', function(cases, $stateParams) {
          var person_ref = $stateParams.person_ref,
              personal_details;

          if (!person_ref || !cases.results.length) {
            personal_details = {};
          } else {
            var case_ = cases.results[0];
            personal_details = {
              reference: case_.personal_details,
              full_name: case_.full_name,
              postcode: case_.postcode
            };
          }

          return personal_details;
        }]<commit_msg>Allow filtering specialist case list using new and accepted URL parameters<commit_after>'use strict';
(function() {
// STATES
  var states = angular.module('cla.states'),
    operatorStates = angular.module('cla.states.operator'),
    providerStates = angular.module('cla.states.provider');

  states.getStates = function(APP_BASE_URL) {
    var defs = {};

    defs.Layout = {
      name: 'layout',
      abstract: true,
      templateUrl: 'base.html',
      controller: 'LayoutCtrl'
    };

    defs.CaseListState = {
      name: 'case_list',
      parent: 'layout',
      url: APP_BASE_URL+'?person_ref?search?ordering?page?new?accepted',
      templateUrl: 'case_list.html',
      controller: 'CaseListCtrl',
      resolve: {
        cases: ['$stateParams', 'Case', function($stateParams, Case){
          var params = {
            person_ref: $stateParams.person_ref,
            search: $stateParams.search,
            ordering: $stateParams.ordering,
            page: $stateParams.page,
            new: $stateParams.new,
            accepted: $stateParams.accepted
          };

          // by default, if no search params is defined, get dashboard cases
          // this can be easily customised by backend
          if (!params.search) {
            params.dashboard = 1;
          }

          return Case.query(params).$promise;
        }],
        person: ['cases', '$stateParams', function(cases, $stateParams) {
          var person_ref = $stateParams.person_ref,
              personal_details;

          if (!person_ref || !cases.results.length) {
            personal_details = {};
          } else {
            var case_ = cases.results[0];
            personal_details = {
              reference: case_.personal_details,
              full_name: case_.full_name,
              postcode: case_.postcode
            };
          }

          return personal_details;
        }]
{'fraction_non_alphanumeric': 0.1171960569550931, 'fraction_numerical': 0.001095290251916758, 'mean_word_length': 2.026512013256007, 'pattern_counts': {'":': 0, '<': 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': '821592', 'n_tokens_mistral': 1011, 'n_tokens_neox': 983, 'n_words': 216}