From 9c0f9f6ba45ef548a471bbd8bc87e2db095b8b40 Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Thu, 4 Apr 2024 11:11:18 +0200 Subject: [PATCH] Fix sending `maxDataPoints` as string (#85561) * make sure maxDataPoints is a number * add migration for maxDataPoints * remove migration --- 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];