Skip to content

Commit db8a066

Browse files
committed
fix: add deploymentAppCreated check in node
1 parent a8b0de4 commit db8a066

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/components/app/details/triggerView/workflow.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@ function cdPipelineToNode(cdPipeline: CdPipeline, dimensions: WorkflowDimensions
604604
isVirtualEnvironment: cdPipeline.isVirtualEnvironment,
605605
deploymentAppType: cdPipeline.deploymentAppType,
606606
helmPackageName: cdPipeline?.helmPackageName || '',
607-
isLast: isLast
607+
isLast: isLast,
608+
deploymentAppCreated: cdPipeline?.deploymentAppCreated,
608609
} as NodeAttr
609610
stageIndex++
610611

src/components/workflowEditor/Workflow.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ export class Workflow extends Component<WorkflowProps, WorkflowState> {
457457
appId={this.props.match.params.appId}
458458
getWorkflows={this.props.getWorkflows}
459459
reloadEnvironments={this.props.reloadEnvironments}
460+
deploymentAppCreated={node.deploymentAppCreated}
460461
/>
461462
)
462463
}

src/components/workflowEditor/nodes/CDNode.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ export class CDNode extends Component<CDNodeProps, CDNodeState> {
7878
}
7979

8080
deleteCD = (force: boolean, cascadeDelete: boolean) => {
81-
// TODO: Check for deployment app created case
82-
const isPartialDelete = this.props.deploymentAppType === DeploymentAppTypes.GITOPS && !force
81+
const isPartialDelete = this.props.deploymentAppType === DeploymentAppTypes.GITOPS && this.props.deploymentAppCreated && !force
8382
const payload = {
8483
action: isPartialDelete ? CD_PATCH_ACTION.DEPLOYMENT_PARTIAL_DELETE : CD_PATCH_ACTION.DELETE,
8584
appId: +this.props.appId,

0 commit comments

Comments
 (0)