Skip to content

Commit

Permalink
fix: add confirmation box in resource summary delete action
Browse files Browse the repository at this point in the history
Signed-off-by: ashutosh16 <[email protected]>
  • Loading branch information
ashutosh16 committed Mar 12, 2024
1 parent de44e14 commit 57cd094
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 13 additions & 1 deletion ui/src/app/applications/components/utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,16 @@

.radio-button {
margin-right: 0.1em;
}
}

.caution-message-container {
display: flex;
align-items: center;
margin: 10px 0;
font-size: .9em;
font-weight: 400;

.fa {
font-size: 1.2em;
}
}
7 changes: 6 additions & 1 deletion ui/src/app/applications/components/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,12 @@ export const deletePodAction = async (pod: appModels.Pod, appContext: AppContext
};

export const deletePopup = async (ctx: ContextApis, resource: ResourceTreeNode, application: appModels.Application, appChanged?: BehaviorSubject<appModels.Application>) => {
const isManaged = !!resource.status;
function isTopLevelResource(res: ResourceTreeNode, app: appModels.Application): boolean {
const uniqRes = `/${res.namespace}/${res.group}/${res.version}/${res.kind}/${res.name}`;
return app.status.resources.some(resStatus => `/${resStatus.namespace}/${resStatus.group}/${resStatus.version}/${resStatus.kind}/${resStatus.name}` === uniqRes);
}

const isManaged = isTopLevelResource(resource, application);
const deleteOptions = {
option: 'foreground'
};
Expand Down

0 comments on commit 57cd094

Please sign in to comment.