creating-user
[arvados-workbench2.git] / src / views-components / form-fields / user-form-fields.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from "react";
6 import { Field } from "redux-form";
7 import { TextField } from "~/components/text-field/text-field";
8 import { USER_EMAIL_VALIDATION, USER_LENGTH_VALIDATION } from "~/validators/validators";
9 import { NativeSelectField } from "~/components/select-field/select-field";
10
11 export const UserFirstNameField = () =>
12     <Field
13         name='firstName'
14         component={TextField}
15         validate={USER_LENGTH_VALIDATION}
16         autoFocus={true}
17         label="First name" />;
18
19 export const UserLastNameField = () =>
20     <Field
21         name='lastName'
22         component={TextField}
23         validate={USER_LENGTH_VALIDATION}
24         autoFocus={true}
25         label="Last name" />;
26
27 export const UserEmailField = () =>
28     <Field
29         name='email'
30         component={TextField}
31         validate={USER_EMAIL_VALIDATION}
32         autoFocus={true}
33         label="Email" />;
34
35 export const UserIdentityUrlField = () =>
36     <Field
37         name='identityUrl'
38         component={TextField}
39         validate={USER_LENGTH_VALIDATION}
40         label="Identity URL Prefix" />;
41
42 export const UserVirtualMachineField = () =>
43     <Field
44         name='virtualMachine'
45         component={NativeSelectField}
46         validate={USER_LENGTH_VALIDATION}
47         items={['shell']} />;
48
49 export const UserGroupsVirtualMachineField = () =>
50     <Field
51         name='virtualMachine'
52         component={TextField}
53         validate={USER_LENGTH_VALIDATION}
54         label="Groups for virtual machine (comma separated list)" />;