mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Indicate dirty nodes with yellow borders/connectors on canvas (#13040)
This commit is contained in:
@@ -117,7 +117,9 @@ export class Workflow {
|
||||
this.connectionsBySourceNode = parameters.connections;
|
||||
|
||||
// Save also the connections by the destination nodes
|
||||
this.connectionsByDestinationNode = this.__getConnectionsByDestination(parameters.connections);
|
||||
this.connectionsByDestinationNode = Workflow.getConnectionsByDestination(
|
||||
parameters.connections,
|
||||
);
|
||||
|
||||
this.active = parameters.active || false;
|
||||
|
||||
@@ -143,7 +145,7 @@ export class Workflow {
|
||||
* to easily find parent nodes.
|
||||
*
|
||||
*/
|
||||
__getConnectionsByDestination(connections: IConnections): IConnections {
|
||||
static getConnectionsByDestination(connections: IConnections): IConnections {
|
||||
const returnConnection: IConnections = {};
|
||||
|
||||
let connectionInfo;
|
||||
@@ -446,7 +448,7 @@ export class Workflow {
|
||||
}
|
||||
|
||||
// Use the updated connections to create updated connections by destination nodes
|
||||
this.connectionsByDestinationNode = this.__getConnectionsByDestination(
|
||||
this.connectionsByDestinationNode = Workflow.getConnectionsByDestination(
|
||||
this.connectionsBySourceNode,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import type {
|
||||
INode,
|
||||
INodeExecutionData,
|
||||
INodeParameters,
|
||||
INodeTypes,
|
||||
IRunExecutionData,
|
||||
NodeParameterValueType,
|
||||
} from '@/Interfaces';
|
||||
@@ -1871,16 +1870,9 @@ describe('Workflow', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('__getConnectionsByDestination', () => {
|
||||
describe('getConnectionsByDestination', () => {
|
||||
it('should return empty object when there are no connections', () => {
|
||||
const workflow = new Workflow({
|
||||
nodes: [],
|
||||
connections: {},
|
||||
active: false,
|
||||
nodeTypes: mock<INodeTypes>(),
|
||||
});
|
||||
|
||||
const result = workflow.__getConnectionsByDestination({});
|
||||
const result = Workflow.getConnectionsByDestination({});
|
||||
|
||||
expect(result).toEqual({});
|
||||
});
|
||||
@@ -1896,13 +1888,7 @@ describe('Workflow', () => {
|
||||
],
|
||||
},
|
||||
};
|
||||
const workflow = new Workflow({
|
||||
nodes: [],
|
||||
connections,
|
||||
active: false,
|
||||
nodeTypes: mock<INodeTypes>(),
|
||||
});
|
||||
const result = workflow.__getConnectionsByDestination(connections);
|
||||
const result = Workflow.getConnectionsByDestination(connections);
|
||||
expect(result).toEqual({
|
||||
Node2: {
|
||||
[NodeConnectionType.Main]: [[{ node: 'Node1', type: NodeConnectionType.Main, index: 0 }]],
|
||||
@@ -1926,14 +1912,7 @@ describe('Workflow', () => {
|
||||
},
|
||||
};
|
||||
|
||||
const workflow = new Workflow({
|
||||
nodes: [],
|
||||
connections,
|
||||
active: false,
|
||||
nodeTypes: mock<INodeTypes>(),
|
||||
});
|
||||
|
||||
const result = workflow.__getConnectionsByDestination(connections);
|
||||
const result = Workflow.getConnectionsByDestination(connections);
|
||||
expect(result).toEqual({
|
||||
Node2: {
|
||||
[NodeConnectionType.Main]: [[{ node: 'Node1', type: NodeConnectionType.Main, index: 0 }]],
|
||||
@@ -1953,14 +1932,7 @@ describe('Workflow', () => {
|
||||
},
|
||||
};
|
||||
|
||||
const workflow = new Workflow({
|
||||
nodes: [],
|
||||
connections,
|
||||
active: false,
|
||||
nodeTypes: mock<INodeTypes>(),
|
||||
});
|
||||
|
||||
const result = workflow.__getConnectionsByDestination(connections);
|
||||
const result = Workflow.getConnectionsByDestination(connections);
|
||||
expect(result).toEqual({});
|
||||
});
|
||||
|
||||
@@ -1975,14 +1947,7 @@ describe('Workflow', () => {
|
||||
},
|
||||
};
|
||||
|
||||
const workflow = new Workflow({
|
||||
nodes: [],
|
||||
connections,
|
||||
active: false,
|
||||
nodeTypes: mock<INodeTypes>(),
|
||||
});
|
||||
|
||||
const result = workflow.__getConnectionsByDestination(connections);
|
||||
const result = Workflow.getConnectionsByDestination(connections);
|
||||
expect(result).toEqual({
|
||||
Node2: {
|
||||
[NodeConnectionType.Main]: [[{ node: 'Node1', type: NodeConnectionType.Main, index: 1 }]],
|
||||
@@ -2000,14 +1965,7 @@ describe('Workflow', () => {
|
||||
},
|
||||
};
|
||||
|
||||
const workflow = new Workflow({
|
||||
nodes: [],
|
||||
connections,
|
||||
active: false,
|
||||
nodeTypes: mock<INodeTypes>(),
|
||||
});
|
||||
|
||||
const result = workflow.__getConnectionsByDestination(connections);
|
||||
const result = Workflow.getConnectionsByDestination(connections);
|
||||
expect(result).toEqual({
|
||||
Node2: {
|
||||
[NodeConnectionType.Main]: [
|
||||
|
||||
Reference in New Issue
Block a user