From 5e53e6bd71b3111be5cb87a8b15aa3aa252d3544 Mon Sep 17 00:00:00 2001 From: Vladyslav Prykhodko Date: Sat, 31 Aug 2024 15:22:16 +0300 Subject: [PATCH] UI: Fixed incorrect apply change colums size in dashboard layout; added support breakpoints in dashboard settings --- .../dashboard-page/dashboard-page.component.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts index 0d379b1623..383ea173f5 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts @@ -920,7 +920,10 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC let gridSettings: GridSettings = null; const layoutKeys = this.dashboardUtils.isSingleLayoutDashboard(this.dashboard); 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, { @@ -938,9 +941,11 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC this.updateDashboardCss(); const newGridSettings = data.gridSettings; if (newGridSettings) { - const layout = this.dashboard.configuration.states[layoutKeys.state].layouts[layoutKeys.layout]; - this.dashboardUtils.updateLayoutSettings(layout, newGridSettings); - this.updateLayouts(); + const layouts = deepClone(this.dashboard.configuration.states[layoutKeys.state].layouts); + const layoutConfig = this.dashboardUtils.getDashboardLayoutConfig( + layouts[layoutKeys.layout], this.layouts[layoutKeys.layout].layoutCtx.breakpoint); + this.dashboardUtils.updateLayoutSettings(layoutConfig, newGridSettings); + this.updateDashboardLayouts(layouts); } } });