From 4af2e048f6efad08608670cb3ba4da144ec14301 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Fri, 12 Jan 2024 15:18:04 -0500 Subject: [PATCH] 21366: Tweaks the condition for displaying io panel subprocess spinner It no longer shows when there are input mounts or output collection to show. Also fixes possibility of spinner and no results showing simultaneously. Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- .../views/process-panel/process-io-card.tsx | 23 +++++++++++-------- .../registered-workflow-panel.tsx | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/services/workbench2/src/views/process-panel/process-io-card.tsx b/services/workbench2/src/views/process-panel/process-io-card.tsx index b5afbf6545..393bde9667 100644 --- a/services/workbench2/src/views/process-panel/process-io-card.tsx +++ b/services/workbench2/src/views/process-panel/process-io-card.tsx @@ -219,7 +219,7 @@ export interface ProcessIOCardDataProps { raw: any; mounts?: InputCollectionMount[]; outputUuid?: string; - showParams?: boolean; + forceShowParams?: boolean; } export interface ProcessIOCardActionProps { @@ -251,7 +251,7 @@ export const ProcessIOCard = withStyles(styles)( panelName, process, navigateTo, - showParams, + forceShowParams, }: ProcessIOCardProps) => { const [mainProcTabState, setMainProcTabState] = useState(0); const [subProcTabState, setSubProcTabState] = useState(0); @@ -266,14 +266,18 @@ export const ProcessIOCard = withStyles(styles)( const PanelIcon = label === ProcessIOCardType.INPUT ? InputIcon : OutputIcon; const mainProcess = !(process && process!.containerRequest.requestingContainerUuid); + const showParamTable = mainProcess || forceShowParams; const loading = raw === null || raw === undefined || params === null; + const hasRaw = !!(raw && Object.keys(raw).length > 0); const hasParams = !!(params && params.length > 0); // Subprocess const hasInputMounts = !!(label === ProcessIOCardType.INPUT && mounts && mounts.length); const hasOutputCollecton = !!(label === ProcessIOCardType.OUTPUT && outputUuid); + // Subprocess should not show loading if hasOutputCollection or hasInputMounts + const subProcessLoading = loading && !hasOutputCollecton && !hasInputMounts; return ( - {mainProcess || showParams ? ( + {showParamTable ? ( <> {/* raw is undefined until params are loaded */} {loading && ( @@ -377,14 +381,14 @@ export const ProcessIOCard = withStyles(styles)( > {/* params will be empty on processes without workflow definitions in mounts, so we only show raw */} {hasParams && } - {!showParams && } + {!forceShowParams && } {mainProcTabState === 0 && params && hasParams && (
)} @@ -409,7 +413,7 @@ export const ProcessIOCard = withStyles(styles)( ) : ( // Subprocess <> - {loading && ( + {subProcessLoading ? ( - )} - {!loading && (hasInputMounts || hasOutputCollecton || hasRaw) ? ( + ) : !subProcessLoading && (hasInputMounts || hasOutputCollecton || hasRaw) ? ( <> {hasInputMounts && } {hasOutputCollecton && } - + {hasRaw && }
{subProcTabState === 0 && hasInputMounts && } @@ -454,7 +457,7 @@ export const ProcessIOCard = withStyles(styles)( /> )} - {(subProcTabState === 1 || (!hasInputMounts && !hasOutputCollecton)) && ( + {hasRaw && (subProcTabState === 1 || (!hasInputMounts && !hasOutputCollecton)) && (
diff --git a/services/workbench2/src/views/workflow-panel/registered-workflow-panel.tsx b/services/workbench2/src/views/workflow-panel/registered-workflow-panel.tsx index 50192e543d..53c5928023 100644 --- a/services/workbench2/src/views/workflow-panel/registered-workflow-panel.tsx +++ b/services/workbench2/src/views/workflow-panel/registered-workflow-panel.tsx @@ -184,7 +184,7 @@ export const RegisteredWorkflowPanel = withStyles(styles)(connect( label={ProcessIOCardType.INPUT} params={inputParams} raw={{}} - showParams={true} + forceShowParams={true} /> @@ -192,7 +192,7 @@ export const RegisteredWorkflowPanel = withStyles(styles)(connect( label={ProcessIOCardType.OUTPUT} params={outputParams} raw={{}} - showParams={true} + forceShowParams={true} /> -- 2.30.2