fix(editor): Nodes in disabled state appear in the logs (no-changelog) (#15054)

This commit is contained in:
Suguru Inoue
2025-05-02 13:24:23 +02:00
committed by GitHub
parent 20834abb56
commit a4290dcb78
5 changed files with 43 additions and 5 deletions

View File

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

View File

@@ -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, () => {

View File

@@ -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) {