[ARVADOS-WORKBENCH2] updated: 1.3.1-420-g28825aef

Git user git at public.curoverse.com
Mon Mar 18 14:47:16 UTC 2019


Summary of changes:
 src/store/processes/process-input-actions.ts       |  4 +-
 .../process-input-dialog/process-input-dialog.tsx  | 51 ++++------------------
 2 files changed, 10 insertions(+), 45 deletions(-)

       via  28825aefea14433ed4b8ac46107871847c3da1a3 (commit)
      from  610b2dbfb87aaa68ff4f26db2f5d8054b03ece1e (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 28825aefea14433ed4b8ac46107871847c3da1a3
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Mon Mar 18 15:47:10 2019 +0100

    refs #14926-modal-with-inputs-is-empty
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/store/processes/process-input-actions.ts b/src/store/processes/process-input-actions.ts
index ab3f3bdb..7ce2749c 100644
--- a/src/store/processes/process-input-actions.ts
+++ b/src/store/processes/process-input-actions.ts
@@ -6,7 +6,7 @@ import { dialogActions } from '~/store/dialog/dialog-actions';
 import { RootState } from '~/store/store';
 import { Dispatch } from 'redux';
 import { getProcess } from '~/store/processes/process';
-import {snackbarActions, SnackbarKind} from '~/store/snackbar/snackbar-actions';
+import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
 
 export const PROCESS_INPUT_DIALOG_NAME = 'processInputDialog';
 
@@ -15,7 +15,7 @@ export const openProcessInputDialog = (processUuid: string) =>
         const process = getProcess(processUuid)(getState().resources);
         if (process) {
             const data: any = process;
-            if (data && data.containerRequest.mounts.varLibCwlWorkflowJson && data.containerRequest.mounts.varLibCwlWorkflowJson.content.graph[1] && data.containerRequest.mounts.varLibCwlWorkflowJson.content.graph[1].inputs.length > 0) {
+            if (data && data.containerRequest.mounts.varLibCwlWorkflowJson && data.containerRequest.mounts.varLibCwlWorkflowJson.content.graph.filter((a: any) => a.class === 'Workflow')[0] && data.containerRequest.mounts.varLibCwlWorkflowJson.content.graph.filter((a: any) => a.class === 'Workflow')[0].inputs.length > 0) {
                 dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_INPUT_DIALOG_NAME, data }));
             } else {
                 dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'There are no inputs in this process!', kind: SnackbarKind.ERROR }));
diff --git a/src/views-components/process-input-dialog/process-input-dialog.tsx b/src/views-components/process-input-dialog/process-input-dialog.tsx
index 2ad0a57f..edb4bc68 100644
--- a/src/views-components/process-input-dialog/process-input-dialog.tsx
+++ b/src/views-components/process-input-dialog/process-input-dialog.tsx
@@ -32,51 +32,16 @@ export const ProcessInputDialog = withDialog(PROCESS_INPUT_DIALOG_NAME)(
 );
 
 const getInputs = (data: any) =>
-    data && data.mounts.varLibCwlWorkflowJson ? data.mounts.varLibCwlWorkflowJson.content.graph[1].inputs.map((it: any) => (
+    data && data.mounts.varLibCwlWorkflowJson ? data.mounts.varLibCwlWorkflowJson.content.graph.filter((a: any) => a.class === 'Workflow')[0].inputs.map((it: any) => (
         { type: it.type, id: it.id, label: it.label, value: getInputValue(it.id, data.mounts.varLibCwlCwlInputJson.content), disabled: true }
     )) : [];
 
+const snakeToCamel = (s: string) => {
+    const a = s.split('/');
+    return a[1].replace(/(\_\w)/g, (m: string) => m[1].toUpperCase());
+};
+
 export const getInputValue = (id: string, data: any) => {
-    switch (id) {
-        case "#main/example_flag":
-            return data.exampleFlag;
-        case "#main/example_directory":
-            return data.exampleDirectory;
-        case "#main/example_double":
-            return data.exampleDouble;
-        case "#main/example_file":
-            return data.exampleFile;
-        case "#main/example_float":
-            return data.exampleFloat;
-        case "#main/example_int":
-            return data.exampleInt;
-        case "#main/example_long":
-            return data.exampleLong;
-        case "#main/example_null":
-            return data.exampleNull;
-        case "#main/example_string":
-            return data.exampleString;
-        case "#main/enum_type":
-            return data.enumType;
-        case "#main/multiple_collections":
-            return data.multipleCollections;
-        case "#main/example_string_array":
-            return data.exampleStringArray;
-        case "#main/example_int_array":
-            return data.exampleIntArray;
-        case "#main/example_float_array":
-            return data.exampleFloatArray;
-        case "#main/multiple_files":
-            return data.multipleFiles;
-        case "#main/collection":
-            return data.collection;
-        case "#main/optional_file_missing_label":
-            return data.optionalFileMissingLabel;
-        case "#main/optional_file":
-            return data.optionalFile;
-        case "#main/single_file":
-            return data.singleFile;
-        default:
-            return data.exampleString;
-    }
+    const a = snakeToCamel(id);
+    return data[a];
 };
\ No newline at end of file

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list