16212: Refactors PeopleSelect component used on 'Share' dialog.
[arvados.git] / src / views-components / dialog-forms / create-collection-dialog.ts
index 30c999ca037d67750a02f30a21086d0f5079ea83..374b070b22e914f6c9865ab0ca4a770b4b327716 100644 (file)
@@ -5,17 +5,18 @@
 import { compose } from "redux";
 import { reduxForm } from 'redux-form';
 import { withDialog } from "~/store/dialog/with-dialog";
-import { addCollection, COLLECTION_CREATE_FORM_NAME, CollectionCreateFormDialogData } from '~/store/collections/collection-create-actions';
-import { UploadFile } from "~/store/collections/uploader/collection-uploader-actions";
+import { COLLECTION_CREATE_FORM_NAME, CollectionCreateFormDialogData } from '~/store/collections/collection-create-actions';
 import { DialogCollectionCreate } from "~/views-components/dialog-create/dialog-collection-create";
+import { createCollection } from "~/store/workbench/workbench-actions";
 
 export const CreateCollectionDialog = compose(
     withDialog(COLLECTION_CREATE_FORM_NAME),
     reduxForm<CollectionCreateFormDialogData>({
         form: COLLECTION_CREATE_FORM_NAME,
         onSubmit: (data, dispatch) => {
-            console.log('onSubmit: ', data);
-            dispatch(addCollection(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);
\ No newline at end of file
+)(DialogCollectionCreate);