Skip to content

Commit 231a24b

Browse files
authored
Revert stash from codebase (#408)
Signed-off-by: LE SAULNIER Kevin <[email protected]>
1 parent 7317a5f commit 231a24b

File tree

8 files changed

+20
-410
lines changed

8 files changed

+20
-410
lines changed

src/components/dialogs/stashed-elements/stashed-elements-dialog.tsx

Lines changed: 0 additions & 218 deletions
This file was deleted.

src/components/menus/content-contextual-menu.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import CreateStudyDialog from '../dialogs/create-study-dialog/create-study-dialo
2828
import { DialogsId } from '../../utils/UIconstants';
2929

3030
import {
31+
deleteElements,
3132
duplicateCase,
3233
duplicateContingencyList,
3334
duplicateFilter,
@@ -42,7 +43,6 @@ import {
4243
renameElement,
4344
replaceFiltersWithScript,
4445
replaceFormContingencyListWithScript,
45-
stashElements,
4646
} from '../../utils/rest-api';
4747

4848
import { ContingencyListType, FilterType } from '../../utils/elementType';
@@ -292,16 +292,16 @@ const ContentContextualMenu = (props) => {
292292
}, [onClose, setOpenDialog]);
293293

294294
const [deleteError, setDeleteError] = useState('');
295-
const handleStashElements = useCallback(
295+
const handleDeleteElements = useCallback(
296296
(elementsUuids) => {
297-
stashElements(elementsUuids)
297+
deleteElements(elementsUuids, selectedDirectory.elementUuid)
298298
.catch((error) => {
299299
setDeleteError(error.message);
300300
handleLastError(error.message);
301301
})
302302
.finally(() => handleCloseDialog());
303303
},
304-
[handleCloseDialog, handleLastError]
304+
[selectedDirectory?.elementUuid, handleCloseDialog, handleLastError]
305305
);
306306

307307
const moveElementErrorToString = useCallback(
@@ -660,7 +660,7 @@ const ContentContextualMenu = (props) => {
660660
open={true}
661661
onClose={handleCloseDialog}
662662
onClick={() =>
663-
handleStashElements(
663+
handleDeleteElements(
664664
selectedElements.map((e) => e.elementUuid)
665665
)
666666
}

0 commit comments

Comments
 (0)