From 4a10faeb252abf7e013119891ceb479e2b121552 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 19 May 2025 10:28:15 +0200 Subject: [PATCH] update(Dashboard custom Section & additionalRow): the additional row is not removed when moving widgets and the custom section gets also created when created user_overrides --- application/libraries/dashboard/DashboardLib.php | 2 +- public/js/components/Drop/Grid.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/application/libraries/dashboard/DashboardLib.php b/application/libraries/dashboard/DashboardLib.php index 7aab6b949..f6d7d6599 100644 --- a/application/libraries/dashboard/DashboardLib.php +++ b/application/libraries/dashboard/DashboardLib.php @@ -107,7 +107,7 @@ class DashboardLib $emptyoverride = new stdClass(); $emptyoverride->dashboard_id = $dashboard->dashboard_id; $emptyoverride->uid = $uid; - $emptyoverride->override = '{"' . self::USEROVERRIDE_SECTION . '": {"widgets":{}}}}'; + $emptyoverride->override = '{"' . self::USEROVERRIDE_SECTION . '": {"widgets":{}}, "custom": { "widgets" : {}}}'; return $emptyoverride; } diff --git a/public/js/components/Drop/Grid.js b/public/js/components/Drop/Grid.js index fe39a07d2..55b9b1bbd 100644 --- a/public/js/components/Drop/Grid.js +++ b/public/js/components/Drop/Grid.js @@ -128,7 +128,11 @@ export default { return [...this.placedItems, ...this.items_placeholders]; }, rows() { - if ((this.mode == MODE_MOVE || this.mode == MODE_RESIZE) && this.dragGrid){ + if (this.additionalRowComputed) { + return this.grid ? (this.grid.h+1) : 1; + } + return this.grid ? this.grid.h : 1; + /* if ((this.mode == MODE_MOVE || this.mode == MODE_RESIZE) && this.dragGrid){ return this.dragGrid.h; } if (this.mode == MODE_IDLE) { @@ -136,7 +140,7 @@ export default { return this.grid ? (this.grid.h+1) : 1; } } - return this.grid ? this.grid.h : 1; + return this.grid ? this.grid.h : 1; */ }, gridStyle() { const addH = this.active ? this.marginForExtraRow : 0;