From 7db41995e4c8d77094f8dad71902de30b1650b37 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Wed, 12 Oct 2022 09:58:45 -0400 Subject: [PATCH] 16073: Fix display of empty raw params when workflow definition is present Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- src/views/process-panel/process-io-card.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/views/process-panel/process-io-card.tsx b/src/views/process-panel/process-io-card.tsx index 937478ef..0e93c9a6 100644 --- a/src/views/process-panel/process-io-card.tsx +++ b/src/views/process-panel/process-io-card.tsx @@ -225,6 +225,10 @@ export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps const PanelIcon = label === ProcessIOCardType.INPUT ? InputIcon : OutputIcon; const mainProcess = !process.containerRequest.requestingContainerUuid; + const loading = raw === undefined || params === undefined; + const hasRaw = !!(raw && Object.keys(raw).length > 0); + const hasParams = !!(params && params.length > 0); + return {/* raw is undefined until params are loaded */} - {raw === undefined && + {loading && } - {raw && Object.keys(raw).length > 0 && + {/* Once loaded, either raw or params may still be empty + * Raw when all params are empty + * Params when raw is provided by containerRequest properties but workflow mount is absent for preview + */} + {(!loading && (hasRaw || hasParams)) && <> {/* params will be empty on processes without workflow definitions in mounts, so we only show raw */} - {(params && params.length) && } + {hasParams && } - {(mainProcTabState === 0 && params && params.length > 0) &&
+ {(mainProcTabState === 0 && params && hasParams) &&
} - {(mainProcTabState === 1 || !params || !(params.length > 0)) &&
+ {(mainProcTabState === 1 || !hasParams) &&
} } -- 2.30.2