From 60191daa7bd17dee99c45ebeb147c9047a527b31 Mon Sep 17 00:00:00 2001 From: winniel24 Date: Mon, 27 Nov 2023 13:48:44 +0100 Subject: [PATCH] added pop-confirmation for process-list delete, todo: fix query error for both delete and copy --- .../components/process-list.tsx | 40 +++++++++---------- .../components/processes.tsx | 4 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/management-system-v2/components/process-list.tsx b/src/management-system-v2/components/process-list.tsx index f06c7d45b..f32d30d03 100644 --- a/src/management-system-v2/components/process-list.tsx +++ b/src/management-system-v2/components/process-list.tsx @@ -31,7 +31,7 @@ import ProcessEditButton from './process-edit-button'; import { toCaslResource } from '@/lib/ability/caslAbility'; import { useDeleteAsset, useInvalidateAsset, usePostAsset } from '@/lib/fetch-data'; import { useUserPreferences } from '@/lib/user-preferences'; -import ProcessDeleteModal from './process-delete'; +// import ProcessDeleteModal from './process-delete'; // import ProcessDeleteSingleModal from './process-delete-single'; import { useAbilityStore } from '@/lib/abilityStore'; import { AuthCan } from '@/lib/clientAuthComponents'; @@ -110,19 +110,19 @@ const ProcessList: FC = ({ onSettled: refreshData, }); - // const deleteSelectedProcesses = useCallback(() => { - // selection.forEach((id) => { - // deleteProcess({ - // params: { - // path: { - // definitionId: id as string, - // }, - // }, - // parseAs: 'text', - // }); - // }); - // setSelection([]); - // }, [deleteProcess, selection]); + const deleteSelectedProcesses = useCallback(() => { + selection.forEach((id) => { + deleteProcess({ + params: { + path: { + definitionId: id as string, + }, + }, + parseAs: 'text', + }); + }); + setSelection([]); + }, [deleteProcess, selection]); const actionBarGenerator = useCallback( (record: ProcessListProcess) => { @@ -170,7 +170,7 @@ const ProcessList: FC = ({ {/* TODO: delete with Popconfirm doesn't work, yet */} - {/* + = ({