Merge branch '14471-bugfix-treepicker-files-subtree-is-flat'
[arvados.git] / src / views / run-process-panel / run-process-basic-form.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 { reduxForm, Field } from 'redux-form';
7 import { Grid } from '@material-ui/core';
8 import { TextField } from '~/components/text-field/text-field';
9 import { PROCESS_NAME_VALIDATION } from '~/validators/validators';
10
11 export const RUN_PROCESS_BASIC_FORM = 'runProcessBasicForm';
12
13 export interface RunProcessBasicFormData {
14     name: string;
15     description: string;
16 }
17 export const RunProcessBasicForm =
18     reduxForm<RunProcessBasicFormData>({
19         form: RUN_PROCESS_BASIC_FORM
20     })(() =>
21         <form>
22             <Grid container spacing={32}>
23                 <Grid item xs={12} md={6}>
24                     <Field
25                         name='name'
26                         component={TextField}
27                         label="Enter a new name for run process"
28                         required
29                         validate={PROCESS_NAME_VALIDATION} />
30                 </Grid>
31                 <Grid item xs={12} md={6}>
32                     <Field
33                         name='description'
34                         component={TextField}
35                         label="Enter a description for run process" />
36                 </Grid>
37             </Grid>
38         </form>);