X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9f32ba406d862fa0ad79ac7c23c6b0aced1bdf13..7e67490b7e0808b8838a1823c90565ae162b200b:/services/workbench2/src/views/process-panel/process-io-card.tsx 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..5716340edc 100644 --- a/services/workbench2/src/views/process-panel/process-io-card.tsx +++ b/services/workbench2/src/views/process-panel/process-io-card.tsx @@ -89,7 +89,8 @@ type CssRules = | "symmetricTabs" | "imagePlaceholder" | "rowWithPreview" - | "labelColumn"; + | "labelColumn" + | "primaryRow"; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ card: { @@ -123,7 +124,7 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }, tableWrapper: { height: "auto", - maxHeight: `calc(100% - ${theme.spacing.unit * 4.5}px)`, + maxHeight: `calc(100% - ${theme.spacing.unit * 3}px)`, overflow: "auto", }, tableRoot: { @@ -173,10 +174,10 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ paddingLeft: "20px", }, secondaryRow: { - height: "29px", + height: "24px", verticalAlign: "top", position: "relative", - top: "-9px", + top: "-4px", }, emptyValue: { color: theme.customs.colors.grey700, @@ -184,7 +185,10 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ noBorderRow: { "& td": { borderBottom: "none", + paddingTop: "2px", + paddingBottom: "2px", }, + height: "24px", }, symmetricTabs: { "& button": { @@ -206,11 +210,18 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ labelColumn: { minWidth: "120px", }, + primaryRow: { + height: "24px", + "& td": { + paddingTop: "2px", + paddingBottom: "2px", + }, + }, }); export enum ProcessIOCardType { - INPUT = "Inputs", - OUTPUT = "Outputs", + INPUT = "Input Parameters", + OUTPUT = "Output Parameters", } export interface ProcessIOCardDataProps { process?: Process; @@ -219,7 +230,7 @@ export interface ProcessIOCardDataProps { raw: any; mounts?: InputCollectionMount[]; outputUuid?: string; - showParams?: boolean; + forceShowParams?: boolean; } export interface ProcessIOCardActionProps { @@ -251,7 +262,7 @@ export const ProcessIOCard = withStyles(styles)( panelName, process, navigateTo, - showParams, + forceShowParams, }: ProcessIOCardProps) => { const [mainProcTabState, setMainProcTabState] = useState(0); const [subProcTabState, setSubProcTabState] = useState(0); @@ -266,14 +277,20 @@ 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); + // isRawLoaded allows subprocess panel to display raw even if it's {} + const isRawLoaded = !!(raw && Object.keys(raw).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 && ( @@ -364,9 +381,9 @@ export const ProcessIOCard = withStyles(styles)( )} {/* 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 - */} + * 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 */} {hasParams && } - {!showParams && } + {!forceShowParams && } + {hasOutputCollecton && } {mainProcTabState === 0 && params && hasParams && (
)} @@ -393,6 +411,28 @@ export const ProcessIOCard = withStyles(styles)( )} + {mainProcTabState === 2 && hasOutputCollecton && ( + <> + {outputUuid && ( + + Output Collection:{" "} + { + navigateTo(outputUuid || ""); + }} + > + {outputUuid} + + + )} + + + )} + )} {!loading && !hasRaw && !hasParams && ( @@ -409,7 +449,7 @@ export const ProcessIOCard = withStyles(styles)( ) : ( // Subprocess <> - {loading && ( + {subProcessLoading ? ( - )} - {!loading && (hasInputMounts || hasOutputCollecton || hasRaw) ? ( + ) : !subProcessLoading && (hasInputMounts || hasOutputCollecton || isRawLoaded) ? ( <> {hasInputMounts && } {hasOutputCollecton && } - + {isRawLoaded && }
{subProcTabState === 0 && hasInputMounts && } @@ -454,7 +493,7 @@ export const ProcessIOCard = withStyles(styles)( /> )} - {(subProcTabState === 1 || (!hasInputMounts && !hasOutputCollecton)) && ( + {isRawLoaded && (subProcTabState === 1 || (!hasInputMounts && !hasOutputCollecton)) && (
@@ -523,6 +562,7 @@ const ProcessIOPreview = memo( const rest = param.value.slice(1); const mainRowClasses = { [classes.noBorderRow]: rest.length > 0, + [classes.primaryRow]: true }; return ( @@ -549,6 +589,7 @@ const ProcessIOPreview = memo( const rowClasses = { [classes.noBorderRow]: i < rest.length - 1, [classes.secondaryRow]: val.secondary, + [classes.primaryRow]: !val.secondary, }; return ( {keepUrlPath || "/"} @@ -893,6 +934,7 @@ const fileToProcessIOValue = (file: File, secondary: boolean, auth: AuthState, p {file.location}