15768: restored error snackbar on copy collection 422 Arvados-DCO-1.1-Signed-off...
authorLisa Knox <lisaknox83@gmail.com>
Wed, 11 Oct 2023 15:24:42 +0000 (11:24 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Wed, 11 Oct 2023 15:24:42 +0000 (11:24 -0400)
src/store/collections/collection-copy-actions.ts

index f2f5569a4bec648d35412a696cae6b14d8bb4402..9386fe3cf051633015c1ceca37d67e759c27fcdb 100644 (file)
@@ -14,6 +14,7 @@ import { progressIndicatorActions } from "store/progress-indicator/progress-indi
 import { initProjectsTreePicker } from "store/tree-picker/tree-picker-actions";
 import { getResource } from "store/resources/resources";
 import { CollectionResource } from "models/collection";
+import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
 
 export const COLLECTION_COPY_FORM_NAME = "collectionCopyFormName";
 export const COLLECTION_MULTI_COPY_FORM_NAME = "collectionMultiCopyFormName";
@@ -65,6 +66,13 @@ export const copyCollection =
                         ownerUuid: "A collection with the same name already exists in the target project.",
                     } as FormErrors)
                 );
+                dispatch(
+                    snackbarActions.OPEN_SNACKBAR({
+                        message: "Could not copy the collection.",
+                        hideDuration: 2000,
+                        kind: SnackbarKind.ERROR,
+                    })
+                );
             } else {
                 dispatch(dialogActions.CLOSE_DIALOG({ id: formName }));
                 throw new Error("Could not copy the collection.");