import { module } from 'angular' ; import type { ApplicationStateProvider , INestedState } from '@spinnaker/core' ; import { APPLICATION_STATE_PROVIDER } from '@spinnaker/core' ; import { KubernetesResourceDetails } from './ResourceDetails' ; export interface IKubernetesResourceStateParams { provider : string ; accountId : string ; region : string ; kubernetesResource : string ; } export const KUBERNETES_RESOURCE_STATES = 'spinnaker.core.kubernetesResource.states' ; module ( KUBERNETES_RESOURCE_STATES , [ APPLICATION_STATE_PROVIDER ] ) . config ( [ 'applicationStateProvider' , ( applicationStateProvider ) => { const kubernetesResourceDetails = { name : 'kubernetesResource' , url : '/manifest/:provider/:accountId/:region/:kubernetesResource' , views : { 'detail@../insight' : { component : KubernetesResourceDetails , $type : 'react' , } , } , resolve : { accountId : [ '$stateParams' , ( $stateParams ) => $stateParams . accountId ] , kubernetesResource : [ '$stateParams' , ( $stateParams ) => $stateParams ] , } , data : { pageTitleDetails : { title : 'Generic Kubernetes Resource Details' , nameParam : 'kubernetesResource' , accountParam : 'accountId' , regionParam : 'region' , } , history : { type : 'kubernetesResource' , } , } , } ; applicationStateProvider . addInsightDetailState ( kubernetesResourceDetails ) ; } , ] ) ;