From 37a808896e93b0fdf554275c7e28392289ba2e89 Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:54:36 +0300 Subject: [PATCH] fix: More hints to nodes - regression for sub nodes (no-changelog) (#10690) --- packages/editor-ui/src/components/RunData.vue | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 8751c7035..2ccaad476 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -645,37 +645,44 @@ export default defineComponent({ return true; }, getNodeHints(): NodeHint[] { - if (this.node && this.nodeType) { - const workflowNode = this.workflow.getNode(this.node.name); + try { + if (this.node && this.nodeType) { + const workflowNode = this.workflow.getNode(this.node.name); - if (workflowNode) { - const executionHints = this.executionHints; + if (workflowNode) { + const executionHints = this.executionHints; - const nodeHints = NodeHelpers.getNodeHints(this.workflow, workflowNode, this.nodeType, { - runExecutionData: this.workflowExecution?.data ?? null, - runIndex: this.runIndex, - connectionInputData: this.parentNodeOutputData, - }); + const nodeHints = NodeHelpers.getNodeHints(this.workflow, workflowNode, this.nodeType, { + runExecutionData: this.workflowExecution?.data ?? null, + runIndex: this.runIndex, + connectionInputData: this.parentNodeOutputData, + }); - const hasMultipleInputItems = - this.parentNodeOutputData.length > 1 || this.parentNodePinnedData.length > 1; + const hasMultipleInputItems = + this.parentNodeOutputData.length > 1 || this.parentNodePinnedData.length > 1; - const nodeOutputData = - this.workflowRunData?.[this.node.name]?.[this.runIndex]?.data?.main[0] || []; + const nodeOutputData = + this.workflowRunData?.[this.node.name]?.[this.runIndex]?.data?.main?.[0] || []; - const genericHints = getGenericHints({ - workflowNode, - node: this.node, - nodeType: this.nodeType, - nodeOutputData, - workflow: this.workflow, - hasNodeRun: this.hasNodeRun, - hasMultipleInputItems, - }); + const genericHints = getGenericHints({ + workflowNode, + node: this.node, + nodeType: this.nodeType, + nodeOutputData, + workflow: this.workflow, + hasNodeRun: this.hasNodeRun, + hasMultipleInputItems, + }); - return executionHints.concat(nodeHints, genericHints).filter(this.shouldHintBeDisplayed); + return executionHints + .concat(nodeHints, genericHints) + .filter(this.shouldHintBeDisplayed); + } } + } catch (error) { + console.error('Error while getting node hints', error); } + return []; }, onItemHover(itemIndex: number | null) {