X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b4adbf55b9a1950d70e2e44c28efb13eb4d0f077..3e3eaa213219ebcac9b52c8fbe3ec3ef7c39c863:/src/views-components/dialog-forms/create-collection-dialog.ts diff --git a/src/views-components/dialog-forms/create-collection-dialog.ts b/src/views-components/dialog-forms/create-collection-dialog.ts index d2699d83..d989d431 100644 --- a/src/views-components/dialog-forms/create-collection-dialog.ts +++ b/src/views-components/dialog-forms/create-collection-dialog.ts @@ -4,19 +4,26 @@ 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({ 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, + properties: data.properties, + })); } }) )(DialogCollectionCreate); - -// onSubmit: (data: { name: string, description: string }, files: UploadFile[]) => void; \ No newline at end of file