1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { Field, WrappedFieldProps } from "redux-form";
7 import { TextField } from "~/components/text-field/text-field";
8 import { COLLECTION_NAME_VALIDATION, COLLECTION_DESCRIPTION_VALIDATION, COLLECTION_PROJECT_VALIDATION } from "~/validators/validators";
9 import { ProjectTreePicker } from "~/views-components/project-tree-picker/project-tree-picker";
11 export const CollectionNameField = () =>
15 validate={COLLECTION_NAME_VALIDATION}
16 label="Collection Name"
19 export const CollectionDescriptionField = () =>
23 validate={COLLECTION_DESCRIPTION_VALIDATION}
24 label="Description - optional" />;
26 export const CollectionProjectPickerField = () =>
29 component={ProjectPicker}
30 validate={COLLECTION_PROJECT_VALIDATION} />;
32 const ProjectPicker = (props: WrappedFieldProps) =>
33 <div style={{ height: '144px', display: 'flex', flexDirection: 'column' }}>
34 <ProjectTreePicker onChange={projectUuid => props.input.onChange(projectUuid)} />