Skip to content

Commit

Permalink
feat: updated the linked process delete confirmation message. (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
srvEq authored Jan 16, 2025
1 parent dbe0354 commit a5c15d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/DeleteNodeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const DeleteNodeDialog = ({
const { projectId } = useProjectId();
const dispatch = useStoreDispatch();
const queryClient = useQueryClient();
const { choice, mainActivity, subActivity, waiting } = NodeTypes;
const { choice, mainActivity, subActivity, waiting, linkedProcess } =
NodeTypes;

const deleteMutation = useMutation(
({
Expand Down Expand Up @@ -67,10 +68,14 @@ export const DeleteNodeDialog = ({

const getWarningMessage = () => {
const typeIsMainActivityOrChoice = type === mainActivity || type === choice;
const typeIsLinkedProcess = type === linkedProcess;

if (typeIsMainActivityOrChoice && hasChildren) {
return "This will delete **ALL** the cards below.\nAre you sure you want to proceed?";
}
if (typeIsLinkedProcess) {
return "Deleting this card will only remove the link, and will not affect the other process.";
}
return "This will delete the selected card";
};

Expand Down

0 comments on commit a5c15d2

Please sign in to comment.