Merge branch 'master' into 14015-rename-a-file
[arvados.git] / src / views-components / collection-partial-copy-dialog / collection-partial-copy-dialog.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from "react";
6 import { compose } from "redux";
7 import { reduxForm, InjectedFormProps } from 'redux-form';
8 import { withDialog, WithDialogProps } from '~/store/dialog/with-dialog';
9 import { CollectionPartialCopyFields } from '../form-dialog/collection-form-dialog';
10 import { FormDialog } from '~/components/form-dialog/form-dialog';
11 import { COLLECTION_PARTIAL_COPY, doCollectionPartialCopy, CollectionPartialCopyFormData } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions';
12
13 export const CollectionPartialCopyDialog = compose(
14     withDialog(COLLECTION_PARTIAL_COPY),
15     reduxForm({
16         form: COLLECTION_PARTIAL_COPY,
17         onSubmit: (data: CollectionPartialCopyFormData, dispatch) => {
18             dispatch(doCollectionPartialCopy(data));
19         }
20     }))((props: WithDialogProps<string> & InjectedFormProps<CollectionPartialCopyFormData>) =>
21         <FormDialog
22             dialogTitle='Create a collection'
23             formFields={CollectionPartialCopyFields}
24             submitLabel='Create a collection'
25             {...props}
26         />);