@@ -27,7 +27,6 @@ import {
27
27
URLS ,
28
28
ServerError ,
29
29
mapByKey ,
30
- DeploymentNodeType ,
31
30
} from '../../../Common'
32
31
import {
33
32
FetchIdDataStatus ,
@@ -45,7 +44,7 @@ import { DeploymentHistoryConfigDiff } from './DeploymentHistoryConfigDiff'
45
44
import { GitChanges , Scroller } from './History.components'
46
45
import Artifacts from './Artifacts'
47
46
import TriggerDetails from './TriggerDetails'
48
- import { DeploymentStageType , EMPTY_STATE_STATUS } from '../../constants'
47
+ import { DEPLOYMENT_STAGE_TO_NODE_MAP , EMPTY_STATE_STATUS } from '../../constants'
49
48
import './cicdHistory.scss'
50
49
51
50
const HistoryLogs : React . FC < HistoryLogsProps > = ( {
@@ -83,24 +82,12 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
83
82
envId : string
84
83
} > ( )
85
84
86
- const getCDWorkflowType = ( ) => {
87
- if ( triggerDetails . stage === DeploymentStageType . PRE ) {
88
- return DeploymentNodeType . PRECD
89
- }
90
-
91
- if ( triggerDetails . stage === DeploymentStageType . POST ) {
92
- return DeploymentNodeType . POSTCD
93
- }
94
-
95
- return DeploymentNodeType . CD
96
- }
97
-
98
85
const paramsData = {
99
86
appId,
100
87
envId,
101
88
appName : `${ triggerDetails . helmPackageName } .tgz` ,
102
89
workflowId : triggerDetails . id ,
103
- cdWorkflowType : getCDWorkflowType ( ) ,
90
+ cdWorkflowType : DEPLOYMENT_STAGE_TO_NODE_MAP [ triggerDetails . stage ] ,
104
91
}
105
92
106
93
const CDBuildReportUrl = `app/cd-pipeline/workflow/download/${ appId } /${ envId } /${ pipelineId } /${ triggerId } `
0 commit comments