1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { InjectedFormProps, Field } from 'redux-form';
7 import { WithDialogProps } from '~/store/dialog/with-dialog';
8 import { CollectionCreateFormDialogData } from '~/store/collections/collection-create-actions';
9 import { FormDialog } from '~/components/form-dialog/form-dialog';
10 import { require } from '~/validators/require';
11 import { FileUploaderField } from '~/views-components/file-uploader/file-uploader';
12 import { WarningCollection } from '~/components/warning-collection/warning-collection';
14 type DialogCollectionFilesUploadProps = WithDialogProps<{}> & InjectedFormProps<CollectionCreateFormDialogData>;
16 export const DialogCollectionFilesUpload = (props: DialogCollectionFilesUploadProps) =>
18 dialogTitle='Upload data'
19 formFields={UploadCollectionFilesFields}
20 submitLabel='Upload data'
24 const UploadCollectionFilesFields = () => <>
27 validate={FILES_FIELD_VALIDATION}
28 component={FileUploaderField} />
29 <WarningCollection text="Uploading new files will change content address." />
32 const FILES_FIELD_VALIDATION = [require];