From bed531f5fba0eeafa2193faec51531cda81a704b Mon Sep 17 00:00:00 2001 From: Ivan Ortega Alba Date: Wed, 14 Sep 2022 14:33:03 +0200 Subject: [PATCH] Panel: Disable legends when showLegend is false prior to schema v37 (#55126) --- public/app/features/dashboard/state/DashboardMigrator.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/state/DashboardMigrator.ts b/public/app/features/dashboard/state/DashboardMigrator.ts index 0c467d8bdf1..98a02990e15 100644 --- a/public/app/features/dashboard/state/DashboardMigrator.ts +++ b/public/app/features/dashboard/state/DashboardMigrator.ts @@ -793,7 +793,11 @@ export class DashboardMigrator { if (oldVersion < 37) { panelUpgrades.push((panel: PanelModel) => { - if (panel.options?.legend && panel.options.legend.displayMode === 'hidden') { + if ( + panel.options?.legend && + // There were two ways to hide the legend, this normalizes to `legend.showLegend` + (panel.options.legend.displayMode === 'hidden' || panel.options.legend.showLegend === false) + ) { panel.options.legend.displayMode = 'list'; panel.options.legend.showLegend = false; } else if (panel.options?.legend) {