From 2c8a2efbe5bac7df0a13a17ed773102d95fd1111 Mon Sep 17 00:00:00 2001 From: Pawel Kromplewski Date: Tue, 18 Dec 2018 08:17:18 +0100 Subject: [PATCH] PR fixes, extract format start and finished dates Feature #14434 Arvados-DCO-1.1-Signed-off-by: Pawel Kromplewski --- src/common/formatters.ts | 2 +- .../process-information-card.tsx | 34 +++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/common/formatters.ts b/src/common/formatters.ts index ae50ee8a..60e6cd59 100644 --- a/src/common/formatters.ts +++ b/src/common/formatters.ts @@ -4,7 +4,7 @@ import { PropertyValue } from "~/models/search-bar"; -export const formatDate = (isoDate?: string) => { +export const formatDate = (isoDate?: string | null) => { if (isoDate) { const date = new Date(isoDate); const text = date.toLocaleString(); diff --git a/src/views/process-panel/process-information-card.tsx b/src/views/process-panel/process-information-card.tsx index 9e8b783f..52f13987 100644 --- a/src/views/process-panel/process-information-card.tsx +++ b/src/views/process-panel/process-information-card.tsx @@ -76,24 +76,27 @@ export interface ProcessInformationCardDataProps { type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles; export const ProcessInformationCard = withStyles(styles, { withTheme: true })( - ({ classes, process, onContextMenu, theme, openProcessInputDialog, navigateToOutput, navigateToWorkflow }: 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={
+ style={{backgroundColor: getProcessStatusColor(getProcessStatus(process), theme as ArvadosTheme)}}/> onContextMenu(event)}> - +
@@ -110,33 +113,34 @@ export const ProcessInformationCard = withStyles(styles, { withTheme: true })( {getDescription(process)} - } /> + }/> + value={process.container ? formatDate(startedAt) : 'N/A'}/> + value={process.container ? formatDate(finishedAt) : 'N/A'}/> {process.containerRequest.properties.templateUuid && - navigateToWorkflow(process.containerRequest.properties.templateUuid)} - />} + navigateToWorkflow(process.containerRequest.properties.templateUuid)} + />} navigateToOutput(process.containerRequest.outputUuid!)}> - + openProcessInputDialog(process.containerRequest.uuid)}> - + -
+
; + } ); const getDescription = (process: Process) => -- 2.30.2