From 79948bd899be98f872443d265828eeca1788c07b Mon Sep 17 00:00:00 2001 From: Jan Fiedler Date: Mon, 8 Apr 2024 17:49:52 +0200 Subject: [PATCH] update createExecutionArray Signed-off-by: Jan Fiedler --- .../createExecutionArray.tsx | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/oss-console/src/components/Executions/contextProvider/NodeExecutionDetails/createExecutionArray.tsx b/packages/oss-console/src/components/Executions/contextProvider/NodeExecutionDetails/createExecutionArray.tsx index 0dbbc321b..549b8ecf6 100644 --- a/packages/oss-console/src/components/Executions/contextProvider/NodeExecutionDetails/createExecutionArray.tsx +++ b/packages/oss-console/src/components/Executions/contextProvider/NodeExecutionDetails/createExecutionArray.tsx @@ -7,6 +7,7 @@ import { Identifier } from '../../../../models/Common/types'; import { CompiledTask } from '../../../../models/Task/types'; import { dNode } from '../../../../models/Graph/types'; import { isEndNode, isStartNode } from '../../../../models/Node/utils'; +import { getTaskTypeFromCompiledNode } from '../../../WorkflowGraph/utils'; interface NodeExecutionInfo extends NodeExecutionDetails { scopedId?: string; @@ -104,6 +105,16 @@ export const getNodeDetails = ( }; } + if (compiledNode?.arrayNode) { + returnVal = { + ...returnVal, + displayType: + returnVal.displayType !== NodeExecutionDisplayType.Unknown + ? returnVal.displayType + : NodeExecutionDisplayType.ArrayNode, + }; + } + return returnVal; }; @@ -119,6 +130,13 @@ export const getNodeDetailsFromTask = (node: dNode, task?: CompiledTask): NodeEx displayType: taskType ?? NodeExecutionDisplayType.Unknown, }; + if (node.value?.arrayNode) { + returnVal = { + ...returnVal, + displayType: NodeExecutionDisplayType.ArrayNode, + }; + } + if (node.value?.workflowNode) { const { workflowNode } = node.value; const info = workflowNode.launchplanRef ?? workflowNode.subWorkflowRef; @@ -160,7 +178,7 @@ export const getNodeExecutionDetails = ( node: dNode, tasks: CompiledTask[] = [], ): NodeExecutionInfo => { - const templateName = node?.value?.taskNode?.referenceId?.name ?? node.name; - const task = tasks.find((t) => t.template.id.name === templateName); + const taskNode = node?.value?.arrayNode?.node?.taskNode || node?.value?.taskNode; + const task = getTaskTypeFromCompiledNode(taskNode!, tasks); return getNodeDetailsFromTask(node, task); };