X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/fc3d9ac09fbb1cdc4fb4b00f2f704795ad365110..a1be48a39f8904c2fed157a676ccfec3f43f4b8b:/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 f2379ed8..7f3e025f 100644 --- a/src/views/process-panel/process-information-card.tsx +++ b/src/views/process-panel/process-information-card.tsx @@ -10,15 +10,16 @@ import { import { ArvadosTheme } from '~/common/custom-theme'; import { MoreOptionsIcon, ProcessIcon } from '~/components/icon/icon'; import { DetailsAttribute } from '~/components/details-attribute/details-attribute'; -import { Process, getProcessStatusColor } from '~/store/processes/process'; -import { getProcessStatus } from '~/store/processes/process'; +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'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ card: { - marginBottom: theme.spacing.unit * 2 + height: '100%' }, iconHeader: { fontSize: '1.875rem', @@ -56,7 +57,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ content: { '&:last-child': { paddingBottom: theme.spacing.unit * 2, - paddingTop: '0px' } }, title: { @@ -68,12 +68,14 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ export interface ProcessInformationCardDataProps { process: Process; onContextMenu: (event: React.MouseEvent) => void; + openProcessInputDialog: (uuid: string) => void; + navigateToOutput: (uuid: string) => void; } -type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles; +type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles; export const ProcessInformationCard = withStyles(styles, { withTheme: true })( - ({ classes, process, onContextMenu, theme }: ProcessInformationCardProps) => + ({ classes, process, onContextMenu, theme, openProcessInputDialog, navigateToOutput }: ProcessInformationCardProps) => - onContextMenu(event)}> - - + className={classes.chip} + style={{ backgroundColor: getProcessStatusColor(getProcessStatus(process), theme as ArvadosTheme) }} /> + + onContextMenu(event)}> + + + } title={ - - - {process.containerRequest.name} + + + {process.containerRequest.name} } - subheader={process.containerRequest.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'} /> - - + navigateToOutput(process.containerRequest.outputUuid!)}> + + + openProcessInputDialog(process.containerRequest.uuid)}> + + -); \ No newline at end of file +); + +const getDescription = (process: Process) => + process.containerRequest.description || '(no-description)';