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 { FormDialog } from '~/components/form-dialog/form-dialog';
9 import { ProjectTreePickerField } from '~/views-components/project-tree-picker/project-tree-picker';
10 import { COPY_NAME_VALIDATION, COPY_FILE_VALIDATION } from '~/validators/validators';
11 import { TextField } from "~/components/text-field/text-field";
12 import { CopyFormDialogData } from '~/store/copy-dialog/copy-dialog';
14 type CopyFormDialogProps = WithDialogProps<string> & InjectedFormProps<CopyFormDialogData>;
16 export const DialogCopy = (props: CopyFormDialogProps) =>
18 dialogTitle='Make a copy'
19 formFields={CopyDialogFields}
24 const CopyDialogFields = () => <span>
28 validate={COPY_NAME_VALIDATION}
29 label="Enter a new name for the copy" />
32 component={ProjectTreePickerField}
33 validate={COPY_FILE_VALIDATION} />