1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { memoize } from 'lodash/fp';
7 import { InjectedFormProps, Field } from 'redux-form';
8 import { WithDialogProps } from '~/store/dialog/with-dialog';
9 import { FormDialog } from '~/components/form-dialog/form-dialog';
10 import { ProjectTreePickerField } from '~/views-components/project-tree-picker/project-tree-picker';
11 import { MOVE_TO_VALIDATION } from '~/validators/validators';
12 import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog';
13 import { PickerIdProp } from "~/store/tree-picker/picker-id";
15 export const DialogMoveTo = (props: WithDialogProps<string> & InjectedFormProps<MoveToFormDialogData> & PickerIdProp) =>
18 formFields={MoveToDialogFields(props.pickerId)}
23 const MoveToDialogFields = memoize(
24 (pickerId: string) => () =>
28 component={ProjectTreePickerField}
29 validate={MOVE_TO_VALIDATION} />);