{"size": 1323, "ext": "js", "max_stars_repo_path": "components/automate-workflow-web/src/routes/change/review/files/files.js", "max_stars_repo_name": "fossabot/automate-1", "max_stars_repo_stars_event_min_datetime": "2019-04-16T15:04:53.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-21T14:10:44.000Z", "max_issues_repo_path": "components/automate-workflow-web/src/routes/change/review/files/files.js", "max_issues_repo_name": "fossabot/automate-1", "max_issues_repo_issues_event_min_datetime": "2019-04-16T16:16:01.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T15:39:35.000Z", "max_forks_repo_path": "components/automate-workflow-web/src/routes/change/review/files/files.js", "max_forks_repo_name": "fossabot/automate-1", "max_forks_repo_forks_event_min_datetime": "2019-04-16T15:21:27.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-26T09:50:08.000Z"}
{"max_stars_count": 191, "max_issues_count": 4882, "max_forks_count": 114, "avg_line_length": 31.5, "max_line_length": 88, "alphanum_fraction": 0.5631141345}
import ng from 'angular';
import { find } from 'lodash';
import uiRouter from 'angular-ui-router';
import filesController from './files_controller';
import filesComponent from './files_component';

export default ng
  .module('cd.routes.change.review.files', [
    uiRouter,
    filesController,
    filesComponent
  ])
  .config(($stateProvider) => {
    $stateProvider
      .state('main.enterprise.organizations.organization.project.change.review.files', {
        url: '',
        controller: 'filesController',
        template: '<cd-files>',
        resolve: {
          patchset: ['$stateParams', 'change', function ($stateParams, change) {
            return find(change.patchsets, {
              sequenceNumber: parseInt($stateParams.end.split('p')[1])
            });
          }],
          comments: ['change', 'patchset', function (change, patchset) {
            return change.comments.$refresh({
              patchset: patchset.sequenceNumber
            }).$promise;
          }]
        },
        reloadOnSearch: false,
        onEnter: ['$stateParams', 'change', function ($stateParams, change) {
          this.data = {
            title:
              $stateParams.file + ' · ' + change.title + ' · ' + change.topic +
              '/' + change.target
          };
        }]
      });
  })
  .name;
