fix: Push tidy up telemetry events to posthog (no-changelog) (#14296)

This commit is contained in:
Elias Meire
2025-03-31 16:12:32 +02:00
committed by GitHub
parent d6331195b8
commit 83738bd324
2 changed files with 18 additions and 10 deletions

View File

@@ -527,11 +527,15 @@ describe('useCanvasOperations', () => {
const { tidyUp } = useCanvasOperations({ router }); const { tidyUp } = useCanvasOperations({ router });
tidyUp(event); tidyUp(event);
expect(useTelemetry().track).toHaveBeenCalledWith('User tidied up canvas', { expect(useTelemetry().track).toHaveBeenCalledWith(
nodes_count: 2, 'User tidied up canvas',
source: 'canvas-button', {
target: 'all', nodes_count: 2,
}); source: 'canvas-button',
target: 'all',
},
{ withPostHog: true },
);
}); });
}); });

View File

@@ -175,11 +175,15 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
} }
function trackTidyUp({ result, source, target }: CanvasLayoutEvent) { function trackTidyUp({ result, source, target }: CanvasLayoutEvent) {
telemetry.track('User tidied up canvas', { telemetry.track(
source, 'User tidied up canvas',
target, {
nodes_count: result.nodes.length, source,
}); target,
nodes_count: result.nodes.length,
},
{ withPostHog: true },
);
} }
function updateNodesPosition( function updateNodesPosition(