X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/8ff3c558698ed01fbca057ff876935470c358e65..fc05ea3e89e7618ea0a52d88a377533512d5ec32:/src/views-components/form-fields/collection-form-fields.tsx

diff --git a/src/views-components/form-fields/collection-form-fields.tsx b/src/views-components/form-fields/collection-form-fields.tsx
index ddd5bcef..d6cbd8d3 100644
--- a/src/views-components/form-fields/collection-form-fields.tsx
+++ b/src/views-components/form-fields/collection-form-fields.tsx
@@ -6,14 +6,15 @@ import * as React from "react";
 import { Field, WrappedFieldProps } from "redux-form";
 import { TextField } from "~/components/text-field/text-field";
 import { COLLECTION_NAME_VALIDATION, COLLECTION_DESCRIPTION_VALIDATION, COLLECTION_PROJECT_VALIDATION } from "~/validators/validators";
-import { ProjectTreePicker } from "~/views-components/project-tree-picker/project-tree-picker";
+import { ProjectTreePicker, ProjectTreePickerField } from "~/views-components/project-tree-picker/project-tree-picker";
 
 export const CollectionNameField = () =>
     <Field
         name='name'
         component={TextField}
         validate={COLLECTION_NAME_VALIDATION}
-        label="Collection Name" />;
+        label="Collection Name"
+        autoFocus={true} />;
 
 export const CollectionDescriptionField = () =>
     <Field
@@ -22,13 +23,9 @@ export const CollectionDescriptionField = () =>
         validate={COLLECTION_DESCRIPTION_VALIDATION}
         label="Description - optional" />;
 
-export const CollectionProjectPickerField = () =>
+export const CollectionProjectPickerField = (props: { pickerId: string }) =>
     <Field
         name="projectUuid"
-        component={ProjectPicker}
+        pickerId={props.pickerId}
+        component={ProjectTreePickerField}
         validate={COLLECTION_PROJECT_VALIDATION} />;
-
-const ProjectPicker = (props: WrappedFieldProps) =>
-    <div style={{ height: '144px', display: 'flex', flexDirection: 'column' }}>
-        <ProjectTreePicker onChange={projectUuid => props.input.onChange(projectUuid)} />
-    </div>;
