From 3964842ffc26bd36a9318ab22cbb69bebd30ace1 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Fri, 9 Dec 2022 10:47:54 -0500 Subject: [PATCH] 19848: Add raw/json tab to subprocess io cards Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- src/views/process-panel/process-io-card.tsx | 29 ++++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/views/process-panel/process-io-card.tsx b/src/views/process-panel/process-io-card.tsx index ceba293e..8b85617d 100644 --- a/src/views/process-panel/process-io-card.tsx +++ b/src/views/process-panel/process-io-card.tsx @@ -240,9 +240,13 @@ type ProcessIOCardProps = ProcessIOCardDataProps & ProcessIOCardActionProps & Wi export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps)( ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, doMaximizePanel, doUnMaximizePanel, panelMaximized, panelName, process, navigateTo }: ProcessIOCardProps) => { const [mainProcTabState, setMainProcTabState] = useState(0); + const [subProcTabState, setSubProcTabState] = useState(0); const handleMainProcTabChange = (event: React.MouseEvent, value: number) => { setMainProcTabState(value); } + const handleSubProcTabChange = (event: React.MouseEvent, value: number) => { + setSubProcTabState(value); + } const [showImagePreview, setShowImagePreview] = useState(false); @@ -253,6 +257,10 @@ export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps 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); + return ) : // Subprocess (<> - {((mounts && mounts.length) || outputUuid) ? + {loading && + + } + {!loading && (hasInputMounts || hasOutputCollecton || hasRaw) ? <> - - {label === ProcessIOCardType.INPUT && } - {label === ProcessIOCardType.OUTPUT && } + + {hasInputMounts && } + {hasOutputCollecton && } +
- {label === ProcessIOCardType.INPUT && } - {label === ProcessIOCardType.OUTPUT && <> + {subProcTabState === 0 && hasInputMounts && } + {subProcTabState === 0 && hasOutputCollecton && <> {outputUuid && Output Collection: {navigateTo(outputUuid || "")}}> {outputUuid} } } + {(subProcTabState === 1 || (!hasInputMounts && !hasOutputCollecton)) &&
+ +
}
: - + } ) -- 2.30.2