mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 12:19:09 +00:00
feat(editor): Auto-add LLM chain for new LLM nodes on empty canvas (#10245)
Co-authored-by: JP van Oosten <jp@n8n.io>
This commit is contained in:
@@ -610,7 +610,7 @@ export default defineComponent({
|
||||
return this.workflowsStore.getWorkflowExecution;
|
||||
},
|
||||
workflowRunning(): boolean {
|
||||
return this.uiStore.isActionActive['workflowRunning'];
|
||||
return this.uiStore.isActionActive.workflowRunning;
|
||||
},
|
||||
currentWorkflow(): string {
|
||||
return this.$route.params.name?.toString() || this.workflowsStore.workflowId;
|
||||
@@ -4428,7 +4428,7 @@ export default defineComponent({
|
||||
from.outputIndex ?? 0,
|
||||
toNode.name,
|
||||
to.inputIndex ?? 0,
|
||||
NodeConnectionType.Main,
|
||||
from.type ?? NodeConnectionType.Main,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4449,6 +4449,22 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
|
||||
const lastNodeType = this.nodeTypesStore.getNodeType(lastAddedNode.type);
|
||||
const isSubNode = NodeHelpers.isSubNodeType(lastNodeType);
|
||||
|
||||
// When adding a sub-node and there's more than one node added at the time, it must mean that it's
|
||||
// connected to a root node, so we adjust the position of the sub-node to make it appear in the correct
|
||||
// in relation to the root node
|
||||
if (isSubNode && nodes.length > 1) {
|
||||
this.onMoveNode({
|
||||
nodeName: lastAddedNode.name,
|
||||
position: [
|
||||
lastAddedNode.position[0] - NodeViewUtils.NODE_SIZE * 2.5,
|
||||
lastAddedNode.position[1] + NodeViewUtils.NODE_SIZE * 1.5,
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
this.nodeHelpers.addPinDataConnections(this.workflowsStore.pinnedWorkflowData);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user