mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Fix redo when adding node on connection (#6833)
* fix(editor): Fix redo when adding node on connection * ✅ Adding tests for pushed nodes * ✔️ Updating drag command for dragging nodes on the canvas * 👌 Handling drag end with a command option
This commit is contained in:
committed by
GitHub
parent
0ac3d47f26
commit
4ac4b850dd
@@ -1316,7 +1316,7 @@ export default defineComponent({
|
||||
const workflow = this.getCurrentWorkflow();
|
||||
const childNodes = workflow.getChildNodes(sourceNodeName);
|
||||
for (const nodeName of childNodes) {
|
||||
const node = this.workflowsStore.nodesByName[nodeName] as INodeUi;
|
||||
const node = this.workflowsStore.nodesByName[nodeName];
|
||||
const oldPosition = node.position;
|
||||
|
||||
if (node.position[0] < sourceNode.position[0]) {
|
||||
@@ -1334,11 +1334,11 @@ export default defineComponent({
|
||||
this.onNodeMoved(node);
|
||||
|
||||
if (
|
||||
(recordHistory && oldPosition[0] !== node.position[0]) ||
|
||||
oldPosition[1] !== node.position[1]
|
||||
(recordHistory && oldPosition[0] !== updateInformation.properties.position[0]) ||
|
||||
oldPosition[1] !== updateInformation.properties.position[1]
|
||||
) {
|
||||
this.historyStore.pushCommandToUndo(
|
||||
new MoveNodeCommand(nodeName, oldPosition, node.position, this),
|
||||
new MoveNodeCommand(nodeName, oldPosition, updateInformation.properties.position),
|
||||
recordHistory,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user