Canvas: Fix ellipse migration (#85482)

* fix(canvas): ellips migration
This commit is contained in:
Ihor Yeromin 2024-04-03 19:29:17 +03:00 committed by GitHub
parent a5707788ba
commit e4c92483dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,14 +25,18 @@ export const canvasMigrationHandler = (panel: PanelModel): Partial<Options> => {
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;
}
}
}
}