diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx index 279322a63..41168bdfe 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx @@ -44,6 +44,7 @@ import { PermissionsToCheck, ProcessData, ProcessInstance, + ProcessInstanceMetadata, ProcessInstanceTask, } from '../interfaces'; import { usePermissionFetcher } from '../hooks/PermissionService'; @@ -74,6 +75,8 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { const [eventTextEditorEnabled, setEventTextEditorEnabled] = useState(false); const [displayDetails, setDisplayDetails] = useState(false); + const [showProcessInstanceMetadata, setShowProcessInstanceMetadata] = + useState(false); const setErrorObject = (useContext as any)(ErrorContext)[1]; @@ -446,6 +449,19 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { Messages + {processInstance.process_metadata && + processInstance.process_metadata.length > 0 ? ( + + ) : null} @@ -903,6 +919,41 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { ); }; + const processInstanceMetadataArea = () => { + if ( + !processInstance || + (processInstance.process_metadata && + processInstance.process_metadata.length < 1) + ) { + return null; + } + const metadataComponents: any[] = []; + (processInstance.process_metadata || []).forEach( + (processInstanceMetadata: ProcessInstanceMetadata) => { + metadataComponents.push( + + + {processInstanceMetadata.key} + + + {processInstanceMetadata.value} + + + ); + } + ); + return ( + setShowProcessInstanceMetadata(false)} + > + {metadataComponents} + + ); + }; + const taskUpdateDisplayArea = () => { const taskToUse: any = { ...taskToDisplay, data: taskDataToDisplay }; const candidateEvents: any = getEvents(taskToUse); @@ -1034,6 +1085,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
{taskUpdateDisplayArea()} {processDataDisplayArea()} + {processInstanceMetadataArea()} {stepsElement()}