<commit_before>import moment from 'moment';

import mapTemplate from './map.html!text';
import mapController from './map-controller';

export default function routes($stateProvider) {

  return $stateProvider
    .state('home.mapData', {
      abstract: true,
      url: '/map?month&year',
      template: '<ui-view></ui-view>',
      // Default parameters in case query string isn't set
      params: {
        month: '' + moment().month(),
        year: '' + moment().year()
      },
      resolve: {
        startDate: ['$stateParams',
          ($stateParams) => moment().startOf('month')
            .month($stateParams.month - 1)
            .year($stateParams.year)
        ],
        endDate: ['startDate',
          (startDate) => startDate.clone()
            .endOf('month')
        ],
        recalls: ['foodRecallService', 'startDate', 'endDate',
          (foodRecallService, startDate, endDate) => {
            return foodRecallService.getRecallsForPeriod(startDate, endDate);
          }
        ]
      }
    })
    .state('home.map', {<commit_msg>Default month filter to January instead of current month for better likelihood of showing data on initial visit<commit_after>import moment from 'moment';

import mapTemplate from './map.html!text';
import mapController from './map-controller';

export default function routes($stateProvider) {

  return $stateProvider
    .state('home.mapData', {
      abstract: true,
      url: '/map?month&year',
      template: '<ui-view></ui-view>',
      // Default parameters in case query string isn't set
      params: {
        month: '1', // January
        year: '' + moment().year()
      },
      resolve: {
        startDate: ['$stateParams',
          ($stateParams) => moment().startOf('month')
            .month($stateParams.month - 1)
            .year($stateParams.year)
        ],
        endDate: ['startDate',
          (startDate) => startDate.clone()
            .endOf('month')
        ],
        recalls: ['foodRecallService', 'startDate', 'endDate',
          (foodRecallService, startDate, endDate) => {
            return foodRecallService.getRecallsForPeriod(startDate, endDate);
          }
        ]
      }
    })
    .state('home.map', {
{'fraction_non_alphanumeric': 0.145748987854251, 'fraction_numerical': 0.001349527665317139, 'mean_word_length': 2.304606240713224, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '3061954', 'n_tokens_mistral': 619, 'n_tokens_neox': 608, 'n_words': 142}