X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e51302fb1afc150e015bb2a77a633cb2176dff7f..6df149b9bebe91e92de4c396f60127ee5b5b4de1:/src/views/process-panel/process-io-card.tsx diff --git a/src/views/process-panel/process-io-card.tsx b/src/views/process-panel/process-io-card.tsx index 119bbb5713..7d4565228c 100644 --- a/src/views/process-panel/process-io-card.tsx +++ b/src/views/process-panel/process-io-card.tsx @@ -25,7 +25,7 @@ import { Chip, } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; -import { CloseIcon, InfoIcon, ProcessIcon } from 'components/icon/icon'; +import { CloseIcon, InfoIcon, ProcessIcon, InputIcon, OutputIcon } from 'components/icon/icon'; import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view'; import { BooleanCommandInputParameter, @@ -59,8 +59,9 @@ import { InputCollectionMount } from 'store/processes/processes-actions'; import { connect } from 'react-redux'; import { RootState } from 'store/store'; import { ProcessOutputCollectionFiles } from './process-output-collection-files'; +import { Process } from 'store/processes/process'; -type CssRules = 'card' | 'content' | 'title' | 'header' | 'avatar' | 'iconHeader' | 'tableWrapper' | 'tableRoot' | 'paramValue' | 'keepLink' | 'imagePreview' | 'valArray' | 'emptyValue'; +type CssRules = 'card' | 'content' | 'title' | 'header' | 'avatar' | 'iconHeader' | 'tableWrapper' | 'tableRoot' | 'paramValue' | 'keepLink' | 'imagePreview' | 'valArray' | 'emptyValue' | 'symmetricTabs'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ card: { @@ -94,10 +95,15 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }, tableRoot: { width: '100%', + '& thead th': { + verticalAlign: 'bottom', + paddingBottom: '10px', + } }, paramValue: { display: 'flex', - alignItems: 'center', + alignItems: 'flex-start', + flexDirection: 'column', }, keepLink: { color: theme.palette.primary.main, @@ -107,7 +113,8 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }, imagePreview: { maxHeight: '15em', - marginRight: theme.spacing.unit, + maxWidth: '15em', + marginBottom: theme.spacing.unit, }, valArray: { display: 'flex', @@ -120,6 +127,11 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ emptyValue: { color: theme.customs.colors.grey500, }, + symmetricTabs: { + '& button': { + flexBasis: '0', + } + }, }); export enum ProcessIOCardType { @@ -127,6 +139,7 @@ export enum ProcessIOCardType { OUTPUT = 'Outputs', } export interface ProcessIOCardDataProps { + process: Process; label: ProcessIOCardType; params: ProcessIOParameter[]; raw?: any; @@ -137,12 +150,14 @@ export interface ProcessIOCardDataProps { type ProcessIOCardProps = ProcessIOCardDataProps & WithStyles & MPVPanelProps; export const ProcessIOCard = withStyles(styles)( - ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, panelName }: ProcessIOCardProps) => { - const [tabState, setTabState] = useState(0); - const handleChange = (event: React.MouseEvent, value: number) => { - setTabState(value); + ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, panelName, process }: ProcessIOCardProps) => { + const [mainProcTabState, setMainProcTabState] = useState(0); + const handleMainProcTabChange = (event: React.MouseEvent, value: number) => { + setMainProcTabState(value); } + const PanelIcon = label == ProcessIOCardType.INPUT ? InputIcon : OutputIcon; + return } + avatar={} title={ {label} @@ -166,30 +181,38 @@ export const ProcessIOCard = withStyles(styles)( } />
- - - - {label === ProcessIOCardType.INPUT && } - {label === ProcessIOCardType.OUTPUT && } - - {tabState === 0 &&
- {params.length ? - : - - - } -
} - {tabState === 1 &&
- {params.length ? - : - - - } -
} - {tabState === 2 &&
- {label === ProcessIOCardType.INPUT && } - {label === ProcessIOCardType.OUTPUT && } -
} + {!process.containerRequest.requestingContainerUuid ? + (<> + + + + + {mainProcTabState === 0 &&
+ {params.length ? + : + + + } +
} + {mainProcTabState === 1 &&
+ {params.length ? + : + + + } +
} + ) : + (<> + + {label === ProcessIOCardType.INPUT && } + {label === ProcessIOCardType.OUTPUT && } + +
+ {label === ProcessIOCardType.INPUT && } + {label === ProcessIOCardType.OUTPUT && } +
+ ) + }
; @@ -424,7 +447,7 @@ const KeepUrlBase = withStyles(styles)(({auth, res, pdh, classes}: KeepUrlProps // Passing a pdh always returns a relative wb2 collection url const pdhWbPath = getNavUrl(pdhUrl.replace('keep:', ''), auth); return pdhUrl && pdhWbPath ? - {pdhUrl} : + {pdhUrl} : <>; }); @@ -435,8 +458,9 @@ const KeepUrlPath = withStyles(styles)(({auth, res, pdh, classes}: KeepUrlProps const keepUrlPathNav = getKeepNavUrl(auth, res, pdh); return keepUrlPath && keepUrlPathNav ? - handleClick(keepUrlPathNav)}>{keepUrlPath} : - <>; + handleClick(keepUrlPathNav)}>{keepUrlPath} : + // Show No value for root collection io that lacks path part + ; }); const getKeepNavUrl = (auth: AuthState, file: File | Directory, pdh?: string): string => {