X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/428d454e2681d66bb14558946cfe2fb77a2c8dce..59cc1b248e39a17bbf46449add178d957b167b9a:/src/views/run-process-panel/inputs/string-input.tsx

diff --git a/src/views/run-process-panel/inputs/string-input.tsx b/src/views/run-process-panel/inputs/string-input.tsx
index 8c72a469..7fc74315 100644
--- a/src/views/run-process-panel/inputs/string-input.tsx
+++ b/src/views/run-process-panel/inputs/string-input.tsx
@@ -3,10 +3,12 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { getInputLabel, isRequiredInput, StringCommandInputParameter } from '~/models/workflow';
+import { memoize } from 'lodash/fp';
+import { isRequiredInput, StringCommandInputParameter } from '~/models/workflow';
 import { Field } from 'redux-form';
-import { TextField } from '~/components/text-field/text-field';
 import { require } from '~/validators/require';
+import { GenericInputProps, GenericInput } from '~/views/run-process-panel/inputs/generic-input';
+import { Input as MaterialInput } from '@material-ui/core';
 
 export interface StringInputProps {
     input: StringCommandInputParameter;
@@ -14,11 +16,25 @@ export interface StringInputProps {
 export const StringInput = ({ input }: StringInputProps) =>
     <Field
         name={input.id}
-        label={getInputLabel(input)}
-        component={TextField}
-        validate={[
-            isRequiredInput(input)
-                ? require
-                : () => undefined,
-        ]} />;
+        commandInput={input}
+        component={StringInputComponent}
+        validate={getValidation(input)} />;
 
+const getValidation = memoize(
+    (input: StringCommandInputParameter) => ([
+        isRequiredInput(input)
+            ? require
+            : () => undefined,
+    ]));
+
+const StringInputComponent = (props: GenericInputProps) =>
+    <GenericInput
+        component={Input}
+        {...props} />;
+
+const Input = (props: GenericInputProps) =>
+    <MaterialInput
+        fullWidth
+        error={props.meta.touched && !!props.meta.error}
+        disabled={props.commandInput.disabled}
+        {...props.input} />;
\ No newline at end of file
