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 <11219262+ashutosh16@users.noreply.github.com>
  • Loading branch information
ashutosh16 committed Mar 12, 2024
1 parent ff05530 commit 5ac7cb8
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 5ac7cb8

Please sign in to comment.