X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/36f8f69a5bf5c19ad3c8de57466944e2b7d0c390..58543e965e9c3f186f6708d171dc47c9425188a9:/src/views/run-process-panel/run-process-inputs-form.tsx

diff --git a/src/views/run-process-panel/run-process-inputs-form.tsx b/src/views/run-process-panel/run-process-inputs-form.tsx
index 8ec51f6b..46ab3c52 100644
--- a/src/views/run-process-panel/run-process-inputs-form.tsx
+++ b/src/views/run-process-panel/run-process-inputs-form.tsx
@@ -2,13 +2,13 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
+import React from 'react';
 import { reduxForm, InjectedFormProps } from 'redux-form';
-import { CommandInputParameter, CWLType, IntCommandInputParameter, BooleanCommandInputParameter, FileCommandInputParameter, DirectoryCommandInputParameter, DirectoryArrayCommandInputParameter } from '~/models/workflow';
-import { IntInput } from '~/views/run-process-panel/inputs/int-input';
-import { StringInput } from '~/views/run-process-panel/inputs/string-input';
-import { StringCommandInputParameter, FloatCommandInputParameter, isPrimitiveOfType, File, Directory, WorkflowInputsData, EnumCommandInputParameter, isArrayOfType, StringArrayCommandInputParameter, FileArrayCommandInputParameter } from '../../models/workflow';
-import { FloatInput } from '~/views/run-process-panel/inputs/float-input';
+import { CommandInputParameter, CWLType, IntCommandInputParameter, BooleanCommandInputParameter, FileCommandInputParameter, DirectoryCommandInputParameter, DirectoryArrayCommandInputParameter, FloatArrayCommandInputParameter, IntArrayCommandInputParameter } from 'models/workflow';
+import { IntInput } from 'views/run-process-panel/inputs/int-input';
+import { StringInput } from 'views/run-process-panel/inputs/string-input';
+import { StringCommandInputParameter, FloatCommandInputParameter, isPrimitiveOfType, WorkflowInputsData, EnumCommandInputParameter, isArrayOfType, StringArrayCommandInputParameter, FileArrayCommandInputParameter } from '../../models/workflow';
+import { FloatInput } from 'views/run-process-panel/inputs/float-input';
 import { BooleanInput } from './inputs/boolean-input';
 import { FileInput } from './inputs/file-input';
 import { connect } from 'react-redux';
@@ -20,6 +20,8 @@ import { StringArrayInput } from './inputs/string-array-input';
 import { createStructuredSelector, createSelector } from 'reselect';
 import { FileArrayInput } from './inputs/file-array-input';
 import { DirectoryArrayInput } from './inputs/directory-array-input';
+import { FloatArrayInput } from './inputs/float-array-input';
+import { IntArrayInput } from './inputs/int-array-input';
 
 export const RUN_PROCESS_INPUTS_FORM = 'runProcessInputsForm';
 
@@ -33,7 +35,7 @@ const inputsSelector = (props: RunProcessInputFormProps) =>
 const initialValuesSelector = createSelector(
     inputsSelector,
     inputs => inputs.reduce(
-        (values, input) => ({ ...values, [input.id]: input.default }),
+        (values, input) => ({ ...values, [input.id]: input.value || input.default }),
         {}));
 
 const propsSelector = createStructuredSelector({
@@ -87,10 +89,10 @@ const getInputComponent = (input: CommandInputParameter) => {
             return <StringInput input={input as StringCommandInputParameter} />;
 
         case isPrimitiveOfType(input, CWLType.FILE):
-            return <FileInput input={input as FileCommandInputParameter} />;
+            return <FileInput options={{ showOnlyOwned: false, showOnlyWritable: false }} input={input as FileCommandInputParameter} />;
 
         case isPrimitiveOfType(input, CWLType.DIRECTORY):
-            return <DirectoryInput input={input as DirectoryCommandInputParameter} />;
+            return <DirectoryInput options={{ showOnlyOwned: false, showOnlyWritable: false }} input={input as DirectoryCommandInputParameter} />;
 
         case typeof input.type === 'object' &&
             !(input.type instanceof Array) &&
@@ -100,11 +102,19 @@ const getInputComponent = (input: CommandInputParameter) => {
         case isArrayOfType(input, CWLType.STRING):
             return <StringArrayInput input={input as StringArrayCommandInputParameter} />;
 
+        case isArrayOfType(input, CWLType.INT):
+        case isArrayOfType(input, CWLType.LONG):
+            return <IntArrayInput input={input as IntArrayCommandInputParameter} />;
+
+        case isArrayOfType(input, CWLType.FLOAT):
+        case isArrayOfType(input, CWLType.DOUBLE):
+            return <FloatArrayInput input={input as FloatArrayCommandInputParameter} />;
+
         case isArrayOfType(input, CWLType.FILE):
-            return <FileArrayInput input={input as FileArrayCommandInputParameter} />;
-        
+            return <FileArrayInput options={{ showOnlyOwned: false, showOnlyWritable: false }} input={input as FileArrayCommandInputParameter} />;
+
         case isArrayOfType(input, CWLType.DIRECTORY):
-            return <DirectoryArrayInput input={input as DirectoryArrayCommandInputParameter} />;
+            return <DirectoryArrayInput options={{ showOnlyOwned: false, showOnlyWritable: false }} input={input as DirectoryArrayCommandInputParameter} />;
 
         default:
             return null;
