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 { ProjectTreePicker } from '~/components/project-tree-picker/project-tree-picker';
10 import { COPY_NAME_VALIDATION, MAKE_A_COPY_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 export const ProjectCopyFormDialog = (props: WithDialogProps<string> & InjectedFormProps<ProjectCopyFormDialogData>) =>
16 dialogTitle='Make a copy'
17 formFields={ProjectCopyFields}
22 const ProjectCopyFields = () => <div>
23 <ProjectCopyNameField />
24 <ProjectCopyDialogFields />
27 const ProjectCopyNameField = () =>
31 validate={COPY_NAME_VALIDATION}
32 label="Enter a new name for the copy" />;
34 const ProjectCopyDialogFields = () =>
37 component={ProjectTreePicker}
38 validate={MAKE_A_COPY_VALIDATION} />;