From 1e520ddfa896f1eac6fea881b4712a6f54787957 Mon Sep 17 00:00:00 2001 From: Marek Libra Date: Sun, 6 Oct 2024 12:48:55 +0200 Subject: [PATCH] feat(orchestrator): add Variables card (#2305) A temporary solution till we have proper Input Parameters card (tracked in FLPATH-1736) Fixes: FLPATH-1737 --- .../WorkflowInstancePageContent.tsx | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/plugins/orchestrator/src/components/WorkflowInstancePageContent.tsx b/plugins/orchestrator/src/components/WorkflowInstancePageContent.tsx index 7e5c2fcb78..2f45b3857b 100644 --- a/plugins/orchestrator/src/components/WorkflowInstancePageContent.tsx +++ b/plugins/orchestrator/src/components/WorkflowInstancePageContent.tsx @@ -16,6 +16,7 @@ import { WorkflowProgress } from './WorkflowProgress'; import { WorkflowResult } from './WorkflowResult'; import { WorkflowRunDetail } from './WorkflowRunDetail'; import { WorkflowRunDetails } from './WorkflowRunDetails'; +import { WorkflowVariablesViewer } from './WorkflowVariablesViewer'; export const mapProcessInstanceToDetails = ( instance: ProcessInstanceDTO, @@ -48,9 +49,10 @@ const useStyles = makeStyles(_ => ({ height: '20rem', }, middleRowCard: { - height: 'calc(2 * 20rem)', + height: '20rem', }, bottomRowCard: { + minHeight: '40rem', height: '100%', }, autoOverflow: { overflow: 'auto' }, @@ -72,10 +74,22 @@ export const WorkflowInstancePageContent: React.FC<{ [assessedInstance.instance], ); + const workflowdata = assessedInstance.instance?.workflowdata; + let instanceVariables; + if (workflowdata) { + instanceVariables = { + /* Since we are about to remove just the top-level property, shallow copy of the object is sufficient */ + ...workflowdata, + }; + if (instanceVariables.hasOwnProperty('result')) { + delete instanceVariables.result; + } + } + return ( - + + + + + {instanceVariables && ( + + )} + {!instanceVariables && ( +
The workflow instance has no variables
+ )} +
+
@@ -102,7 +129,7 @@ export const WorkflowInstancePageContent: React.FC<{