15672: Removes filter panel & makes pagination choices bigger.
[arvados.git] / src / views / process-panel / process-panel-root.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { Grid } from '@material-ui/core';
7 import { ProcessInformationCard } from './process-information-card';
8 import { DefaultView } from '~/components/default-view/default-view';
9 import { ProcessIcon } from '~/components/icon/icon';
10 import { Process } from '~/store/processes/process';
11 import { SubprocessPanel } from '~/views/subprocess-panel/subprocess-panel';
12 import { SubprocessFilterDataProps } from '~/components/subprocess-filter/subprocess-filter';
13
14 export interface ProcessPanelRootDataProps {
15     process?: Process;
16     subprocesses: Array<Process>;
17     filters: Array<SubprocessFilterDataProps>;
18 }
19
20 export interface ProcessPanelRootActionProps {
21     onContextMenu: (event: React.MouseEvent<HTMLElement>, process: Process) => void;
22     onToggle: (status: string) => void;
23     openProcessInputDialog: (uuid: string) => void;
24     navigateToOutput: (uuid: string) => void;
25     navigateToWorkflow: (uuid: string) => void;
26     cancelProcess: (uuid: string) => void;
27 }
28
29 export type ProcessPanelRootProps = ProcessPanelRootDataProps & ProcessPanelRootActionProps;
30
31 export const ProcessPanelRoot = ({ process, ...props }: ProcessPanelRootProps) =>
32     process
33         ? <Grid container spacing={16} alignItems="stretch">
34             <Grid item sm={12} md={12}>
35                 <ProcessInformationCard
36                     process={process}
37                     onContextMenu={event => props.onContextMenu(event, process)}
38                     openProcessInputDialog={props.openProcessInputDialog}
39                     navigateToOutput={props.navigateToOutput}
40                     openWorkflow={props.navigateToWorkflow}
41                     cancelProcess={props.cancelProcess}
42                 />
43             </Grid>
44             <Grid item sm={12} md={12}>
45                 <SubprocessPanel />
46             </Grid>
47         </Grid>
48         : <Grid container
49             alignItems='center'
50             justify='center'
51             style={{ minHeight: '100%' }}>
52             <DefaultView
53                 icon={ProcessIcon}
54                 messages={['Process not found']} />
55         </Grid>;
56