X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c2361ea5136f25988cb4e30928283176ea02468d..afbbfe398a0816f9e636e76200e76230d62552ed:/src/views-components/dialog-copy/dialog-collection-partial-copy.tsx

diff --git a/src/views-components/dialog-copy/dialog-collection-partial-copy.tsx b/src/views-components/dialog-copy/dialog-collection-partial-copy.tsx
index 7c335a35..3c584e4f 100644
--- a/src/views-components/dialog-copy/dialog-collection-partial-copy.tsx
+++ b/src/views-components/dialog-copy/dialog-collection-partial-copy.tsx
@@ -2,25 +2,30 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
-import { FormDialog } from '~/components/form-dialog/form-dialog';
-import { CollectionNameField, CollectionDescriptionField, CollectionProjectPickerField } from '~/views-components/form-fields/collection-form-fields';
-import { WithDialogProps } from '~/store/dialog/with-dialog';
+import React from "react";
+import { memoize } from "lodash/fp";
+import { FormDialog } from 'components/form-dialog/form-dialog';
+import { CollectionNameField, CollectionDescriptionField, CollectionProjectPickerField } from 'views-components/form-fields/collection-form-fields';
+import { WithDialogProps } from 'store/dialog/with-dialog';
 import { InjectedFormProps } from 'redux-form';
-import { CollectionPartialCopyFormData } from '~/store/collections/collection-partial-copy-actions';
+import { CollectionPartialCopyFormData } from 'store/collections/collection-partial-copy-actions';
+import { PickerIdProp } from "store/tree-picker/picker-id";
 
 type DialogCollectionPartialCopyProps = WithDialogProps<string> & InjectedFormProps<CollectionPartialCopyFormData>;
 
-export const DialogCollectionPartialCopy = (props: DialogCollectionPartialCopyProps) =>
+export const DialogCollectionPartialCopy = (props: DialogCollectionPartialCopyProps & PickerIdProp) =>
     <FormDialog
         dialogTitle='Create a collection'
-        formFields={CollectionPartialCopyFields}
+        formFields={CollectionPartialCopyFields(props.pickerId)}
         submitLabel='Create a collection'
         {...props}
     />;
 
-export const CollectionPartialCopyFields = () => <div>
-    <CollectionNameField />
-    <CollectionDescriptionField />
-    <CollectionProjectPickerField />
-</div>;
+export const CollectionPartialCopyFields = memoize(
+    (pickerId: string) =>
+        () =>
+            <>
+                <CollectionNameField />
+                <CollectionDescriptionField />
+                <CollectionProjectPickerField {...{ pickerId }} />
+            </>);
