16086: Enhances readability by using plural on Array var's name.
[arvados-workbench2.git] / src / views / run-process-panel / inputs / string-array-input.tsx
index da03f2966149ebe4abd7be9d85588e71b62f8ab5..39dbe0afdaa67bcd083a437ad3c0cd5f6bf6f7ef 100644 (file)
@@ -30,7 +30,7 @@ const validationSelector = createSelector(
         : undefined
 );
 
-const required = (value: string[]) =>
+const required = (value: string[] = []) =>
     value.length > 0
         ? undefined
         : ERROR_MESSAGE;
@@ -42,15 +42,17 @@ const StringArrayInputComponent = (props: GenericInputProps) =>
 
 class InputComponent extends React.PureComponent<GenericInputProps>{
     render() {
+        const { commandInput, input, meta } = this.props;
         return <ChipsInput
-            deletable
-            orderable
-            value={this.props.input.value}
+            deletable={!commandInput.disabled}
+            orderable={!commandInput.disabled}
+            disabled={commandInput.disabled}
+            values={input.value}
             onChange={this.handleChange}
             createNewValue={identity}
             inputComponent={Input}
             inputProps={{
-                error: this.props.meta.error,
+                error: meta.error
             }} />;
     }