diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx index bfe543d9f..8abd54ce7 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx @@ -80,7 +80,6 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { const [eventPayload, setEventPayload] = useState('{}'); const [eventTextEditorEnabled, setEventTextEditorEnabled] = useState(false); - const [displayDetails, setDisplayDetails] = useState(false); const [showProcessInstanceMetadata, setShowProcessInstanceMetadata] = useState(false); @@ -304,92 +303,26 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { }); }; - const detailedViewElement = () => { - if (!processInstance) { - return null; - } - - if (displayDetails) { - return ( - <> - - - - - - Updated At:{' '} - - - {convertSecondsToFormattedDateTime( - processInstance.updated_at_in_seconds - )} - - - - - Created At:{' '} - - - {convertSecondsToFormattedDateTime( - processInstance.created_at_in_seconds - )} - - - - - Process model revision:{' '} - - - {processInstance.bpmn_version_control_identifier} ( - {processInstance.bpmn_version_control_type}) - - - - ); - } - return ( - - - - ); - }; - const getInfoTag = () => { if (!processInstance) { return null; } - const currentEndDate = convertSecondsToFormattedDateTime( - processInstance.end_in_seconds || 0 - ); - let currentEndDateTag; - if (currentEndDate) { - currentEndDateTag = ( - - - Completed:{' '} - - - {convertSecondsToFormattedDateTime( - processInstance.end_in_seconds || 0 - ) || 'N/A'} - - - ); + let lastUpdatedTimeLabel = 'Updated At'; + let lastUpdatedTime = processInstance.updated_at_in_seconds; + if (processInstance.end_in_seconds) { + lastUpdatedTimeLabel = 'Completed'; + lastUpdatedTime = processInstance.end_in_seconds; } + const lastUpdatedTimeTag = ( + + + {lastUpdatedTimeLabel}:{' '} + + + {convertSecondsToFormattedDateTime(lastUpdatedTime || 0) || 'N/A'} + + + ); let statusIcon = ; if (processInstance.status === 'suspended') { @@ -433,13 +366,30 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { Started:{' '} - + {convertSecondsToFormattedDateTime( processInstance.start_in_seconds || 0 )} - {currentEndDateTag} + {lastUpdatedTimeTag} + + + Process model revision:{' '} + + + {processInstance.bpmn_version_control_identifier} ( + {processInstance.bpmn_version_control_type}) + + Status:{' '} @@ -450,7 +400,6 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { - {detailedViewElement()}
@@ -493,7 +442,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { setShowProcessInstanceMetadata(true); }} > - Metadata + Details ) : null} @@ -1012,7 +961,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { return ( setShowProcessInstanceMetadata(false)} >