},
});
-export const TextField = withStyles(styles)((props: WrappedFieldProps & WithStyles<CssRules> & { label?: string, autoFocus?: boolean }) =>
+export const TextField = withStyles(styles)((props: WrappedFieldProps & WithStyles<CssRules> & { label?: string, autoFocus?: boolean, required?: boolean }) =>
<MaterialTextField
helperText={props.meta.touched && props.meta.error}
className={props.classes.textField}
autoComplete='off'
autoFocus={props.autoFocus}
fullWidth={true}
+ required={props.required}
{...props.input}
/>);
initWebSocket(config, services.authService, store);
await store.dispatch(loadWorkbench());
addRouteChangeHandlers(history, store);
+
}
};
};
+const createSampleWorkflow = ({workflowService}:ServiceRepository) => {
+ workflowService.create({
+ name: 'Primitive values collector',
+ description: 'Workflow for collecting primitive values',
+ definition: "cwlVersion: v1.0\n$graph:\n- class: CommandLineTool\n requirements:\n - listing:\n - entryname: input_collector.log\n entry: |\n \"flag\":\n $(inputs.example_flag)\n \"string\":\n $(inputs.example_string)\n \"int\":\n $(inputs.example_int)\n \"long\":\n $(inputs.example_long)\n \"float\":\n $(inputs.example_float)\n \"double\":\n $(inputs.example_double)\n class: InitialWorkDirRequirement\n inputs:\n - type: double\n id: '#input_collector.cwl/example_double'\n - type: boolean\n id: '#input_collector.cwl/example_flag'\n - type: float\n id: '#input_collector.cwl/example_float'\n - type: int\n id: '#input_collector.cwl/example_int'\n - type: long\n id: '#input_collector.cwl/example_long'\n - type: string\n id: '#input_collector.cwl/example_string'\n outputs:\n - type: File\n outputBinding:\n glob: '*'\n id: '#input_collector.cwl/output'\n baseCommand: [echo]\n id: '#input_collector.cwl'\n- class: Workflow\n doc: Workflw for collecting primitive values\n inputs:\n - type: double\n label: Double value\n doc: This should allow for entering a decimal number (64-bit).\n id: '#main/example_double'\n default: 0.3333333333333333\n - type: boolean\n label: Boolean Flag\n doc: This should render as in checkbox.\n id: '#main/example_flag'\n default: true\n - type: float\n label: Float value\n doc: This should allow for entering a decimal number (32-bit).\n id: '#main/example_float'\n default: 0.15625\n - type: int\n label: Integer Number\n doc: This should allow for entering a number (32-bit signed).\n id: '#main/example_int'\n default: 2147483647\n - type: long\n label: Long Number\n doc: This should allow for entering a number (64-bit signed).\n id: '#main/example_long'\n default: 9223372036854775807\n - type: string\n label: Freetext\n doc: This should allow for entering an arbitrary char sequence.\n id: '#main/example_string'\n default: This is a string\n outputs:\n - type: File\n outputSource: '#main/input_collector/output'\n id: '#main/log_file'\n steps:\n - run: '#input_collector.cwl'\n in:\n - source: '#main/example_double'\n id: '#main/input_collector/example_double'\n - source: '#main/example_flag'\n id: '#main/input_collector/example_flag'\n - source: '#main/example_float'\n id: '#main/input_collector/example_float'\n - source: '#main/example_int'\n id: '#main/input_collector/example_int'\n - source: '#main/example_long'\n id: '#main/input_collector/example_long'\n - source: '#main/example_string'\n id: '#main/input_collector/example_string'\n out: ['#main/input_collector/output']\n id: '#main/input_collector'\n id: '#main'\n",
+ });
+};
const createSampleProcess = ({ containerRequestService }: ServiceRepository) => {
containerRequestService.create({
const FileInputComponent = (props: GenericInputProps) =>
<GenericInput
component={props =>
- <Input readOnly fullWidth value={props.input.value} />}
+ <Input readOnly fullWidth value={props.input.value} error={props.meta.touched && !!props.meta.error}/>}
{...props} />;
}
const Input = (props: GenericInputProps) =>
- <MaterialInput fullWidth {...props.input} />;
+ <MaterialInput fullWidth {...props.input} error={props.meta.touched && !!props.meta.error} />;
error={props.meta.touched && !!props.meta.error}>
{getInputLabel(props.commandInput)}
</FormLabel>
- <FormControl>
- <Component {...props} />
- </FormControl>
+ <Component {...props} />
<FormHelperText error={props.meta.touched && !!props.meta.error}>
{
props.meta.touched && props.meta.error
const Input = (props: GenericInputProps) =>
- <MaterialInput fullWidth type='number' {...props.input} />;
+ <MaterialInput fullWidth type='number' {...props.input} error={props.meta.touched && !!props.meta.error} />;
{...props} />;
const Input = (props: GenericInputProps) =>
- <MaterialInput fullWidth {...props.input} />;
\ No newline at end of file
+ <MaterialInput fullWidth {...props.input} error={props.meta.touched && !!props.meta.error} />;
\ No newline at end of file
import { reduxForm, Field } from 'redux-form';
import { Grid } from '@material-ui/core';
import { TextField } from '~/components/text-field/text-field';
+import { PROCESS_NAME_VALIDATION } from '~/validators/validators';
export const RUN_PROCESS_BASIC_FORM = 'runProcessBasicForm';
form: RUN_PROCESS_BASIC_FORM
})(() =>
<form>
- <Grid container spacing={16}>
+ <Grid container spacing={32}>
<Grid item xs={12} md={6}>
<Field
name='name'
component={TextField}
- label="Enter a new name for run process" />
+ label="Enter a new name for run process"
+ required
+ validate={PROCESS_NAME_VALIDATION} />
</Grid>
<Grid item xs={12} md={6}>
<Field
}))(
(props: InjectedFormProps & RunProcessInputFormProps) =>
<form>
- <Grid container spacing={16}>
+ <Grid container spacing={32}>
{props.inputs.map(input =>
<InputItem input={input} key={input.id} />)}
</Grid>
const mapStateToProps = (state: RootState): RunProcessSecondStepFormDataProps => ({
inputs: state.runProcessPanel.inputs,
- valid: isValid(RUN_PROCESS_BASIC_FORM)(state.form) &&
- isValid(RUN_PROCESS_INPUTS_FORM)(state.form),
+ valid: isValid(RUN_PROCESS_BASIC_FORM)(state) &&
+ isValid(RUN_PROCESS_INPUTS_FORM)(state),
});
export type RunProcessSecondStepFormProps = RunProcessSecondStepFormDataProps & RunProcessSecondStepFormActionProps;