From 5022b1481ba685e211018b64510a2ff1141458c6 Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Wed, 3 Jan 2024 11:22:14 +0000 Subject: [PATCH] fix: assume typeless series nodes are of type events node (#19550) --- .../nodes/InsightQuery/utils/filtersToQueryNode.test.ts | 8 ++++++++ .../nodes/InsightQuery/utils/filtersToQueryNode.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/queries/nodes/InsightQuery/utils/filtersToQueryNode.test.ts b/frontend/src/queries/nodes/InsightQuery/utils/filtersToQueryNode.test.ts index c86915aab1d893..4a774f755a3d2d 100644 --- a/frontend/src/queries/nodes/InsightQuery/utils/filtersToQueryNode.test.ts +++ b/frontend/src/queries/nodes/InsightQuery/utils/filtersToQueryNode.test.ts @@ -72,6 +72,14 @@ describe('actionsAndEventsToSeries', () => { expect(result[1].name).toEqual('item1') expect(result[2].name).toEqual('item2') }) + + it('assumes typeless series is an event series', () => { + const events: ActionFilter[] = [{ id: '$pageview', order: 0, name: 'item1' } as any] + + const result = actionsAndEventsToSeries({ events }) + + expect(result[0].kind === NodeKind.EventsNode) + }) }) describe('cleanHiddenLegendIndexes', () => { diff --git a/frontend/src/queries/nodes/InsightQuery/utils/filtersToQueryNode.ts b/frontend/src/queries/nodes/InsightQuery/utils/filtersToQueryNode.ts index 31628318c2e7c4..75f16b6421e64f 100644 --- a/frontend/src/queries/nodes/InsightQuery/utils/filtersToQueryNode.ts +++ b/frontend/src/queries/nodes/InsightQuery/utils/filtersToQueryNode.ts @@ -73,7 +73,7 @@ export const actionsAndEventsToSeries = ({ id: f.id, ...shared, } - } else if (f.type === 'events') { + } else { return { kind: NodeKind.EventsNode, event: f.id,