rename folder dialog-collection-copy -> dialog-copy
[arvados-workbench2.git] / src / views-components / dialog-create / dialog-collection-create.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 { InjectedFormProps } from 'redux-form';
7 import { WithDialogProps } from '~/store/dialog/with-dialog';
8 import { CollectionCreateFormDialogData } from '~/store/collections/collection-create-actions';
9 import { collectionUploaderActions, UploadFile } from "~/store/collections/uploader/collection-uploader-actions";
10 import { FormDialog } from '~/components/form-dialog/form-dialog';
11 import { CollectionNameField, CollectionDescriptionField } from '~/views-components/form-fields/collection-form-fields';
12 import { FileUpload } from '~/components/file-upload/file-upload';
13
14 // interface DialogCollectionDataProps {
15 //     open: boolean;
16 //     handleSubmit: any;
17 //     submitting: boolean;
18 //     invalid: boolean;
19 //     pristine: boolean;
20 //     files: UploadFile[];
21 // }
22
23 type DialogCollectionProps = WithDialogProps<{}> & InjectedFormProps<CollectionCreateFormDialogData>;
24
25 export const DialogCollectionCreate = (props: DialogCollectionProps) =>
26     <FormDialog
27         dialogTitle='Create a collection'
28         formFields={CollectionAddFields}
29         submitLabel='Create a Collection'
30         {...props}
31     />;
32
33 const CollectionAddFields = () => <span>
34     <CollectionNameField />
35     <CollectionDescriptionField />
36     {/* <FileUpload
37         files={this.props.files}
38         disabled={busy}
39         onDrop={files => this.props.dispatch(collectionUploaderActions.SET_UPLOAD_FILES(files))} /> */}
40 </span>;