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.
This commit is contained in:
Johannes Meyer 2022-04-21 11:51:53 +02:00 committed by Yonas Habteab
parent 7f0197333f
commit c96da1da98
2 changed files with 3 additions and 4 deletions

View File

@ -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()),

View File

@ -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()),