17782: Disabling typechecking for some common Field component usage.
[arvados.git] / src / views-components / dialog-forms / create-collection-dialog.ts
index 785be787f92952daaa606a77a1d51bda436f9d27..634406194e0e5e4c45aedbf71506b58da47764de 100644 (file)
@@ -4,17 +4,20 @@
 
 import { compose } from "redux";
 import { reduxForm } from 'redux-form';
-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";
+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(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);