X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/5c3b7d928914321c16aae5549b4ae2a6278dfa05..42db83a0075f9704dcbfb2cd29821c97ff0fe34b:/src/views/run-process-panel/inputs/boolean-input.tsx

diff --git a/src/views/run-process-panel/inputs/boolean-input.tsx b/src/views/run-process-panel/inputs/boolean-input.tsx
index 2d0d8c66..5da54742 100644
--- a/src/views/run-process-panel/inputs/boolean-input.tsx
+++ b/src/views/run-process-panel/inputs/boolean-input.tsx
@@ -3,10 +3,10 @@
 // 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';
+import { BooleanCommandInputParameter } from '~/models/workflow';
+import { Field } from 'redux-form';
+import { Switch } from '@material-ui/core';
+import { GenericInputProps, GenericInput } from './generic-input';
 
 export interface BooleanInputProps {
     input: BooleanCommandInputParameter;
@@ -14,16 +14,19 @@ export interface BooleanInputProps {
 export const BooleanInput = ({ input }: BooleanInputProps) =>
     <Field
         name={input.id}
-        label={getInputLabel(input)}
+        commandInput={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
+const BooleanInputComponent = (props: GenericInputProps) =>
+    <GenericInput
+        component={Input}
+        {...props} />;
+
+const Input = (props: GenericInputProps) =>
+    <Switch
+        color='primary'
+        checked={props.input.value}
+        onChange={() => props.input.onChange(props.input.value)} 
+        disabled={props.commandInput.disabled} />;
\ No newline at end of file
