fix(editor): Fix run index input for RunData view in sub-nodes (#11538)

This commit is contained in:
oleg
2024-11-05 16:47:45 +01:00
committed by GitHub
parent dfd785bc08
commit 434d31ce92
6 changed files with 516 additions and 90 deletions

View File

@@ -154,6 +154,29 @@ const parentNode = computed(() => {
});
const inputNodeName = computed<string | undefined>(() => {
const nodeOutputs =
activeNode.value && activeNodeType.value
? NodeHelpers.getNodeOutputs(props.workflowObject, activeNode.value, activeNodeType.value)
: [];
const nonMainOutputs = nodeOutputs.filter((output) => {
if (typeof output === 'string') return output !== NodeConnectionType.Main;
return output.type !== NodeConnectionType.Main;
});
const isSubNode = nonMainOutputs.length > 0;
if (isSubNode && activeNode.value) {
// For sub-nodes, we need to get their connected output node to determine the input
// because sub-nodes use specialized outputs (e.g. NodeConnectionType.AiTool)
// instead of the standard Main output type
const connectedOutputNode = props.workflowObject.getChildNodes(
activeNode.value.name,
'ALL_NON_MAIN',
)?.[0];
return connectedOutputNode;
}
return selectedInput.value || parentNode.value;
});