import type { StateParams } from '@uirouter/angularjs' ; import { module } from 'angular' ; import type { ApplicationStateProvider , INestedState } from '@spinnaker/core' ; import { APPLICATION_STATE_PROVIDER } from '@spinnaker/core' ; import { TargetGroupDetails } from './TargetGroupDetails' ; export const TARGET_GROUP_STATES = 'spinnaker.amazon.loadBalancer.targetGroup.states' ; module ( TARGET_GROUP_STATES , [ APPLICATION_STATE_PROVIDER ] ) . config ( [ 'applicationStateProvider' , ( applicationStateProvider ) => { const targetGroupDetails = { name : 'targetGroupDetails' , url : '/targetGroupDetails/:provider/:accountId/:region/:vpcId/:loadBalancerName/:name' , params : { vpcId : { value : null , squash : true , } , } , views : { 'detail@../insight' : { component : TargetGroupDetails , $type : 'react' , } , } , resolve : { accountId : [ '$stateParams' , ( $stateParams ) => $stateParams . accountId ] , targetGroup : [ '$stateParams' , ( $stateParams ) => { return { loadBalancerName : $stateParams . loadBalancerName , name : $stateParams . name , accountId : $stateParams . accountId , region : $stateParams . region , vpcId : $stateParams . vpcId , } ; } , ] , } , data : { pageTitleDetails : { title : 'Target Group Details' , nameParam : 'name' , accountParam : 'accountId' , regionParam : 'region' , } , } , } ; applicationStateProvider . addInsightDetailState ( targetGroupDetails ) ; } , ] ) ;