From 71b2c3cf3bea4a4bf157db603b8eb9cba65e5bf3 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Fri, 7 Feb 2025 10:09:49 +0100 Subject: [PATCH] fix(frontend): add handleDeleteNlpValues function --- .../components/nlp/components/NlpValue.tsx | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/nlp/components/NlpValue.tsx b/frontend/src/components/nlp/components/NlpValue.tsx index 57dd0462..1864eb43 100644 --- a/frontend/src/components/nlp/components/NlpValue.tsx +++ b/frontend/src/components/nlp/components/NlpValue.tsx @@ -156,6 +156,16 @@ export const NlpValues = ({ entityId }: { entityId: string }) => { const handleSelectionChange = (selection: GridRowSelectionModel) => { setSelectedNlpValues(selection as string[]); }; + const handleDeleteNlpValues = async () => { + const isConfirmed = await dialogs.confirm(ConfirmDialogBody, { + mode: "selection", + count: selectedNlpValues.length, + }); + + if (isConfirmed) { + deleteNlpValues(selectedNlpValues); + } + }; return ( @@ -209,22 +219,10 @@ export const NlpValues = ({ entityId }: { entityId: string }) => { {selectedNlpValues.length > 0 && (