From 6fc2a6694954f2ce9e220dd3f3156fb46cd33eb0 Mon Sep 17 00:00:00 2001 From: burnettk Date: Fri, 25 Nov 2022 00:30:01 -0500 Subject: [PATCH] use process model display name rather than id for completed instances tab --- .../components/ProcessInstanceListTable.tsx | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx index 78b67aaa..5266c89b 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx @@ -47,6 +47,7 @@ import { PaginationObject, ProcessModel, ProcessInstanceReport, + ProcessInstance, } from '../interfaces'; import ProcessModelSearch from './ProcessModelSearch'; import ProcessInstanceReportSearch from './ProcessInstanceReportSearch'; @@ -609,6 +610,7 @@ export default function ProcessInstanceListTable({ const headerLabels: Record = { id: 'Id', process_model_identifier: 'Process', + process_model_display_name: 'Process', start_in_seconds: 'Start Time', end_in_seconds: 'End Time', status: 'Status', @@ -622,13 +624,14 @@ export default function ProcessInstanceListTable({ return getHeaderLabel((column as any).Header); }); - const formatProcessInstanceId = (row: any, id: any) => { + const formatProcessInstanceId = (row: ProcessInstance, id: number) => { const modifiedProcessModelId: String = modifyProcessIdentifierForPathParam(row.process_model_identifier); return ( {id} @@ -645,6 +648,23 @@ export default function ProcessInstanceListTable({ ); }; + + const formatProcessModelDisplayName = ( + row: ProcessInstance, + displayName: string + ) => { + return ( + + {displayName} + + ); + }; + const formatSecondsForDisplay = (_row: any, seconds: any) => { return convertSecondsToFormattedDateTime(seconds) || '-'; }; @@ -655,6 +675,7 @@ export default function ProcessInstanceListTable({ const columnFormatters: Record = { id: formatProcessInstanceId, process_model_identifier: formatProcessModelIdentifier, + process_model_display_name: formatProcessModelDisplayName, start_in_seconds: formatSecondsForDisplay, end_in_seconds: formatSecondsForDisplay, };