<commit_before>import { StateParams } from '@uirouter/angularjs';
import { module } from 'angular';
import { APPLICATION_STATE_PROVIDER, ApplicationStateProvider } from 'core/application/application.state.provider';
import { INestedState, STATE_CONFIG_PROVIDER, StateConfigProvider } from 'core/navigation/state.provider';

import { ProjectHeader } from './ProjectHeader';
import { CORE_PROJECTS_DASHBOARD_DASHBOARD_CONTROLLER } from './dashboard/dashboard.controller';
import { IProject } from '../domain/IProject';
import { CORE_PROJECTS_PROJECTS_CONTROLLER } from './projects.controller';
import { ProjectReader } from './service/ProjectReader';

export interface IProjectStateParms extends StateParams {
  project: string;
}

export const PROJECTS_STATES_CONFIG = 'spinnaker.core.projects.state.config';
module(PROJECTS_STATES_CONFIG, [
  CORE_PROJECTS_PROJECTS_CONTROLLER,
  CORE_PROJECTS_DASHBOARD_DASHBOARD_CONTROLLER,
  APPLICATION_STATE_PROVIDER,
  STATE_CONFIG_PROVIDER,
]).config([
  'stateConfigProvider',
  'applicationStateProvider',
  (stateConfigProvider: StateConfigProvider, applicationStateProvider: ApplicationStateProvider) => {
    const dashboard: INestedState = {
      name: 'dashboard',
      url: '/dashboard',
      views: {
        detail: {
          templateUrl: require('../projects/dashboard/dashboard.html'),
          controller: 'ProjectDashboardCtrl',
          controllerAs: 'vm',
        },
      },
      data: {
        pageTitleSection: {
          title: 'Dashboard',
        },
      },
    };

    const project: INestedState = {
      name: 'project',
      url: '/projects/{project}',
      resolve: {
        projectConfiguration: [
          '$stateParams',
          ($stateParams: IProjectStateParms) => {
            return ProjectReader.getProjectConfig($stateParams.project).then(
              (projectConfig: IProject) => projectConfig,
              (): IProject => {
                return {
                  id: null,
                  name: $stateParams.project,
                  email: null,
                  config: null,
                  notFound: true,
                };
              },
            );
          },
        ],
      },
      views: {
        'main@': {
          component: ProjectHeader,
          $type: 'react',
        },
      },
      data: {
        pageTitleMain: {
          field: 'project',
        },
        history: {
          type: 'projects',
          keyParams: ['project'],
        },
      },
      children: [dashboard],
    };

    const allProjects: INestedState = {
      name: 'projects',
      url: '/projects',
      views: {
        'main@': {
          templateUrl: require('../projects/projects.html'),
          controller: 'ProjectsCtrl',<commit_msg>fix(core/projects): Recent projects: only save the link to project dashboard (#9024)<commit_after>import { StateParams } from '@uirouter/angularjs';
import { module } from 'angular';
import { APPLICATION_STATE_PROVIDER, ApplicationStateProvider } from 'core/application/application.state.provider';
import { INestedState, STATE_CONFIG_PROVIDER, StateConfigProvider } from 'core/navigation/state.provider';

import { ProjectHeader } from './ProjectHeader';
import { CORE_PROJECTS_DASHBOARD_DASHBOARD_CONTROLLER } from './dashboard/dashboard.controller';
import { IProject } from '../domain/IProject';
import { CORE_PROJECTS_PROJECTS_CONTROLLER } from './projects.controller';
import { ProjectReader } from './service/ProjectReader';

export interface IProjectStateParms extends StateParams {
  project: string;
}

export const PROJECTS_STATES_CONFIG = 'spinnaker.core.projects.state.config';
module(PROJECTS_STATES_CONFIG, [
  CORE_PROJECTS_PROJECTS_CONTROLLER,
  CORE_PROJECTS_DASHBOARD_DASHBOARD_CONTROLLER,
  APPLICATION_STATE_PROVIDER,
  STATE_CONFIG_PROVIDER,
]).config([
  'stateConfigProvider',
  'applicationStateProvider',
  (stateConfigProvider: StateConfigProvider, applicationStateProvider: ApplicationStateProvider) => {
    const dashboard: INestedState = {
      name: 'dashboard',
      url: '/dashboard',
      views: {
        detail: {
          templateUrl: require('../projects/dashboard/dashboard.html'),
          controller: 'ProjectDashboardCtrl',
          controllerAs: 'vm',
        },
      },
      data: {
        pageTitleSection: {
          title: 'Dashboard',
        },
      },
    };

    const project: INestedState = {
      name: 'project',
      url: '/projects/{project}',
      resolve: {
        projectConfiguration: [
          '$stateParams',
          ($stateParams: IProjectStateParms) => {
            return ProjectReader.getProjectConfig($stateParams.project).then(
              (projectConfig: IProject) => projectConfig,
              (): IProject => {
                return {
                  id: null,
                  name: $stateParams.project,
                  email: null,
                  config: null,
                  notFound: true,
                };
              },
            );
          },
        ],
      },
      views: {
        'main@': {
          component: ProjectHeader,
          $type: 'react',
        },
      },
      data: {
        pageTitleMain: {
          field: 'project',
        },
        history: {
          type: 'projects',
          state: 'home.project',
          keyParams: ['project'],
        },
      },
      children: [dashboard],
    };

    const allProjects: INestedState = {
      name: 'projects',
      url: '/projects',
      views: {
        'main@': {
          templateUrl: require('../projects/projects.html'),
          controller: 'ProjectsCtrl',
{'fraction_non_alphanumeric': 0.11786600496277916, 'fraction_numerical': 0.0007089684509039348, 'mean_word_length': 2.3292035398230087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6740124', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1549, 'n_words': 291}