15921: Fix collection create from upload dialog 15921-trailing-slash-fix
authorPeter Amstutz <peter.amstutz@curii.com>
Wed, 11 Dec 2019 21:55:15 +0000 (16:55 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Wed, 11 Dec 2019 21:55:15 +0000 (16:55 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

src/store/collections/collection-create-actions.ts
src/views-components/dialog-forms/create-collection-dialog.ts

index e077b2a5b33c47b717630baf51c2f83b7bb600a7..83b3e89c2b162e3f718f14005ea556c19eaf973c 100644 (file)
@@ -49,7 +49,6 @@ export const createCollection = (data: CollectionCreateFormDialogData) =>
             await dispatch<any>(uploadCollectionFiles(newCollection.uuid));
             dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_CREATE_FORM_NAME }));
             dispatch(reset(COLLECTION_CREATE_FORM_NAME));
-            dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_CREATE_FORM_NAME));
             return newCollection;
         } catch (e) {
             const error = getCommonResourceServiceError(e);
@@ -65,7 +64,8 @@ export const createCollection = (data: CollectionCreateFormDialogData) =>
                 }));
                 await services.collectionService.delete(newCollection!.uuid);
             }
-            dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_CREATE_FORM_NAME));
             return;
+        } finally {
+            dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_CREATE_FORM_NAME));
         }
     };
index 785be787f92952daaa606a77a1d51bda436f9d27..374b070b22e914f6c9865ab0ca4a770b4b327716 100644 (file)
@@ -14,7 +14,9 @@ export const CreateCollectionDialog = compose(
     reduxForm<CollectionCreateFormDialogData>({
         form: COLLECTION_CREATE_FORM_NAME,
         onSubmit: (data, dispatch) => {
-            dispatch(createCollection(data));
+            // Somehow an extra field called 'files' gets added, copy
+            // the data object to get rid of it.
+            dispatch(createCollection({ ownerUuid: data.ownerUuid, name: data.name, description: data.description }));
         }
     })
 )(DialogCollectionCreate);