X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/32f8f97903802e58b48ed307669c236750d8ee3e..589629e80967dc1f318561fbe6a4174e1da231a6:/src/views-components/form-fields/user-form-fields.tsx

diff --git a/src/views-components/form-fields/user-form-fields.tsx b/src/views-components/form-fields/user-form-fields.tsx
index 6dd635b5a8..11d7d80280 100644
--- a/src/views-components/form-fields/user-form-fields.tsx
+++ b/src/views-components/form-fields/user-form-fields.tsx
@@ -7,22 +7,8 @@ import { Field } from "redux-form";
 import { TextField } from "~/components/text-field/text-field";
 import { USER_EMAIL_VALIDATION, USER_LENGTH_VALIDATION } from "~/validators/validators";
 import { NativeSelectField } from "~/components/select-field/select-field";
-
-export const UserFirstNameField = () =>
-    <Field
-        name='firstName'
-        component={TextField}
-        validate={USER_LENGTH_VALIDATION}
-        autoFocus={true}
-        label="First name" />;
-
-export const UserLastNameField = () =>
-    <Field
-        name='lastName'
-        component={TextField}
-        validate={USER_LENGTH_VALIDATION}
-        autoFocus={true}
-        label="Last name" />;
+import { InputLabel } from "@material-ui/core";
+import { VirtualMachinesResource } from "~/models/virtual-machines";
 
 export const UserEmailField = () =>
     <Field
@@ -32,23 +18,24 @@ export const UserEmailField = () =>
         autoFocus={true}
         label="Email" />;
 
-export const UserIdentityUrlField = () =>
-    <Field
-        name='identityUrl'
-        component={TextField}
-        validate={USER_LENGTH_VALIDATION}
-        label="Identity URL Prefix" />;
-
-export const UserVirtualMachineField = () =>
-    <Field
-        name='virtualMachine'
-        component={NativeSelectField}
-        validate={USER_LENGTH_VALIDATION}
-        items={['shell']} />;
+export const UserVirtualMachineField = ({ data }: any) =>
+    <div style={{ marginBottom: '21px' }}>
+        <InputLabel>Virtual Machine</InputLabel>
+        <Field
+            name='virtualMachine'
+            component={NativeSelectField}
+            validate={USER_LENGTH_VALIDATION}
+            items={getVirtualMachinesList(data.items)} />
+    </div>;
 
 export const UserGroupsVirtualMachineField = () =>
     <Field
-        name='virtualMachine'
+        name='groups'
         component={TextField}
         validate={USER_LENGTH_VALIDATION}
-        label="Groups for virtual machine (comma separated list)" />;
\ No newline at end of file
+        label="Groups for virtual machine (comma separated list)" />;
+
+const getVirtualMachinesList = (virtualMachines: VirtualMachinesResource[]) => {
+    const mappedVirtualMachines = virtualMachines.map(it => ({ key: it.hostname, value: it.hostname }));
+    return mappedVirtualMachines;
+};
