X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/847ac07f82a1432d6472390aab5e8c2198d425a5..297ccba9513f02ebfa6e13ab8831eb0b195b6dc3:/src/views-components/dialog-move/dialog-move-to.tsx

diff --git a/src/views-components/dialog-move/dialog-move-to.tsx b/src/views-components/dialog-move/dialog-move-to.tsx
index 6b0ac881..26ad5691 100644
--- a/src/views-components/dialog-move/dialog-move-to.tsx
+++ b/src/views-components/dialog-move/dialog-move-to.tsx
@@ -2,25 +2,29 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
+import React from "react";
+import { memoize } from 'lodash/fp';
 import { InjectedFormProps, Field } from 'redux-form';
-import { WithDialogProps } from '~/store/dialog/with-dialog';
-import { FormDialog } from '~/components/form-dialog/form-dialog';
-import { WorkflowTreePickerField } from '~/views-components/workflow-tree-picker/workflow-tree-picker';
-import { MOVE_TO_VALIDATION } from '~/validators/validators';
-import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog';
+import { WithDialogProps } from 'store/dialog/with-dialog';
+import { FormDialog } from 'components/form-dialog/form-dialog';
+import { ProjectTreePickerField } from 'views-components/projects-tree-picker/tree-picker-field';
+import { MOVE_TO_VALIDATION } from 'validators/validators';
+import { MoveToFormDialogData } from 'store/move-to-dialog/move-to-dialog';
+import { PickerIdProp } from "store/tree-picker/picker-id";
 
-export const DialogMoveTo = (props: WithDialogProps<string> & InjectedFormProps<MoveToFormDialogData>) =>
+export const DialogMoveTo = (props: WithDialogProps<string> & InjectedFormProps<MoveToFormDialogData> & PickerIdProp) =>
     <FormDialog
         dialogTitle='Move to'
-        formFields={MoveToDialogFields}
+        formFields={MoveToDialogFields(props.pickerId)}
         submitLabel='Move'
         {...props}
     />;
 
-const MoveToDialogFields = () =>
-    <Field
-        name="ownerUuid"
-        component={WorkflowTreePickerField}
-        validate={MOVE_TO_VALIDATION} />;
+const MoveToDialogFields = memoize(
+    (pickerId: string) => () =>
+        <Field
+            name="ownerUuid"
+            pickerId={pickerId}
+            component={ProjectTreePickerField}
+            validate={MOVE_TO_VALIDATION} />);
 
