Always load dashlets for all of the dashboard pane & activate only the given| the first one

This commit is contained in:
Yonas Habteab 2022-06-03 16:48:55 +02:00
parent 56bfe76a84
commit a118831b38
2 changed files with 3 additions and 6 deletions

View File

@ -136,10 +136,8 @@ class Dashboard extends BaseHtmlElement implements DashboardEntry
$this->tabs->add(
$pane->getName(),
[
'title' => sprintf(
t('Show %s', 'dashboard.pane.tooltip'),
$pane->getTitle()
),
'active' => $pane->isActive(),
'title' => sprintf(t('Show %s', 'dashboard.pane.tooltip'), $pane->getTitle()),
'label' => $pane->getTitle(),
'url' => clone($url),
'urlParams' => [$this->tabParam => $pane->getName()]

View File

@ -164,6 +164,7 @@ class DashboardHome extends BaseDashboard implements Sortable
->setPriority($pane->priority);
$this->addEntry($newPane);
$newPane->loadDashboardEntries();
}
if ($name !== null) {
@ -171,13 +172,11 @@ class DashboardHome extends BaseDashboard implements Sortable
$pane = $this->getEntry($name);
$this->activatePane($pane);
$pane->loadDashboardEntries();
} else {
throw new HttpNotFoundException(t('Pane "%s" not found'), $name);
}
} elseif (($firstPane = $this->rewindEntries())) {
$this->activatePane($firstPane);
$firstPane->loadDashboardEntries();
}
return $this;