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

This commit is contained in:
Torkel Ödegaard 2023-03-06 11:00:47 +01:00 committed by GitHub
parent 4bf23b7f5f
commit 95bd79ef4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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
);

View File

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