[ARVADOS-WORKBENCH2] updated: 1.1.4-480-gecd0b36

Git user git at public.curoverse.com
Fri Aug 3 02:27:35 EDT 2018


Summary of changes:
 src/store/collections/updator/collection-updator-action.ts        | 8 ++++----
 .../update-collection-dialog/update-collection-dialog..tsx        | 4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

       via  ecd0b36ecf1afc02871dff06c924131dcaccd856 (commit)
      from  05d13a8a142ccab6425905bd6706ba77cb5f06dd (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 ecd0b36ecf1afc02871dff06c924131dcaccd856
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Fri Aug 3 08:27:23 2018 +0200

    fix services after merge and improve onSubmit method for save collection
    
    Feature #13903
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/store/collections/updator/collection-updator-action.ts b/src/store/collections/updator/collection-updator-action.ts
index ac422f0..e12bfe5 100644
--- a/src/store/collections/updator/collection-updator-action.ts
+++ b/src/store/collections/updator/collection-updator-action.ts
@@ -6,7 +6,7 @@ import { default as unionize, ofType, UnionOf } from "unionize";
 import { Dispatch } from "redux";
 
 import { RootState } from "../../store";
-import { collectionService } from '../../../services/services';
+import { ServiceRepository } from "../../../services/services";
 import { CollectionResource } from '../../../models/collection';
 import { initialize } from 'redux-form';
 import { collectionPanelActions } from "../../collection-panel/collection-panel-action";
@@ -33,12 +33,12 @@ export const openUpdator = (uuid: string) =>
     };
 
 export const updateCollection = (collection: Partial<CollectionResource>) =>
-    (dispatch: Dispatch, getState: () => RootState) => {
+    (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         const { uuid } = getState().collections.updator;
-        return collectionService
+        return services.collectionService
             .update(uuid, collection)
             .then(collection => {
-                    dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection }));
+                    dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection as CollectionResource }));
                     dispatch(collectionUpdatorActions.UPDATE_COLLECTION_SUCCESS());
                 }
             );
diff --git a/src/views-components/update-collection-dialog/update-collection-dialog..tsx b/src/views-components/update-collection-dialog/update-collection-dialog..tsx
index 8daff01..a91277e 100644
--- a/src/views-components/update-collection-dialog/update-collection-dialog..tsx
+++ b/src/views-components/update-collection-dialog/update-collection-dialog..tsx
@@ -23,7 +23,9 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
     onSubmit: (data: { name: string, description: string }) => {
         return dispatch<any>(editCollection(data))
             .catch((e: any) => {
-                throw new SubmissionError({ name: e.errors.join("").includes("UniqueViolation") ? "Collection with this name already exists." : "" });
+                if(e.errors) {
+                    throw new SubmissionError({ name: e.errors.join("").includes("UniqueViolation") ? "Collection with this name already exists." : "" });
+                }
             });
     }
 });

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list