From: Lucas Di Pentima Date: Tue, 19 Oct 2021 14:58:09 +0000 (-0300) Subject: 18128: Improves process panel. X-Git-Tag: 2.4.0~25^2~11 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/38c87aec8a898f4d1c180be6a7554523aeadcb83 18128: Improves process panel. Makes the subprocess panel take the available screen space. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/src/components/multi-panel-view/multi-panel-view.tsx b/src/components/multi-panel-view/multi-panel-view.tsx index 05c1de05..e0698750 100644 --- a/src/components/multi-panel-view/multi-panel-view.tsx +++ b/src/components/multi-panel-view/multi-panel-view.tsx @@ -147,12 +147,12 @@ const MPVContainerComponent = ({children, panelStates, classes, ...props}: MPVCo }; return - - { toggles } + + { toggles.map(tgl => {tgl}) } { panelVisibility.includes(true) ? panels - : + : } ; diff --git a/src/views/all-processes-panel/all-processes-panel.tsx b/src/views/all-processes-panel/all-processes-panel.tsx index f9fab44d..928b4fff 100644 --- a/src/views/all-processes-panel/all-processes-panel.tsx +++ b/src/views/all-processes-panel/all-processes-panel.tsx @@ -33,7 +33,7 @@ import { getInitialProcessStatusFilters, getInitialProcessTypeFilters } from 'st import { getProcess } from 'store/processes/process'; import { ResourcesState } from 'store/resources/resources'; -type CssRules = "toolbar" | "button"; +type CssRules = "toolbar" | "button" | "root"; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ toolbar: { @@ -43,6 +43,9 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ button: { marginLeft: theme.spacing.unit }, + root: { + width: '100%', + } }); export enum AllProcessesPanelColumnNames { @@ -142,18 +145,17 @@ export const AllProcessesPanel = withStyles(styles)( } render() { - return - } />; + dataTableDefaultView={ } /> + } } ) diff --git a/src/views/process-panel/process-panel-root.tsx b/src/views/process-panel/process-panel-root.tsx index e2854bdd..e604fe2b 100644 --- a/src/views/process-panel/process-panel-root.tsx +++ b/src/views/process-panel/process-panel-root.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; -import { Grid } from '@material-ui/core'; +import { Grid, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core'; import { ProcessInformationCard } from './process-information-card'; import { DefaultView } from 'components/default-view/default-view'; import { ProcessIcon } from 'components/icon/icon'; @@ -11,6 +11,15 @@ import { Process } from 'store/processes/process'; import { SubprocessPanel } from 'views/subprocess-panel/subprocess-panel'; import { SubprocessFilterDataProps } from 'components/subprocess-filter/subprocess-filter'; import { MPVContainer, MPVPanelContent, MPVPanelState } from 'components/multi-panel-view/multi-panel-view'; +import { ArvadosTheme } from 'common/custom-theme'; + +type CssRules = 'root'; + +const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ + root: { + width: '100%', + }, +}); export interface ProcessPanelRootDataProps { process?: Process; @@ -27,17 +36,17 @@ export interface ProcessPanelRootActionProps { cancelProcess: (uuid: string) => void; } -export type ProcessPanelRootProps = ProcessPanelRootDataProps & ProcessPanelRootActionProps; +export type ProcessPanelRootProps = ProcessPanelRootDataProps & ProcessPanelRootActionProps & WithStyles; const panelsData: MPVPanelState[] = [ {name: "Info"}, {name: "Subprocesses"}, ]; -export const ProcessPanelRoot = ({ process, ...props }: ProcessPanelRootProps) => +export const ProcessPanelRoot = withStyles(styles)(({ process, ...props }: ProcessPanelRootProps) => process - ? - + ? + props.onContextMenu(event, process)} @@ -47,7 +56,7 @@ export const ProcessPanelRoot = ({ process, ...props }: ProcessPanelRootProps) = cancelProcess={props.cancelProcess} /> - + @@ -58,5 +67,5 @@ export const ProcessPanelRoot = ({ process, ...props }: ProcessPanelRootProps) = - ; + );