Skip to content

Commit

Permalink
fix(ui): add confirmation box in resource summary delete action (argo…
Browse files Browse the repository at this point in the history
…proj#17485)

Signed-off-by: ashutosh16 <[email protected]>
  • Loading branch information
ashutosh16 authored Mar 15, 2024
1 parent 2b75efd commit 2f58d73
Showing 1 changed file with 6 additions and 1 deletion.
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.kind}/${res.name}`;
return app.status.resources.some(resStatus => `/${resStatus.namespace}/${resStatus.group}/${resStatus.kind}/${resStatus.name}` === uniqRes);
}

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

0 comments on commit 2f58d73

Please sign in to comment.