Merge pull request #11539 from vvlladd28/bug/dashboard/manage-layout/not-correct-apply-change-colums

Fixed incorrect application of column size changes in dashboard settings
This commit is contained in:
Igor Kulikov 2024-09-03 17:07:51 +03:00 committed by GitHub
commit 9e988fdb6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -921,7 +921,10 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
let gridSettings: GridSettings = null; let gridSettings: GridSettings = null;
const layoutKeys = this.dashboardUtils.isSingleLayoutDashboard(this.dashboard); const layoutKeys = this.dashboardUtils.isSingleLayoutDashboard(this.dashboard);
if (layoutKeys) { if (layoutKeys) {
gridSettings = deepClone(this.dashboard.configuration.states[layoutKeys.state].layouts[layoutKeys.layout].gridSettings); const layouts = this.dashboardUtils.getDashboardLayoutConfig(
this.dashboard.configuration.states[layoutKeys.state].layouts[layoutKeys.layout],
this.layouts[layoutKeys.layout].layoutCtx.breakpoint);
gridSettings = deepClone(layouts.gridSettings);
} }
this.dialog.open<DashboardSettingsDialogComponent, DashboardSettingsDialogData, this.dialog.open<DashboardSettingsDialogComponent, DashboardSettingsDialogData,
DashboardSettingsDialogData>(DashboardSettingsDialogComponent, { DashboardSettingsDialogData>(DashboardSettingsDialogComponent, {
@ -939,9 +942,11 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
this.updateDashboardCss(); this.updateDashboardCss();
const newGridSettings = data.gridSettings; const newGridSettings = data.gridSettings;
if (newGridSettings) { if (newGridSettings) {
const layout = this.dashboard.configuration.states[layoutKeys.state].layouts[layoutKeys.layout]; const layouts = deepClone(this.dashboard.configuration.states[layoutKeys.state].layouts);
this.dashboardUtils.updateLayoutSettings(layout, newGridSettings); const layoutConfig = this.dashboardUtils.getDashboardLayoutConfig(
this.updateLayouts(); layouts[layoutKeys.layout], this.layouts[layoutKeys.layout].layoutCtx.breakpoint);
this.dashboardUtils.updateLayoutSettings(layoutConfig, newGridSettings);
this.updateDashboardLayouts(layouts);
} }
} }
}); });