From da4ae285b4544d869f3688db36ed05ae73b7a281 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 12:27:47 +0300 Subject: [PATCH] [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 9c0f9f6ba45ef548a471bbd8bc87e2db095b8b40) Co-authored-by: ismail simsek --- public/app/features/panel/state/actions.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/app/features/panel/state/actions.ts b/public/app/features/panel/state/actions.ts index c326cf812ae..6bde8fc0480 100644 --- a/public/app/features/panel/state/actions.ts +++ b/public/app/features/panel/state/actions.ts @@ -17,6 +17,13 @@ export function initPanelState(panel: PanelModel): ThunkResult> { 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];