X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f81a519f8667b1993e6091931135f54fb2de1c4c..7467e941ed63e8885144e90c9ca11929f738b13a:/src/views/run-process-panel/inputs/enum-input.tsx

diff --git a/src/views/run-process-panel/inputs/enum-input.tsx b/src/views/run-process-panel/inputs/enum-input.tsx
index 967d8fc5..f554aff2 100644
--- a/src/views/run-process-panel/inputs/enum-input.tsx
+++ b/src/views/run-process-panel/inputs/enum-input.tsx
@@ -2,10 +2,10 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
-import { EnumCommandInputParameter, CommandInputEnumSchema } from '~/models/workflow';
+import React from 'react';
 import { Field } from 'redux-form';
 import { Select, MenuItem } from '@material-ui/core';
+import { EnumCommandInputParameter, CommandInputEnumSchema } from 'models/workflow';
 import { GenericInputProps, GenericInput } from './generic-input';
 
 export interface EnumInputProps {
@@ -27,10 +27,23 @@ const Input = (props: GenericInputProps) => {
     const type = props.commandInput.type as CommandInputEnumSchema;
     return <Select
         value={props.input.value}
-        onChange={props.input.onChange}>
+        onChange={props.input.onChange}
+        disabled={props.commandInput.disabled} >
         {type.symbols.map(symbol =>
-            <MenuItem key={symbol} value={symbol.split('/').pop()}>
-                {symbol.split('/').pop()}
+            <MenuItem key={symbol} value={extractValue(symbol)}>
+                {extractValue(symbol)}
             </MenuItem>)}
     </Select>;
-};
\ No newline at end of file
+};
+
+/**
+ * Values in workflow definition have an absolute form, for example: 
+ * 
+ * ```#input_collector.cwl/enum_type/Pathway table```
+ * 
+ * We want a value that is in form accepted by backend.
+ * According to the example above, the correct value is:
+ * 
+ * ```Pathway table```
+ */
+const extractValue = (symbol: string) => symbol.split('/').pop();
