mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix(editor): Fix route component caching, incorrect use of array reduce method and enable WF history feature (#7434)
Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
@@ -325,7 +325,7 @@ export const getLeftmostTopNode = (nodes: INodeUi[]): INodeUi => {
|
||||
}
|
||||
|
||||
return node;
|
||||
});
|
||||
}, nodes[0]);
|
||||
};
|
||||
|
||||
export const getWorkflowCorners = (nodes: INodeUi[]): IBounds => {
|
||||
@@ -949,15 +949,17 @@ export const getInputEndpointUUID = (
|
||||
export const getFixedNodesList = (workflowNodes: INode[]) => {
|
||||
const nodes = [...workflowNodes];
|
||||
|
||||
const leftmostTop = getLeftmostTopNode(nodes);
|
||||
if (nodes.length) {
|
||||
const leftmostTop = getLeftmostTopNode(nodes);
|
||||
|
||||
const diffX = DEFAULT_START_POSITION_X - leftmostTop.position[0];
|
||||
const diffY = DEFAULT_START_POSITION_Y - leftmostTop.position[1];
|
||||
const diffX = DEFAULT_START_POSITION_X - leftmostTop.position[0];
|
||||
const diffY = DEFAULT_START_POSITION_Y - leftmostTop.position[1];
|
||||
|
||||
nodes.map((node) => {
|
||||
node.position[0] += diffX + NODE_SIZE * 2;
|
||||
node.position[1] += diffY;
|
||||
});
|
||||
nodes.forEach((node) => {
|
||||
node.position[0] += diffX + NODE_SIZE * 2;
|
||||
node.position[1] += diffY;
|
||||
});
|
||||
}
|
||||
|
||||
return nodes;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user