Skip to content

Commit 9489bbe

Browse files
committed
fix: rollback and deploy modal opening together
1 parent eb0e595 commit 9489bbe

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/components/ApplicationGroup/Details/TriggerView/BulkCDTrigger.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import { BulkCDDetailType, BulkCDTriggerType } from '../../AppGroup.types'
7474
import { BULK_CD_DEPLOYMENT_STATUS, BULK_CD_MATERIAL_STATUS, BULK_CD_MESSAGING, BUTTON_TITLE } from '../../Constants'
7575
import { BULK_ERROR_MESSAGES } from './constants'
7676
import TriggerResponseModalBody, { TriggerResponseModalFooter } from './TriggerResponseModal'
77-
import { getIsImageApprovedByDeployerSelected, getIsNonApprovedImageSelected } from './utils'
77+
import { getIsImageApprovedByDeployerSelected, getIsNonApprovedImageSelected, getSelectedAppListForBulkStrategy } from './utils'
7878

7979
const DeploymentWindowInfoBar = importComponentFromFELibrary('DeploymentWindowInfoBar')
8080
const BulkDeployResistanceTippy = importComponentFromFELibrary('BulkDeployResistanceTippy')
@@ -991,8 +991,6 @@ const BulkCDTrigger = ({
991991
)
992992
}
993993

994-
console.log(appList)
995-
996994
return (
997995
<Drawer position="right" width="75%" minWidth="1024px" maxWidth="1200px">
998996
<div className="bg__primary bulk-ci-trigger-container">
@@ -1004,7 +1002,7 @@ const BulkCDTrigger = ({
10041002
bulkDeploymentStrategy={bulkDeploymentStrategy}
10051003
pipelineIdVsStrategyMap={pipelineIdVsStrategyMap}
10061004
setPipelineIdVsStrategyMap={setPipelineIdVsStrategyMap}
1007-
appList={appList.map((app) => ({ pipelineId: +app.cdPipelineId, appName: app.name }))}
1005+
appList={getSelectedAppListForBulkStrategy(appList)}
10081006
/>
10091007
) : (
10101008
<>

src/components/ApplicationGroup/Details/TriggerView/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ export const getIsImageApprovedByDeployerSelected = (appList: BulkCDDetailType[]
4545
material.userApprovalMetadata?.hasCurrentUserApproved,
4646
)
4747
})
48+
49+
export const getSelectedAppListForBulkStrategy = (appList: BulkCDDetailType[]) =>
50+
appList.map((app) => ({ pipelineId: +app.cdPipelineId, appName: app.name }))

src/components/app/details/appDetails/AppDetailsCDButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ const AppDetailsCDButton = ({
6262
const location = useLocation()
6363
const queryParams = new URLSearchParams(location.search)
6464
const mode = queryParams.get('mode')
65+
const materialType = queryParams.get('materialType')
6566

6667
const onClickDeployButton = (event) => {
6768
stopPropagation(event)
6869
const newParams = {
6970
...searchParams,
7071
mode: URL_PARAM_MODE_TYPE.LIST,
72+
materialType: isForRollback ? MATERIAL_TYPE.rollbackMaterialList : MATERIAL_TYPE.inputMaterialList,
7173
}
7274

7375
history.push({
@@ -114,8 +116,6 @@ const AppDetailsCDButton = ({
114116
isVirtualEnvironment,
115117
}
116118

117-
const materialType = isForRollback ? MATERIAL_TYPE.rollbackMaterialList : MATERIAL_TYPE.inputMaterialList
118-
119119
const renderApprovalMaterial = () =>
120120
ApprovalMaterialModal &&
121121
location.search.includes(TRIGGER_VIEW_PARAMS.APPROVAL_NODE) && (

0 commit comments

Comments
 (0)