From 95bd79ef4bff70dc4e5096f61724e9b8e6c1192c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 6 Mar 2023 11:00:47 +0100 Subject: [PATCH] Scene: Set maxDataPoints for dashboard scene query runners (#63772) --- public/app/features/scenes/dashboard/DashboardsLoader.test.ts | 2 ++ public/app/features/scenes/dashboard/DashboardsLoader.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/public/app/features/scenes/dashboard/DashboardsLoader.test.ts b/public/app/features/scenes/dashboard/DashboardsLoader.test.ts index 8684e5d2b3a..b6d00d4b3ed 100644 --- a/public/app/features/scenes/dashboard/DashboardsLoader.test.ts +++ b/public/app/features/scenes/dashboard/DashboardsLoader.test.ts @@ -258,6 +258,7 @@ describe('DashboardLoader', () => { title: 'test', type: 'test-plugin', gridPos: { x: 0, y: 0, w: 12, h: 8 }, + maxDataPoints: 100, options: { fieldOptions: { defaults: { @@ -301,6 +302,7 @@ describe('DashboardLoader', () => { expect(vizPanelSceneObject.state.fieldConfig).toEqual(panel.fieldConfig); expect(vizPanelSceneObject.state.pluginVersion).toBe('1.0.0'); expect((vizPanelSceneObject.state.$data as SceneQueryRunner)?.state.queries).toEqual(panel.targets); + expect((vizPanelSceneObject.state.$data as SceneQueryRunner)?.state.maxDataPoints).toEqual(100); expect((vizPanelSceneObject.state.$data as SceneQueryRunner)?.state.transformations).toEqual( panel.transformations ); diff --git a/public/app/features/scenes/dashboard/DashboardsLoader.ts b/public/app/features/scenes/dashboard/DashboardsLoader.ts index bd19241d56e..c327a7b6ac4 100644 --- a/public/app/features/scenes/dashboard/DashboardsLoader.ts +++ b/public/app/features/scenes/dashboard/DashboardsLoader.ts @@ -266,6 +266,7 @@ export function createVizPanelFromPanelModel(panel: PanelModel) { $data: new SceneQueryRunner({ transformations: panel.transformations, queries: panel.targets, + maxDataPoints: panel.maxDataPoints ?? undefined, }), }); }