18123: Add edit permission level dialog for group members and outgoing permissions.
[arvados.git] / src / views-components / dialog-forms / create-collection-dialog.ts
index d2699d8398b31cacbe6df8cf5535cf96291cfff8..7ef6e4b3cd4b3b048bfa01b59801fb2b282f93a7 100644 (file)
@@ -4,19 +4,20 @@
 
 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 { DialogCollectionCreate } from "~/views-components/dialog-create/dialog-collection-create";
+import { withDialog } from "store/dialog/with-dialog";
+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,
+        touchOnChange: true,
         onSubmit: (data, dispatch) => {
-            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, storageClassesDesired: data.storageClassesDesired }));
         }
     })
 )(DialogCollectionCreate);
-
-// onSubmit: (data: { name: string, description: string }, files: UploadFile[]) => void;
\ No newline at end of file