X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9ccc7e8ebe82b97e219d65adeea8b03b2c9ed71a..59caadc58a0b7ffc92fa95c90b16c99a9af6d942:/src/views/process-panel/process-panel-root.tsx

diff --git a/src/views/process-panel/process-panel-root.tsx b/src/views/process-panel/process-panel-root.tsx
index c7ac938a93..f6d17395cd 100644
--- a/src/views/process-panel/process-panel-root.tsx
+++ b/src/views/process-panel/process-panel-root.tsx
@@ -8,9 +8,15 @@ import { ProcessInformationCard } from './process-information-card';
 import { DefaultView } from '~/components/default-view/default-view';
 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';
 
 export interface ProcessPanelRootDataProps {
     process?: Process;
+    subprocesses: Array<Process>;
 }
 
 export interface ProcessPanelRootActionProps {
@@ -21,17 +27,71 @@ export type ProcessPanelRootProps = ProcessPanelRootDataProps & ProcessPanelRoot
 
 export const ProcessPanelRoot = (props: ProcessPanelRootProps) =>
     props.process
-        ? <Grid container>
+        ? <Grid container spacing={16}>
             <Grid item xs={7}>
                 <ProcessInformationCard
                     process={props.process}
                     onContextMenu={props.onContextMenu} />
             </Grid>
+            <Grid item xs={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; }}
+                />
+            </Grid>
+            <Grid item xs={12}>
+                <ProcessSubprocesses
+                    subprocesses={props.subprocesses}
+                    onContextMenu={props.onContextMenu} />
+            </Grid>
         </Grid>
         : <Grid container
             alignItems='center'
-            justify='center'>
+            justify='center'
+            style={{ minHeight: '100%' }}>
             <DefaultView
                 icon={ProcessIcon}
                 messages={['Process not found']} />
         </Grid>;
+
+export const getStatusColor = (status: string, classes: Record<CssRules, string>) => {
+    switch (status) {
+        case SubprocessesStatus.COMPLETED:
+            return classes.headerCompleted;
+        case SubprocessesStatus.CANCELED:
+            return classes.headerCanceled;
+        case SubprocessesStatus.QUEUED:
+            return classes.headerQueued;
+        case SubprocessesStatus.FAILED:
+            return classes.headerFailed;
+        case SubprocessesStatus.ACTIVE:
+            return classes.headerActive;
+        default:
+            return classes.headerQueued;
+    }
+};
