X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7a8fafa13f5f94945cf0a4c5965db273f3435823..2c8a2efbe5bac7df0a13a17ed773102d95fd1111:/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 efabe22b01..52f13987d9 100644 --- a/src/views/process-panel/process-information-card.tsx +++ b/src/views/process-panel/process-information-card.tsx @@ -11,9 +11,9 @@ import { ArvadosTheme } from '~/common/custom-theme'; import { MoreOptionsIcon, ProcessIcon } from '~/components/icon/icon'; import { DetailsAttribute } from '~/components/details-attribute/details-attribute'; import { Process } from '~/store/processes/process'; -import { getProcessStatus, getProcessStatusColor } from '../../store/processes/process'; +import { getProcessStatus, getProcessStatusColor } from '~/store/processes/process'; import { formatDate } from '~/common/formatters'; - +import { openWorkflow } from "~/store/process-panel/process-panel-actions"; type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'chip' | 'link' | 'content' | 'title' | 'avatar'; @@ -68,29 +68,37 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ export interface ProcessInformationCardDataProps { process: Process; onContextMenu: (event: React.MouseEvent) => void; + openProcessInputDialog: (uuid: string) => void; + navigateToOutput: (uuid: string) => void; + navigateToWorkflow: (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, navigateToWorkflow }: ProcessInformationCardProps) => { + const { container } = process; + const startedAt = container ? formatDate(container.startedAt) : 'N/A'; + const finishedAt = container ? formatDate(container.finishedAt) : 'N/A'; + return } + avatar={} action={
- onContextMenu(event)}> - - + className={classes.chip} + style={{backgroundColor: getProcessStatusColor(getProcessStatus(process), theme as ArvadosTheme)}}/> + + onContextMenu(event)}> + + +
} title={ @@ -105,24 +113,34 @@ export const ProcessInformationCard = withStyles(styles, { withTheme: true })( {getDescription(process)} - } /> + }/> + label='From' + value={process.container ? formatDate(startedAt) : 'N/A'}/> - + label='To' + value={process.container ? formatDate(finishedAt) : 'N/A'}/> + {process.containerRequest.properties.templateUuid && + navigateToWorkflow(process.containerRequest.properties.templateUuid)} + />} - - + navigateToOutput(process.containerRequest.outputUuid!)}> + + + openProcessInputDialog(process.containerRequest.uuid)}> + + -
+
; + } ); const getDescription = (process: Process) =>