X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/4b157f90c3cb632e911cf5bd4fd2e364940183d9..dbbaaf10b4f87f30a3d15480b9d27dc909d5c4e1:/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 6aae2d68..095c2b9c 100644
--- a/src/views-components/dialog-copy/dialog-collection-partial-copy.tsx
+++ b/src/views-components/dialog-copy/dialog-collection-partial-copy.tsx
@@ -3,28 +3,29 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as 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 { Grid } from '@material-ui/core';
+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 = () =>
-    <Grid container direction={"row"}>
-        <Grid item xs={12}>
-            <CollectionNameField />
-            <CollectionDescriptionField />
-            <CollectionProjectPickerField />
-        </Grid>
-    </Grid>;
+export const CollectionPartialCopyFields = memoize(
+    (pickerId: string) =>
+        () =>
+            <div>
+                <CollectionNameField />
+                <CollectionDescriptionField />
+                <CollectionProjectPickerField {...{ pickerId }} />
+            </div>);
