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( $this->tabs->add(
$pane->getName(), $pane->getName(),
[ [
'title' => sprintf( 'active' => $pane->isActive(),
t('Show %s', 'dashboard.pane.tooltip'), 'title' => sprintf(t('Show %s', 'dashboard.pane.tooltip'), $pane->getTitle()),
$pane->getTitle()
),
'label' => $pane->getTitle(), 'label' => $pane->getTitle(),
'url' => clone($url), 'url' => clone($url),
'urlParams' => [$this->tabParam => $pane->getName()] 'urlParams' => [$this->tabParam => $pane->getName()]

View File

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