From ce2ea2b32bdbaa8a9156ca80f8bf2eb33308ba89 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Thu, 22 Sep 2022 12:19:12 -0400 Subject: [PATCH] 16073: Add maximize to process io panels Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- src/views/process-panel/process-io-card.tsx | 100 +++++++++--------- .../process-output-collection-files.ts | 15 ++- .../process-panel/process-panel-root.tsx | 4 +- 3 files changed, 68 insertions(+), 51 deletions(-) diff --git a/src/views/process-panel/process-io-card.tsx b/src/views/process-panel/process-io-card.tsx index b1cfdb3e..0a1ec9e2 100644 --- a/src/views/process-panel/process-io-card.tsx +++ b/src/views/process-panel/process-io-card.tsx @@ -26,7 +26,7 @@ import { Chip, } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; -import { CloseIcon, ImageIcon, InfoIcon, InputIcon, ImageOffIcon, OutputIcon } from 'components/icon/icon'; +import { CloseIcon, ImageIcon, InputIcon, ImageOffIcon, OutputIcon, MaximizeIcon } from 'components/icon/icon'; import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view'; import { BooleanCommandInputParameter, @@ -82,6 +82,7 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ paddingTop: theme.spacing.unit * 0.5 }, content: { + height: `calc(100% - ${theme.spacing.unit * 7}px - ${theme.spacing.unit * 1.5}px)`, padding: theme.spacing.unit * 1.0, paddingTop: theme.spacing.unit * 0.5, '&:last-child': { @@ -93,6 +94,7 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ paddingTop: theme.spacing.unit * 0.5 }, tableWrapper: { + height: `calc(100% - ${theme.spacing.unit * 6}px)`, overflow: 'auto', }, tableRoot: { @@ -186,7 +188,7 @@ const mapDispatchToProps = (dispatch: Dispatch): ProcessIOCardActionProps => ({ type ProcessIOCardProps = ProcessIOCardDataProps & ProcessIOCardActionProps & WithStyles & MPVPanelProps; export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps)( - ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, panelName, process, navigateTo }: ProcessIOCardProps) => { + ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, doMaximizePanel, panelMaximized, panelName, process, navigateTo }: ProcessIOCardProps) => { const [mainProcTabState, setMainProcTabState] = useState(0); const handleMainProcTabChange = (event: React.MouseEvent, value: number) => { setMainProcTabState(value); @@ -215,6 +217,10 @@ export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps { mainProcess && {setShowImagePreview(!showImagePreview)}}>{showImagePreview ? : } } + { doMaximizePanel && !panelMaximized && + + + } { doHidePanel && @@ -222,52 +228,50 @@ export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps } /> -
- {mainProcess ? - (<> - {params.length ? - <> - - - - - {mainProcTabState === 0 &&
- -
} - {mainProcTabState === 1 &&
- -
} - : - - - - } - ) : - (<> - {((mounts && mounts.length) || outputUuid) ? - <> - - {label === ProcessIOCardType.INPUT && } - {label === ProcessIOCardType.OUTPUT && } - -
- {label === ProcessIOCardType.INPUT && } - {label === ProcessIOCardType.OUTPUT && <> - {outputUuid && - Output Collection: {navigateTo(outputUuid || "")}}> - {outputUuid} - } - - } -
- : - - - - } - ) - } -
+ {mainProcess ? + (<> + {params.length ? + <> + + + + + {mainProcTabState === 0 &&
+ +
} + {mainProcTabState === 1 &&
+ +
} + : + + + + } + ) : + (<> + {((mounts && mounts.length) || outputUuid) ? + <> + + {label === ProcessIOCardType.INPUT && } + {label === ProcessIOCardType.OUTPUT && } + +
+ {label === ProcessIOCardType.INPUT && } + {label === ProcessIOCardType.OUTPUT && <> + {outputUuid && + Output Collection: {navigateTo(outputUuid || "")}}> + {outputUuid} + } + + } +
+ : + + + + } + ) + }
; } diff --git a/src/views/process-panel/process-output-collection-files.ts b/src/views/process-panel/process-output-collection-files.ts index d0b44cd1..e09078ae 100644 --- a/src/views/process-panel/process-output-collection-files.ts +++ b/src/views/process-panel/process-output-collection-files.ts @@ -14,6 +14,7 @@ import { openContextMenu, openCollectionFilesContextMenu } from 'store/context-m import { openUploadCollectionFilesDialog } from 'store/collections/collection-upload-actions'; import { ResourceKind } from "models/resource"; import { openDetailsPanel } from 'store/details-panel/details-panel-action'; +import { StyleRulesCallback, Theme, withStyles } from "@material-ui/core"; const mapDispatchToProps = (dispatch: Dispatch): Pick => ({ onUploadDataClick: (targetLocation?: string) => { @@ -55,4 +56,16 @@ const mapDispatchToProps = (dispatch: Dispatch): Pick = (theme: Theme) => ({ + wrapper: {}, + dataWrapper: {}, + leftPanel: {}, + rightPanel: {}, +}); + +export const ProcessOutputCollectionFiles = withStyles(styles)(connect(null, mapDispatchToProps)(Component)); diff --git a/src/views/process-panel/process-panel-root.tsx b/src/views/process-panel/process-panel-root.tsx index 5174d300..1651b63a 100644 --- a/src/views/process-panel/process-panel-root.tsx +++ b/src/views/process-panel/process-panel-root.tsx @@ -133,7 +133,7 @@ export const ProcessPanelRoot = withStyles(styles)( navigateToLog={props.navigateToLog} /> - + - +