--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { BooleanCommandInputParameter, getInputLabel, isRequiredInput } from '~/models/workflow';
+import { Field, WrappedFieldProps } from 'redux-form';
+import { TextField } from '~/components/text-field/text-field';
+import { FormGroup, FormLabel, FormHelperText, Switch } from '@material-ui/core';
+
+export interface BooleanInputProps {
+ input: BooleanCommandInputParameter;
+}
+export const BooleanInput = ({ input }: BooleanInputProps) =>
+ <Field
+ name={input.id}
+ label={getInputLabel(input)}
+ component={BooleanInputComponent}
+ normalize={(value, prevValue) => !prevValue}
+ />;
+
+const BooleanInputComponent = (props: WrappedFieldProps & { label?: string }) =>
+ <FormGroup>
+ <FormLabel>{props.label}</FormLabel>
+ <Switch
+ color='primary'
+ checked={props.input.value}
+ onChange={() => props.input.onChange(props.input.value)} />
+ </FormGroup>;
\ No newline at end of file
import * as React from 'react';
import { reduxForm, InjectedFormProps } from 'redux-form';
-import { WorkflowResource, CommandInputParameter, CWLType, IntCommandInputParameter } from '~/models/workflow';
+import { WorkflowResource, CommandInputParameter, CWLType, IntCommandInputParameter, BooleanCommandInputParameter } from '~/models/workflow';
import { IntInput } from '~/views/run-process-panel/inputs/int-input';
import { StringInput } from '~/views/run-process-panel/inputs/string-input';
import { StringCommandInputParameter, FloatCommandInputParameter } from '../../models/workflow';
import { FloatInput } from '~/views/run-process-panel/inputs/float-input';
+import { BooleanInput } from './inputs/boolean-input';
const RUN_PROCESS_INPUTS_FORM = 'runProcessInputsForm';
<form>
{props.inputs.map(input => {
switch (true) {
+ case input.type === CWLType.BOOLEAN:
+ return <BooleanInput key={input.id} input={input as BooleanCommandInputParameter} />;
case input.type === CWLType.INT:
case input.type === CWLType.LONG:
return <IntInput key={input.id} input={input as IntCommandInputParameter} />;