[v11.0.x] Fix sending maxDataPoints as string (#85572)

Fix sending `maxDataPoints` as string (#85561)

* make sure maxDataPoints is a number

* add migration for maxDataPoints

* remove migration

(cherry picked from commit 9c0f9f6ba4)

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-04-04 12:27:47 +03:00
committed by GitHub
co-authored by ismail simsek
parent f756620df0
commit da4ae285b4
@@ -17,6 +17,13 @@ export function initPanelState(panel: PanelModel): ThunkResult<Promise<void>> {
return;
}
// Some old panels, somehow have maxDataPoints value as string.
// This is causing problems on the backend-side.
// Here we make sure maxDataPoints is always as number.
if (panel.maxDataPoints) {
panel.maxDataPoints = Number(panel.maxDataPoints);
}
let pluginToLoad = panel.type;
let plugin = getStore().plugins.panels[pluginToLoad];