X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/837e79c83399108aa0492f163205edb952f0ab71..56069f1f9fa111b9756e9bfa7a3b0c9dba2e9a7a:/src/views/process-panel/process-subprocesses-card.tsx

diff --git a/src/views/process-panel/process-subprocesses-card.tsx b/src/views/process-panel/process-subprocesses-card.tsx
index 4226fefc8c..9607f49a5a 100644
--- a/src/views/process-panel/process-subprocesses-card.tsx
+++ b/src/views/process-panel/process-subprocesses-card.tsx
@@ -14,7 +14,7 @@ import { Process, getProcessStatus, getProcessRuntime } from '~/store/processes/
 import { formatTime } from '~/common/formatters';
 import { getProcessStatusColor } from '~/store/processes/process';
 
-export type CssRules = 'label' | 'value' | 'title' | 'content' | 'action' | 'options' | 'status' | 'rightSideHeader' | 'titleHeader' | 'header';
+export type CssRules = 'label' | 'value' | 'title' | 'content' | 'action' | 'options' | 'status' | 'rightSideHeader' | 'titleHeader' | 'header' | 'moreOptions';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     label: {
@@ -42,7 +42,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         color: theme.palette.common.white,
     },
     status: {
-        paddingTop: theme.spacing.unit * 0.5,
+        paddingTop: theme.spacing.unit * 0.75,
         color: theme.palette.common.white,
     },
     rightSideHeader: {
@@ -56,6 +56,9 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         paddingTop: 0,
         paddingBottom: 0,
     },
+    moreOptions: {
+        position: 'absolute'
+    }
 });
 
 export interface SubprocessItemProps {
@@ -69,7 +72,7 @@ export interface ProcessSubprocessesCardDataProps {
     subprocess: Process;
 }
 
-type ProcessSubprocessesCardProps = ProcessSubprocessesCardDataProps & WithStyles<CssRules>;
+type ProcessSubprocessesCardProps = ProcessSubprocessesCardDataProps & WithStyles<CssRules, true>;
 
 export const ProcessSubprocessesCard = withStyles(styles, { withTheme: true })(
     ({ classes, onContextMenu, subprocess, theme }: ProcessSubprocessesCardProps) => {
@@ -80,29 +83,31 @@ export const ProcessSubprocessesCard = withStyles(styles, { withTheme: true })(
                 classes={{ content: classes.title, action: classes.action }}
                 action={
                     <div className={classes.rightSideHeader}>
-                        <Typography noWrap variant="body2" className={classes.status}>
+                        <Typography noWrap variant='body1' className={classes.status}>
                             {getProcessStatus(subprocess)}
                         </Typography>
-                        <IconButton
-                            className={classes.options}
-                            aria-label="More options"
-                            onClick={onContextMenu}>
-                            <Tooltip title="More options">
-                                <MoreOptionsIcon />
-                            </Tooltip>
-                        </IconButton>
+                        <Tooltip title="More options" disableFocusListener>
+                            <IconButton
+                                className={classes.options}
+                                aria-label="More options"
+                                onClick={onContextMenu}>
+                                <MoreOptionsIcon className={classes.moreOptions} />
+                            </IconButton>
+                        </Tooltip>
                     </div>
                 }
                 title={
                     <Tooltip title={subprocess.containerRequest.name}>
-                        <Typography noWrap variant="body2" className={classes.titleHeader}>
+                        <Typography noWrap variant='body1' className={classes.titleHeader}>
                             {subprocess.containerRequest.name}
                         </Typography>
                     </Tooltip>
                 } />
             <CardContent className={classes.content}>
                 <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                    label="Runtime" value={formatTime(getProcessRuntime(subprocess))} />
+                    label="Runtime" value={subprocess.container && subprocess.container.startedAt && subprocess.container.finishedAt
+                        ? formatTime(getProcessRuntime(subprocess)) :
+                        '(none)'} />
             </CardContent>
         </Card>;
-    });
\ No newline at end of file
+    });
