From bee7267fe38ab12a79fa4ec0e775f45d98d48aa5 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Mon, 13 Jan 2025 14:06:19 +0200 Subject: [PATCH] fix(editor): Show NDV errors when opening existing nodes with errors (#12567) --- .../src/composables/useCanvasOperations.test.ts | 12 ++++++++++++ .../editor-ui/src/composables/useCanvasOperations.ts | 1 + 2 files changed, 13 insertions(+) diff --git a/packages/editor-ui/src/composables/useCanvasOperations.test.ts b/packages/editor-ui/src/composables/useCanvasOperations.test.ts index 1d20a020e0..f0a0b11a8f 100644 --- a/packages/editor-ui/src/composables/useCanvasOperations.test.ts +++ b/packages/editor-ui/src/composables/useCanvasOperations.test.ts @@ -995,6 +995,18 @@ describe('useCanvasOperations', () => { expect(ndvStore.activeNodeName).toBe('Existing Node'); }); + + it('should set node as dirty when node is set active', () => { + const workflowsStore = mockedStore(useWorkflowsStore); + const node = createTestNode(); + + workflowsStore.getNodeById.mockImplementation(() => node); + + const { setNodeActive } = useCanvasOperations({ router }); + setNodeActive(node.id); + + expect(workflowsStore.setNodePristine).toHaveBeenCalledWith(node.name, false); + }); }); describe('setNodeActiveByName', () => { diff --git a/packages/editor-ui/src/composables/useCanvasOperations.ts b/packages/editor-ui/src/composables/useCanvasOperations.ts index 46cfc540b8..812f453c57 100644 --- a/packages/editor-ui/src/composables/useCanvasOperations.ts +++ b/packages/editor-ui/src/composables/useCanvasOperations.ts @@ -381,6 +381,7 @@ export function useCanvasOperations({ router }: { router: ReturnType