X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/2f2b2fe9fedb03e78c1ff520681ffce4715ff760..151c8c646b7fd78fc9ca2b8174eae11bce67873f:/src/views/process-panel/process-panel-root.tsx?ds=sidebyside

diff --git a/src/views/process-panel/process-panel-root.tsx b/src/views/process-panel/process-panel-root.tsx
index 8e78f564..ab8af36f 100644
--- a/src/views/process-panel/process-panel-root.tsx
+++ b/src/views/process-panel/process-panel-root.tsx
@@ -10,58 +10,35 @@ import { ProcessIcon } from '~/components/icon/icon';
 import { Process } from '~/store/processes/process';
 import { SubprocessesCard } from './subprocesses-card';
 import { ProcessSubprocesses } from '~/views/process-panel/process-subprocesses';
-import { SubprocessesStatus } from '~/views/process-panel/process-subprocesses-card';
-
-type CssRules = 'headerActive' | 'headerCompleted' | 'headerQueued' | 'headerFailed' | 'headerCanceled';
+import { SubprocessFilterDataProps } from '~/components/subprocess-filter/subprocess-filter';
 
 export interface ProcessPanelRootDataProps {
     process?: Process;
     subprocesses: Array<Process>;
+    filters: Array<SubprocessFilterDataProps>;
+    totalSubprocessesLength: number;
 }
 
 export interface ProcessPanelRootActionProps {
-    onContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
+    onContextMenu: (event: React.MouseEvent<HTMLElement>, process: Process) => void;
+    onToggle: (status: string) => void;
 }
 
 export type ProcessPanelRootProps = ProcessPanelRootDataProps & ProcessPanelRootActionProps;
 
-export const ProcessPanelRoot = (props: ProcessPanelRootProps) =>
-    props.process
-        ? <Grid container spacing={16}>
-            <Grid item xs={7}>
+export const ProcessPanelRoot = ({process, ...props}: ProcessPanelRootProps) =>
+    process
+        ? <Grid container spacing={16} alignItems="stretch">
+            <Grid item sm={12} md={7}>
                 <ProcessInformationCard
-                    process={props.process}
-                    onContextMenu={props.onContextMenu} />
+                    process={process}
+                    onContextMenu={event => props.onContextMenu(event, process)} />
             </Grid>
-            <Grid item xs={5}>
+            <Grid item sm={12} md={5}>
                 <SubprocessesCard
-                    subprocesses={4}
-                    filters={[
-                        {
-                            key: 'queued',
-                            value: 1,
-                            label: 'Queued',
-                            checked: true
-                        }, {
-                            key: 'active',
-                            value: 2,
-                            label: 'Active',
-                            checked: true
-                        },
-                        {
-                            key: 'completed',
-                            value: 2,
-                            label: 'Completed',
-                            checked: true
-                        },
-                        {
-                            key: 'failed',
-                            value: 2,
-                            label: 'Failed',
-                            checked: true
-                        }
-                    ]}
-                    onToggle={() => { return; }}
+                    subprocessesAmount={props.totalSubprocessesLength}
+                    filters={props.filters}
+                    onToggle={props.onToggle}
                 />
             </Grid>
             <Grid item xs={12}>
@@ -78,3 +55,4 @@ export const ProcessPanelRoot = (props: ProcessPanelRootProps) =>
                 icon={ProcessIcon}
                 messages={['Process not found']} />
         </Grid>;
+
