From: Stephen Smith Date: Wed, 12 Oct 2022 13:58:45 +0000 (-0400) Subject: 16073: Fix display of empty raw params when workflow definition is present X-Git-Tag: 2.5.0~31^2~18 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/7db41995e4c8d77094f8dad71902de30b1650b37 16073: Fix display of empty raw params when workflow definition is present Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- 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) &&
} }