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_PROJECT_VALIDATION } from '~/validators/validators';
11 import { TextField } from "~/components/text-field/text-field";
12 import { ProjectCopyFormDialogData } from "~/store/project-copy-dialog/project-copy-dialog";
14 type ProjectCopyFormDialogProps = WithDialogProps<string> & InjectedFormProps<ProjectCopyFormDialogData>;
16 export const ProjectCopyFormDialog = (props: ProjectCopyFormDialogProps) =>
18 dialogTitle='Make a copy'
19 formFields={ProjectCopyFields}
24 const ProjectCopyFields = () => <span>
28 validate={COPY_NAME_VALIDATION}
29 label="Enter a new name for the copy" />
32 component={ProjectTreePickerField}
33 validate={COPY_PROJECT_VALIDATION} />