From e4c92483dcba94625a16bc9a7a2bdaa74b3dceb5 Mon Sep 17 00:00:00 2001 From: Ihor Yeromin Date: Wed, 3 Apr 2024 19:29:17 +0300 Subject: [PATCH] Canvas: Fix ellipse migration (#85482) * fix(canvas): ellips migration --- public/app/plugins/panel/canvas/migrations.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/public/app/plugins/panel/canvas/migrations.ts b/public/app/plugins/panel/canvas/migrations.ts index 5d0d92271e6..21e8122c884 100644 --- a/public/app/plugins/panel/canvas/migrations.ts +++ b/public/app/plugins/panel/canvas/migrations.ts @@ -25,14 +25,18 @@ export const canvasMigrationHandler = (panel: PanelModel): Partial => { for (const element of root.elements) { if (element.type === 'ellipse') { // Take existing ellipse specific background and border config and apply it to the element's general background and border config - element.background = element.config.backgroundColor; - element.border.color = element.config.borderColor; - element.border.width = element.config.width; - - // Remove the ellipse specific background and border config - delete element.config.backgroundColor; - delete element.config.borderColor; - delete element.config.width; + if (element.config.backgroundColor) { + element.background = element.config.backgroundColor; + delete element.config.backgroundColor; + } + if (element.config.borderColor) { + element.border.color = element.config.borderColor; + delete element.config.borderColor; + } + if (element.config.width) { + element.border.width = element.config.width; + delete element.config.width; + } } } }