onContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
}
-type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles<CssRules>;
+type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles<CssRules, true>;
export const ProcessInformationCard = withStyles(styles, { withTheme: true })(
({ classes, process, onContextMenu, theme }: ProcessInformationCardProps) =>
<Chip label={getProcessStatus(process)}
className={classes.chip}
style={{ backgroundColor: getProcessStatusColor(getProcessStatus(process), theme as ArvadosTheme) }} />
- <IconButton
- aria-label="More options"
- onClick={event => onContextMenu(event)}>
- <MoreOptionsIcon />
- </IconButton>
+ <Tooltip title="More options">
+ <IconButton
+ aria-label="More options"
+ onClick={event => onContextMenu(event)}>
+ <MoreOptionsIcon />
+ </IconButton>
+ </Tooltip>
</div>
}
title={
</Tooltip>
}
subheader={
- <Tooltip title={process.containerRequest.description || '(no-description)'} placement="bottom-start">
+ <Tooltip title={getDescription(process)} placement="bottom-start">
<Typography noWrap variant="body2" color='inherit'>
- {process.containerRequest.description || '(no-description)'}
+ {getDescription(process)}
</Typography>
</Tooltip>} />
<CardContent className={classes.content}>
</Grid>
</CardContent>
</Card>
-);
\ No newline at end of file
+);
+
+const getDescription = (process: Process) =>
+ process.containerRequest.description || '(no-description)';