From a3ee130be36deeed85e55a84213aea561d30381f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 21 Apr 2022 11:51:53 +0200 Subject: [PATCH] Change handling of the params `showCompact` and `limit` * The editor should provide the full url in the title, to show the user the same view as in the dashboard. * In the dashboard, `limit` and now also `view` need to be removed from the title's link. The user isn't editing and should see the default view. --- library/Icinga/Web/Dashboard/Dashlet.php | 5 ++--- library/Icinga/Web/Dashboard/ItemList/DashletListItem.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Web/Dashboard/Dashlet.php b/library/Icinga/Web/Dashboard/Dashlet.php index 863455631..2c9eb54a9 100644 --- a/library/Icinga/Web/Dashboard/Dashlet.php +++ b/library/Icinga/Web/Dashboard/Dashlet.php @@ -162,12 +162,11 @@ class Dashlet extends BaseDashboard )); } else { $url = $this->getUrl(); - $url->setParam('showCompact', true); - $dashletHtml->setAttribute('data-icinga-url', $url); + $dashletHtml->setAttribute('data-icinga-url', $url->with('showCompact', true)); $dashletHtml->addHtml(new HtmlElement('h1', null, new Link( t($this->getTitle()), - $url->getUrlWithout(['showCompact', 'limit'])->getRelativeUrl(), + $url->without(['limit', 'view'])->getRelativeUrl(), [ 'aria-label' => t($this->getTitle()), 'title' => t($this->getTitle()), diff --git a/library/Icinga/Web/Dashboard/ItemList/DashletListItem.php b/library/Icinga/Web/Dashboard/ItemList/DashletListItem.php index 0f7f18692..c4fc2c054 100644 --- a/library/Icinga/Web/Dashboard/ItemList/DashletListItem.php +++ b/library/Icinga/Web/Dashboard/ItemList/DashletListItem.php @@ -67,7 +67,7 @@ class DashletListItem extends BaseHtmlElement if ($this->renderDetailActions) { $header->addHtml(new Link( t($this->dashlet->getTitle()), - $this->dashlet->getUrl()->getUrlWithout(['showCompact', 'limit'])->getRelativeUrl(), + $this->dashlet->getUrl()->getRelativeUrl(), [ 'class' => 'dashlet-title', 'aria-label' => t($this->dashlet->getTitle()),