15672: Fixes a couple tests.
[arvados-workbench2.git] / src / views / run-process-panel / inputs / string-array-input.tsx
index 3b29d1a8cf9fa48c822b3b1019b5e9f56cc5e877..e560b33778fc7cf0f99a76e0461bf8858192e26a 100644 (file)
@@ -10,6 +10,7 @@ import { GenericInputProps, GenericInput } from '~/views/run-process-panel/input
 import { ChipsInput } from '~/components/chips-input/chips-input';
 import { identity } from 'lodash';
 import { createSelector } from 'reselect';
+import { Input } from '@material-ui/core';
 
 export interface StringArrayInputProps {
     input: StringArrayCommandInputParameter;
@@ -36,15 +37,23 @@ const required = (value: string[]) =>
 
 const StringArrayInputComponent = (props: GenericInputProps) =>
     <GenericInput
-        component={Input}
+        component={InputComponent}
         {...props} />;
 
-class Input extends React.PureComponent<GenericInputProps>{
+class InputComponent extends React.PureComponent<GenericInputProps>{
     render() {
+        const { commandInput, input, meta } = this.props;
         return <ChipsInput
-            values={this.props.input.value}
+            deletable={!commandInput.disabled}
+            orderable={!commandInput.disabled}
+            disabled={commandInput.disabled}
+            value={input.value}
             onChange={this.handleChange}
-            createNewValue={identity} />;
+            createNewValue={identity}
+            inputComponent={Input}
+            inputProps={{
+                error: meta.error
+            }} />;
     }
 
     handleChange = (values: {}[]) => {