mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Nodes in disabled state appear in the logs (no-changelog) (#15054)
This commit is contained in:
@@ -37,7 +37,10 @@ const runDataProps = computed<
|
||||
}
|
||||
|
||||
return {
|
||||
node,
|
||||
node: {
|
||||
...node,
|
||||
disabled: false, // For RunData component to render data from disabled nodes as well
|
||||
},
|
||||
runIndex: source.previousNodeRun ?? 0,
|
||||
overrideOutputs: [source.previousNodeOutput ?? 0],
|
||||
};
|
||||
|
||||
@@ -609,6 +609,19 @@ describe(createLogEntries, () => {
|
||||
}),
|
||||
]);
|
||||
});
|
||||
|
||||
it('should not include runs for disabled nodes', () => {
|
||||
const workflow = createTestWorkflowObject({
|
||||
nodes: [createTestNode({ name: 'A' }), createTestNode({ name: 'B', disabled: true })],
|
||||
connections: {
|
||||
A: { main: [[{ node: 'B', type: NodeConnectionTypes.Main, index: 0 }]] },
|
||||
},
|
||||
});
|
||||
|
||||
expect(
|
||||
createLogEntries(workflow, { A: [createTestTaskData()], B: [createTestTaskData()] }),
|
||||
).toEqual([expect.objectContaining({ node: expect.objectContaining({ name: 'A' }) })]);
|
||||
});
|
||||
});
|
||||
|
||||
describe(deepToRaw, () => {
|
||||
|
||||
@@ -383,9 +383,11 @@ function findLogEntryToAutoSelectRec(
|
||||
|
||||
export function createLogEntries(workflow: Workflow, runData: IRunData) {
|
||||
const runs = Object.entries(runData)
|
||||
.filter(([nodeName]) => workflow.getChildNodes(nodeName, 'ALL_NON_MAIN').length === 0)
|
||||
.flatMap(([nodeName, taskData]) =>
|
||||
taskData.map((task, runIndex) => ({ nodeName, task, runIndex })),
|
||||
workflow.getChildNodes(nodeName, 'ALL_NON_MAIN').length > 0 ||
|
||||
workflow.getNode(nodeName)?.disabled
|
||||
? [] // skip sub nodes and disabled nodes
|
||||
: taskData.map((task, runIndex) => ({ nodeName, task, runIndex })),
|
||||
)
|
||||
.sort((a, b) => {
|
||||
if (a.task.executionIndex !== undefined && b.task.executionIndex !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user