18881: Adds runtime_status indicator to the process info card.
[arvados-workbench2.git] / src / views / process-panel / process-information-card.tsx
index fc34a31c2f2b0c7a761b88b85ca1b7e485091890..8f16db70c422f975b43950fe87e822b004f0812e 100644 (file)
@@ -16,6 +16,7 @@ import { formatDate } from 'common/formatters';
 import classNames from 'classnames';
 import { ContainerState } from 'models/container';
 import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view';
+import { ProcessRuntimeStatus } from 'views-components/process-runtime-status/process-runtime-status';
 
 type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'chip' | 'link' | 'content' | 'title' | 'avatar' | 'cancelButton' | 'header';
 
@@ -37,7 +38,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
     label: {
         display: 'flex',
-        justifyContent: 'flex-end',
+        justifyContent: 'flex-start',
         fontSize: '0.875rem',
         marginRight: theme.spacing.unit * 3,
         paddingRight: theme.spacing.unit
@@ -61,8 +62,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         borderRadius: theme.spacing.unit * 0.625,
     },
     content: {
+        paddingTop: '0px',
+        paddingLeft: theme.spacing.unit * 1,
+        paddingRight: theme.spacing.unit * 1,
         '&:last-child': {
-            paddingBottom: theme.spacing.unit * 2,
+            paddingBottom: theme.spacing.unit * 1,
         }
     },
     title: {
@@ -123,27 +127,28 @@ export const ProcessInformationCard = withStyles(styles, { withTheme: true })(
                         </Tooltip> }
                     </div>
                 }
-                title={
-                    <Tooltip title={process.containerRequest.name} placement="bottom-start">
-                        <Typography noWrap variant='h6' color='inherit'>
-                            {process.containerRequest.name}
-                        </Typography>
-                    </Tooltip>
+                title={ !!process.containerRequest.name &&
+                    <Typography noWrap variant='h6' color='inherit'>
+                        {process.containerRequest.name}
+                    </Typography>
                 }
                 subheader={
-                    <Tooltip title={getDescription(process)} placement="bottom-start">
-                        <Typography noWrap variant='body1' color='inherit'>
-                            {getDescription(process)}
-                        </Typography>
-                    </Tooltip>} />
+                    <Typography noWrap variant='body1' color='inherit'>
+                        {process.containerRequest.description}
+                    </Typography>
+                }
+            />
             <CardContent className={classes.content}>
                 <Grid container>
+                    <Grid item xs={12}>
+                        <ProcessRuntimeStatus runtimeStatus={process.container?.runtimeStatus} />
+                    </Grid>
                     <Grid item xs={6}>
                         <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                            label='From'
+                            label='Started at'
                             value={startedAt} />
                         <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                            label='To'
+                            label='Finished at'
                             value={finishedAt} />
                         {process.containerRequest.properties.workflowUuid &&
                             <span onClick={() => openWorkflow(process.containerRequest.properties.workflowUuid)}>
@@ -164,6 +169,3 @@ export const ProcessInformationCard = withStyles(styles, { withTheme: true })(
         </Card>;
     }
 );
-
-const getDescription = (process: Process) =>
-    process.containerRequest.description || '(no-description)';