diff --git a/application/libraries/dashboard/DashboardLib.php b/application/libraries/dashboard/DashboardLib.php index edea7c310..d411bfcfc 100644 --- a/application/libraries/dashboard/DashboardLib.php +++ b/application/libraries/dashboard/DashboardLib.php @@ -53,7 +53,6 @@ class DashboardLib $userconfig = $this->getUserConfig($dashboard_id, $uid); $mergedconfig = array_replace_recursive($defaultconfig, $userconfig); - return $mergedconfig; } @@ -209,18 +208,19 @@ class DashboardLib if (!isset($widgets[$section]) || !is_array($widgets[$section])) { $widgets[$section] = array(); + $widgets[$section]["widgets"] = array(); } - $widgets[$section][$widgetid] = $widget; + $widgets[$section]["widgets"][$widgetid] = $widget; } public function removeWidgetFromWidgets(&$widgets, $section, $widgetid) { $section = ($section !== null) ? $section : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL; - if (isset($widgets[$section]) && isset($widgets[$section][$widgetid])) + if (isset($widgets[$section]["widgets"]) && isset($widgets[$section]["widgets"][$widgetid])) { - unset($widgets[$section][$widgetid]); - if(empty($widgets[$section]) && $section !== self::USEROVERRIDE_SECTION) { + unset($widgets[$section]["widgets"][$widgetid]); + if(empty($widgets[$section]["widgets"]) && $section !== self::USEROVERRIDE_SECTION) { unset($widgets[$section]); } return true; diff --git a/public/js/components/Dashboard/Dashboard.js b/public/js/components/Dashboard/Dashboard.js index e6f26d169..c682d78c6 100644 --- a/public/js/components/Dashboard/Dashboard.js +++ b/public/js/components/Dashboard/Dashboard.js @@ -162,15 +162,16 @@ export default { for (var name in res.data.retval.widgets) { let widgets = []; let remove = []; - for (var wid in res.data.retval.widgets[name]) { - res.data.retval.widgets[name][wid].id = wid; - if (res.data.retval.widgets[name][wid].custom || res.data.retval.widgets[name][wid].preset) - widgets.push(res.data.retval.widgets[name][wid]); + for (var wid in res.data.retval.widgets[name].widgets) { + res.data.retval.widgets[name].widgets[wid].id = wid; + if (res.data.retval.widgets[name].widgets[wid].custom || res.data.retval.widgets[name].widgets[wid].preset) + widgets.push(res.data.retval.widgets[name].widgets[wid]); else remove.push(wid); } this.sections.push({ name: name, + description:res.data.retval.widgets[name].description, widgets: widgets }); remove.forEach(wid => this.widgetRemove(name, wid)); @@ -189,7 +190,7 @@ export default { {{ $p.t('global/personalGreeting', [ viewDataInternal?.name ]) }} - + ` } diff --git a/public/js/components/Dashboard/Section.js b/public/js/components/Dashboard/Section.js index 4a2a4eaaa..9ccb729df 100644 --- a/public/js/components/Dashboard/Section.js +++ b/public/js/components/Dashboard/Section.js @@ -28,7 +28,8 @@ export default { }, props: [ "name", - "widgets" + "widgets", + "description" ], emits: [ "widgetAdd", @@ -85,7 +86,7 @@ export default { if(!item?.widgetid && item?.id){ item.widgetid = item.id; } - return { ...item, reorder: false, ...(item.place[this.gridWidth] || { reorder: true, ...{ x: 0, y: 0, w: 1, h: 1 } })}; + return { ...item, ...(item.place[this.gridWidth] || { x: 0, y: 0, w: 1, h: 1 } )}; }); return placedItems; @@ -94,7 +95,7 @@ export default { }, methods: { showSectionInformation(){ - SectionModal.popup(`this is the information for the section ${name}`); + SectionModal.popup(this.description); }, handleConfigOpened() { this.configOpened = true @@ -188,11 +189,11 @@ export default { }); }, template: ` -

+

{{name}}:

-
+