[arvados-workbench2] updated: 2.4.0-356-gbf5703f2

git repository hosting git at public.arvados.org
Fri Dec 2 00:11:00 UTC 2022


Summary of changes:
 src/store/process-panel/process-panel-actions.ts |  4 ++--
 src/store/process-panel/process-panel-reducer.ts |  2 +-
 src/store/process-panel/process-panel.ts         |  4 ++--
 src/store/processes/processes-actions.ts         | 10 ++++++----
 src/views/process-panel/process-panel-root.tsx   |  4 ++--
 5 files changed, 13 insertions(+), 11 deletions(-)

       via  bf5703f285ed90bb3334f531ce0a46e5e00d122f (commit)
      from  9183367d596ef3082d0e81ec459c9813ed69e805 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit bf5703f285ed90bb3334f531ce0a46e5e00d122f
Author: Stephen Smith <stephen at curii.com>
Date:   Thu Dec 1 19:10:40 2022 -0500

    19700: Use correct type and check for process raw input data
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/store/process-panel/process-panel-actions.ts b/src/store/process-panel/process-panel-actions.ts
index 64fc493f..6a9ea337 100644
--- a/src/store/process-panel/process-panel-actions.ts
+++ b/src/store/process-panel/process-panel-actions.ts
@@ -17,7 +17,7 @@ import { initProcessLogsPanel, processLogsPanelActions } from "store/process-log
 import { CollectionFile } from "models/collection-file";
 import { ContainerRequestResource } from "models/container-request";
 import { CommandOutputParameter } from 'cwlts/mappings/v1.0/CommandOutputParameter';
-import { CommandInputParameter, getIOParamId } from 'models/workflow';
+import { CommandInputParameter, getIOParamId, WorkflowInputsData } from 'models/workflow';
 import { getIOParamDisplayValue, ProcessIOParameter } from "views/process-panel/process-io-card";
 import { OutputDetails } from "./process-panel";
 import { AuthState } from "store/auth/auth-reducer";
@@ -27,7 +27,7 @@ export const processPanelActions = unionize({
     SET_PROCESS_PANEL_CONTAINER_REQUEST_UUID: ofType<string>(),
     SET_PROCESS_PANEL_FILTERS: ofType<string[]>(),
     TOGGLE_PROCESS_PANEL_FILTER: ofType<string>(),
-    SET_INPUT_RAW: ofType<CommandInputParameter[] | null>(),
+    SET_INPUT_RAW: ofType<WorkflowInputsData | null>(),
     SET_INPUT_PARAMS: ofType<ProcessIOParameter[] | null>(),
     SET_OUTPUT_RAW: ofType<OutputDetails | null>(),
     SET_OUTPUT_DEFINITIONS: ofType<CommandOutputParameter[]>(),
diff --git a/src/store/process-panel/process-panel-reducer.ts b/src/store/process-panel/process-panel-reducer.ts
index 48cdb39f..45ca10ca 100644
--- a/src/store/process-panel/process-panel-reducer.ts
+++ b/src/store/process-panel/process-panel-reducer.ts
@@ -32,7 +32,7 @@ export const processPanelReducer = (state = initialState, action: ProcessPanelAc
         SET_INPUT_RAW: inputRaw => {
             // Since mounts can disappear and reappear, only set inputs
             //   if current state is null or new inputs has content
-            if (state.inputRaw === null || (inputRaw && inputRaw.length)) {
+            if (state.inputRaw === null || (inputRaw && Object.keys(inputRaw).length)) {
                 return { ...state, inputRaw };
             } else {
                 return state;
diff --git a/src/store/process-panel/process-panel.ts b/src/store/process-panel/process-panel.ts
index d0d5edeb..36c3e29f 100644
--- a/src/store/process-panel/process-panel.ts
+++ b/src/store/process-panel/process-panel.ts
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { CommandInputParameter } from 'models/workflow';
+import { WorkflowInputsData } from 'models/workflow';
 import { RouterState } from "react-router-redux";
 import { matchProcessRoute } from "routes/routes";
 import { ProcessIOParameter } from "views/process-panel/process-io-card";
@@ -16,7 +16,7 @@ export type OutputDetails = {
 export interface ProcessPanel {
     containerRequestUuid: string;
     filters: { [status: string]: boolean };
-    inputRaw: CommandInputParameter[] | null;
+    inputRaw: WorkflowInputsData | null;
     inputParams: ProcessIOParameter[] | null;
     outputRaw: OutputDetails | null;
     outputDefinitions: CommandOutputParameter[];
diff --git a/src/store/processes/processes-actions.ts b/src/store/processes/processes-actions.ts
index f7822e06..e4f35c1e 100644
--- a/src/store/processes/processes-actions.ts
+++ b/src/store/processes/processes-actions.ts
@@ -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";
@@ -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);
diff --git a/src/views/process-panel/process-panel-root.tsx b/src/views/process-panel/process-panel-root.tsx
index ed808b36..388dc746 100644
--- a/src/views/process-panel/process-panel-root.tsx
+++ b/src/views/process-panel/process-panel-root.tsx
@@ -18,7 +18,7 @@ import { getProcessPanelLogs, ProcessLogsPanel } from 'store/process-logs-panel/
 import { ProcessLogsCard } from './process-log-card';
 import { FilterOption } from 'views/process-panel/process-log-form';
 import { getInputCollectionMounts } from 'store/processes/processes-actions';
-import { CommandInputParameter } from 'models/workflow';
+import { WorkflowInputsData } from 'models/workflow';
 import { CommandOutputParameter } from 'cwlts/mappings/v1.0/CommandOutputParameter';
 import { AuthState } from 'store/auth/auth-reducer';
 import { ProcessCmdCard } from './process-cmd-card';
@@ -39,7 +39,7 @@ export interface ProcessPanelRootDataProps {
     filters: Array<SubprocessFilterDataProps>;
     processLogsPanel: ProcessLogsPanel;
     auth: AuthState;
-    inputRaw: CommandInputParameter[] | null;
+    inputRaw: WorkflowInputsData | null;
     inputParams: ProcessIOParameter[] | null;
     outputRaw: OutputDetails | null;
     outputDefinitions: CommandOutputParameter[];

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list