X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/909ee82b3c7c7fd033c6ab2e82b4fb92f383e191..994434ce0881e5e4f309982790352e9af66cdb05:/src/views/process-panel/process-information-card.tsx diff --git a/src/views/process-panel/process-information-card.tsx b/src/views/process-panel/process-information-card.tsx index 359c2565..7fcabcbb 100644 --- a/src/views/process-panel/process-information-card.tsx +++ b/src/views/process-panel/process-information-card.tsx @@ -7,19 +7,19 @@ import { StyleRulesCallback, WithStyles, withStyles, Card, CardHeader, IconButton, CardContent, Grid, Chip, Typography, Tooltip } from '@material-ui/core'; -import * as classnames from "classnames"; import { ArvadosTheme } from '~/common/custom-theme'; import { MoreOptionsIcon, ProcessIcon } from '~/components/icon/icon'; import { DetailsAttribute } from '~/components/details-attribute/details-attribute'; -import { getBackgroundColorStatus } from '~/views/process-panel/process-panel'; -import { SubprocessesStatus } from '~/views/process-panel/process-subprocesses'; +import { Process } from '~/store/processes/process'; +import { getProcessStatus, getProcessStatusColor } from '../../store/processes/process'; +import { formatDate } from '~/common/formatters'; -type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'chip' | 'link' | 'content' | 'title' | 'avatar' - | 'headerActive' | 'headerCompleted' | 'headerQueued' | 'headerFailed' | 'headerCanceled'; + +type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'chip' | 'link' | 'content' | 'title' | 'avatar'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ card: { - marginBottom: theme.spacing.unit * 2 + height: '100%' }, iconHeader: { fontSize: '1.875rem', @@ -57,40 +57,25 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ content: { '&:last-child': { paddingBottom: theme.spacing.unit * 2, - paddingTop: '0px' } }, title: { overflow: 'hidden', paddingTop: theme.spacing.unit * 0.5 - }, - headerActive: { - backgroundColor: theme.customs.colors.blue500, - }, - headerCompleted: { - backgroundColor: theme.customs.colors.green700, - }, - headerQueued: { - backgroundColor: theme.customs.colors.grey500, - }, - headerFailed: { - backgroundColor: theme.customs.colors.red900, - }, - headerCanceled: { - backgroundColor: theme.customs.colors.red900, - }, + } }); export interface ProcessInformationCardDataProps { - item: any; + process: Process; onContextMenu: (event: React.MouseEvent) => void; } -type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles; +type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles; -export const ProcessInformationCard = withStyles(styles)( - ({ classes, onContextMenu }: ProcessInformationCardProps) => +export const ProcessInformationCard = withStyles(styles, { withTheme: true })( + ({ classes, process, onContextMenu, theme }: ProcessInformationCardProps) => + {console.log(process)} } action={
- - onContextMenu(event)}> - - + + + onContextMenu(event)}> + + +
} title={ - - - Pipeline template that generates a config file from a template + + + {process.containerRequest.name} } - subheader="(no-description)" /> + subheader={ + + + {getDescription(process)} + + } /> + label='From' value={process.container ? formatDate(process.container.startedAt!) : 'N/A'} /> + label='To' value={process.container ? formatDate(process.container.finishedAt!) : 'N/A'} /> + label='Workflow' value='???' /> @@ -133,4 +126,7 @@ export const ProcessInformationCard = withStyles(styles)(
-); \ No newline at end of file +); + +const getDescription = (process: Process) => + process.containerRequest.description || '(no-description)';