Merge branch 'master'
[arvados-workbench2.git] / src / views-components / dialog-move / dialog-move-to.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, 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 { MOVE_TO_VALIDATION } from '~/validators/validators';
11 import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog';
12
13 export const DialogMoveTo = (props: WithDialogProps<string> & InjectedFormProps<MoveToFormDialogData>) =>
14     <FormDialog
15         dialogTitle='Move to'
16         formFields={MoveToDialogFields}
17         submitLabel='Move'
18         {...props}
19     />;
20
21 const MoveToDialogFields = () =>
22     <Field
23         name="ownerUuid"
24         component={ProjectTreePickerField}
25         validate={MOVE_TO_VALIDATION} />;
26