Scene: Set maxDataPoints for dashboard scene query runners (#63772)

This commit is contained in:
Torkel Ödegaard authored and GitHub committed 2023-03-06 11:00:47 +01:00
1 parent 4bf23b7f5f
commit 95bd79ef4b
2 files changed
+3

No files matched your search

@@ -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
);
@@ -266,6 +266,7 @@ export function createVizPanelFromPanelModel(panel: PanelModel) {
$data: new SceneQueryRunner({
transformations: panel.transformations,
queries: panel.targets,
maxDataPoints: panel.maxDataPoints ?? undefined,
}),
});
}