fix: More hints to nodes - regression for sub nodes (no-changelog) (#10690)

This commit is contained in:
Michael Kret 2024-09-05 19:54:36 +03:00 committed by GitHub
parent 1dea8f4c7d
commit 37a808896e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {