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:
Milorad FIlipović
2023-08-02 12:48:55 +02:00
committed by GitHub
parent 0ac3d47f26
commit 4ac4b850dd
3 changed files with 26 additions and 8 deletions

View File

@@ -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,
);
}