X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e7af6c00434d5eb34c72ac714cfd450052185762..fa9e1f065eefa7265879869e4b45eb76be64b4ce:/src/views/process-panel/process-subprocesses.tsx

diff --git a/src/views/process-panel/process-subprocesses.tsx b/src/views/process-panel/process-subprocesses.tsx
index 4ab444c2..d3f87701 100644
--- a/src/views/process-panel/process-subprocesses.tsx
+++ b/src/views/process-panel/process-subprocesses.tsx
@@ -5,63 +5,21 @@
 import * as React from 'react';
 import { Grid } from '@material-ui/core';
 import { ProcessSubprocessesCard } from '~/views/process-panel/process-subprocesses-card';
-
-export enum SubprocessesStatus {
-    ACTIVE = 'Active',
-    COMPLETED = 'Completed',
-    QUEUED = 'Queued',
-    FAILED = 'Failed',
-    CANCELED = 'Canceled'
-}
+import { Process } from '~/store/processes/process';
 
 export interface ProcessSubprocessesDataProps {
-    onContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
-}
-
-interface SubprocessesProps {
-    title: string;
-    status: string;
-    runtime?: string;
+    subprocesses: Array<Process>;
+    onContextMenu: (event: React.MouseEvent<HTMLElement>, process: Process) => void;
 }
 
-export const ProcessSubprocesses = ({ onContextMenu }: ProcessSubprocessesDataProps) => {
+export const ProcessSubprocesses = ({ onContextMenu, subprocesses }: ProcessSubprocessesDataProps) => {
     return <Grid container spacing={16}>
-        {items.map(it =>
-            <Grid item xs={2} key={it.title}>
-                <ProcessSubprocessesCard onContextMenu={onContextMenu} items={it} />
+        {subprocesses.map(subprocess =>
+            <Grid item xs={12} sm={6} md={4} lg={2} key={subprocess.containerRequest.uuid}>
+                <ProcessSubprocessesCard
+                    onContextMenu={event => onContextMenu(event, subprocess)}
+                    subprocess={subprocess} />
             </Grid>
         )}
     </Grid>;
 };
-
-const items: Array<SubprocessesProps> = [
-    {
-        title: 'cos1',
-        status: SubprocessesStatus.ACTIVE
-    },
-    {
-        title: 'cos2',
-        status: SubprocessesStatus.FAILED
-    },
-    {
-        title: 'cos3',
-        status: SubprocessesStatus.QUEUED
-    },
-    {
-        title: 'cos4',
-        status: SubprocessesStatus.CANCELED
-    },
-    {
-        title: 'cos5',
-        status: SubprocessesStatus.COMPLETED
-    },
-    {
-        title: 'cos6',
-        status: SubprocessesStatus.COMPLETED
-    },
-    {
-        title: 'cos7',
-        status: SubprocessesStatus.COMPLETED
-    },
-];
-
