X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7597dab11b25e5bb67becf99db622f7f7737a235..598e2bcda179324f0457f6e15cdd2f2a8785374d:/src/views/run-process-panel/inputs/int-input.tsx?ds=sidebyside

diff --git a/src/views/run-process-panel/inputs/int-input.tsx b/src/views/run-process-panel/inputs/int-input.tsx
index 1e4c17cb9c..cac8a27c7d 100644
--- a/src/views/run-process-panel/inputs/int-input.tsx
+++ b/src/views/run-process-panel/inputs/int-input.tsx
@@ -3,11 +3,11 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { IntCommandInputParameter, getInputLabel, isRequiredInput } from '~/models/workflow';
+import { IntCommandInputParameter, isRequiredInput } from '~/models/workflow';
 import { Field } from 'redux-form';
 import { isInteger } from '~/validators/is-integer';
 import { GenericInputProps, GenericInput } from '~/views/run-process-panel/inputs/generic-input';
-import { Input as MaterialInput } from '@material-ui/core';
+import { IntInput as IntInputComponent } from '~/components/int-input/int-input';
 
 export interface IntInputProps {
     input: IntCommandInputParameter;
@@ -16,21 +16,30 @@ export const IntInput = ({ input }: IntInputProps) =>
     <Field
         name={input.id}
         commandInput={input}
-        component={IntInputComponent}
-        parse={value => parseInt(value, 10)}
-        format={value => isNaN(value) ? '' : JSON.stringify(value)}
+        component={InputComponent}
+        parse={parse}
+        format={format}
         validate={[
             isRequiredInput(input)
                 ? isInteger
                 : () => undefined,
         ]} />;
 
-const IntInputComponent = (props: GenericInputProps) =>
+const parse = (value: any) => parseInt(value, 10);
+
+const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);
+
+const InputComponent = (props: GenericInputProps) =>
     <GenericInput
         component={Input}
         {...props} />;
 
 
 const Input = (props: GenericInputProps) =>
-    <MaterialInput fullWidth type='number' {...props.input} />;
+    <IntInputComponent
+        fullWidth
+        type='number'
+        error={props.meta.touched && !!props.meta.error}
+        disabled={props.commandInput.disabled}
+        {...props.input} />;
 
