[arvados-workbench2] updated: 2.4.0-364-g13e91447

git repository hosting git at public.arvados.org
Fri Dec 9 20:52:54 UTC 2022


Summary of changes:
 src/store/collections/collection-create-actions.ts |  5 ++++-
 src/store/collections/collection-update-actions.ts |  5 ++++-
 src/store/projects/project-create-actions.ts       |  5 ++++-
 src/store/projects/project-update-actions.ts       | 12 +++++++++++-
 4 files changed, 23 insertions(+), 4 deletions(-)

       via  13e91447d2ca6613f7d1f9a43dfc679dc4409ad7 (commit)
      from  9123f234b9b8240cbcd8570421d87fe3af6b97e4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 13e91447d2ca6613f7d1f9a43dfc679dc4409ad7
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Fri Dec 9 21:51:48 2022 +0100

    19691: Improves error message reporting.
    
    Also, adds unknown error message handling to project update dialog.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/src/store/collections/collection-create-actions.ts b/src/store/collections/collection-create-actions.ts
index 939ae9f9..f3d1fd3b 100644
--- a/src/store/collections/collection-create-actions.ts
+++ b/src/store/collections/collection-create-actions.ts
@@ -71,8 +71,11 @@ export const createCollection = (data: CollectionCreateFormDialogData) =>
             } else {
                 dispatch(stopSubmit(COLLECTION_CREATE_FORM_NAME));
                 dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_CREATE_FORM_NAME }));
+                const errMsg = e.errors
+                    ? e.errors.join('')
+                    : 'There was an error while creating the collection';
                 dispatch(snackbarActions.OPEN_SNACKBAR({
-                    message: e.errors.join(''),
+                    message: errMsg,
                     hideDuration: 2000,
                     kind: SnackbarKind.ERROR
                 }));
diff --git a/src/store/collections/collection-update-actions.ts b/src/store/collections/collection-update-actions.ts
index 2e66ce2c..d955c947 100644
--- a/src/store/collections/collection-update-actions.ts
+++ b/src/store/collections/collection-update-actions.ts
@@ -72,8 +72,11 @@ export const updateCollection = (collection: CollectionUpdateFormDialogData) =>
                 dispatch(stopSubmit(COLLECTION_UPDATE_FORM_NAME, { name: 'Collection with the same name already exists.' } as FormErrors));
             } else {
                 dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_UPDATE_FORM_NAME }));
+                const errMsg = e.errors
+                    ? e.errors.join('')
+                    : 'There was an error while updating the collection';
                 dispatch(snackbarActions.OPEN_SNACKBAR({
-                    message: e.errors.join(''),
+                    message: errMsg,
                     hideDuration: 2000,
                     kind: SnackbarKind.ERROR }));
                 }
diff --git a/src/store/projects/project-create-actions.ts b/src/store/projects/project-create-actions.ts
index e70ff0f6..c15c3748 100644
--- a/src/store/projects/project-create-actions.ts
+++ b/src/store/projects/project-create-actions.ts
@@ -79,8 +79,11 @@ export const createProject = (project: Partial<ProjectResource>) =>
             } else {
                 dispatch(stopSubmit(PROJECT_CREATE_FORM_NAME));
                 dispatch(dialogActions.CLOSE_DIALOG({ id: PROJECT_CREATE_FORM_NAME }));
+                const errMsg = e.errors
+                    ? e.errors.join('')
+                    : 'There was an error while creating the collection';
                 dispatch(snackbarActions.OPEN_SNACKBAR({
-                    message: e.errors.join(''),
+                    message: errMsg,
                     hideDuration: 2000,
                     kind: SnackbarKind.ERROR
                 }));
diff --git a/src/store/projects/project-update-actions.ts b/src/store/projects/project-update-actions.ts
index a9255e29..057c7cfa 100644
--- a/src/store/projects/project-update-actions.ts
+++ b/src/store/projects/project-update-actions.ts
@@ -24,6 +24,7 @@ import { Participant } from "views-components/sharing-dialog/participant-select"
 import { ProjectProperties } from "./project-create-actions";
 import { getResource } from "store/resources/resources";
 import { ProjectResource } from "models/project";
+import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
 
 export interface ProjectUpdateFormDialogData {
     uuid: string;
@@ -71,7 +72,16 @@ export const updateProject = (project: ProjectUpdateFormDialogData) =>
             const error = getCommonResourceServiceError(e);
             if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
                 dispatch(stopSubmit(PROJECT_UPDATE_FORM_NAME, { name: 'Project with the same name already exists.' } as FormErrors));
+            } else {
+                dispatch(dialogActions.CLOSE_DIALOG({ id: PROJECT_UPDATE_FORM_NAME }));
+                const errMsg = e.errors
+                    ? e.errors.join('')
+                    : 'There was an error while updating the project';
+                dispatch(snackbarActions.OPEN_SNACKBAR({
+                    message: errMsg,
+                    hideDuration: 2000,
+                    kind: SnackbarKind.ERROR }));
             }
-            return ;
+            return;
         }
     };

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list