19900: Don't dispay errors when fetching process output collection, container, or...
[arvados.git] / src / store / processes / processes-actions.ts
index f7822e06ee064929cba111529311d5e5c987f051..6ea1e6a99ca54065bd752518afa2ceff98bcd923 100644 (file)
@@ -17,7 +17,7 @@ import { initialize } from "redux-form";
 import { RUN_PROCESS_BASIC_FORM, RunProcessBasicFormData } from "views/run-process-panel/run-process-basic-form";
 import { RunProcessAdvancedFormData, RUN_PROCESS_ADVANCED_FORM } from "views/run-process-panel/run-process-advanced-form";
 import { MOUNT_PATH_CWL_WORKFLOW, MOUNT_PATH_CWL_INPUT } from 'models/process';
-import { CommandInputParameter, getWorkflow, getWorkflowInputs, getWorkflowOutputs } from "models/workflow";
+import { CommandInputParameter, getWorkflow, getWorkflowInputs, getWorkflowOutputs, WorkflowInputsData } from "models/workflow";
 import { ProjectResource } from "models/project";
 import { UserResource } from "models/user";
 import { CommandOutputParameter } from "cwlts/mappings/v1.0/CommandOutputParameter";
@@ -28,15 +28,15 @@ export const loadProcess = (containerRequestUuid: string) =>
         dispatch<any>(updateResources([containerRequest]));
 
         if (containerRequest.outputUuid) {
-            const collection = await services.collectionService.get(containerRequest.outputUuid);
+            const collection = await services.collectionService.get(containerRequest.outputUuid, false);
             dispatch<any>(updateResources([collection]));
         }
 
         if (containerRequest.containerUuid) {
-            const container = await services.containerService.get(containerRequest.containerUuid);
+            const container = await services.containerService.get(containerRequest.containerUuid, false);
             dispatch<any>(updateResources([container]));
             if (container.runtimeUserUuid) {
-                const runtimeUser = await services.userService.get(container.runtimeUserUuid);
+                const runtimeUser = await services.userService.get(container.runtimeUserUuid, false);
                 dispatch<any>(updateResources([runtimeUser]));
             }
             return { containerRequest, container };
@@ -141,13 +141,13 @@ export const reRunProcess = (processUuid: string, workflowUuid: string) =>
 /*
  * Fetches raw inputs from containerRequest mounts with fallback to properties
  * Returns undefined if containerRequest not loaded
- * Returns [] if inputs not found in mounts or props
+ * Returns {} if inputs not found in mounts or props
  */
-export const getRawInputs = (data: any): CommandInputParameter[] | undefined => {
+export const getRawInputs = (data: any): WorkflowInputsData | undefined => {
     if (!data) { return undefined; }
     const mountInput = data.mounts?.[MOUNT_PATH_CWL_INPUT]?.content;
     const propsInput = data.properties?.cwl_input;
-    if (!mountInput && !propsInput) { return []; }
+    if (!mountInput && !propsInput) { return {}; }
     return (mountInput || propsInput);
 }
 
@@ -155,6 +155,8 @@ export const getInputs = (data: any): CommandInputParameter[] => {
     // Definitions from mounts are needed so we return early if missing
     if (!data || !data.mounts || !data.mounts[MOUNT_PATH_CWL_WORKFLOW]) { return []; }
     const content  = getRawInputs(data) as any;
+    // Only escape if content is falsy to allow displaying definitions if no inputs are present
+    // (Don't check raw content length)
     if (!content) { return []; }
 
     const inputs = getWorkflowInputs(data.mounts[MOUNT_PATH_CWL_WORKFLOW].content);