Page MenuHomePhabricator

D10181.id24489.diff
No OneTemporary

D10181.id24489.diff

diff --git a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
--- a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
+++ b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
@@ -53,11 +53,22 @@
PhabricatorSavedQuery $query,
array $handles) {
+ $dashboards = mpull($dashboards, null, 'getPHID');
$viewer = $this->requireViewer();
+ $installs = id(new PhabricatorDashboardInstall())
+ ->loadAllWhere(
+ 'objectPHID IN (%Ls) AND dashboardPHID IN (%Ls)',
+ array(PhabricatorHomeApplication::DASHBOARD_DEFAULT,
+ $viewer->getPHID()),
+ array_keys($dashboards));
+ $installs = mpull($installs, null, 'getDashboardPHID');
$list = new PHUIObjectItemListView();
$list->setUser($viewer);
- foreach ($dashboards as $dashboard) {
+ $list->initBehavior('phabricator-tooltips', array());
+ $list->requireResource('aphront-tooltip-css');
+
+ foreach ($dashboards as $dashboard_phid => $dashboard) {
$id = $dashboard->getID();
$item = id(new PHUIObjectItemView())
@@ -66,6 +77,21 @@
->setHref($this->getApplicationURI("view/{$id}/"))
->setObject($dashboard);
+ if (isset($installs[$dashboard_phid])) {
+ $install = $installs[$dashboard_phid];
+ if ($install->getObjectPHID() == $viewer->getPHID()) {
+ $attrs = array(
+ 'tip' => pht(
+ 'This dashboard is installed to your personal homepage.'));
+ $item->addIcon('fa-user', pht('Installed'), $attrs);
+ } else {
+ $attrs = array(
+ 'tip' => pht(
+ 'This dashboard is the default homepage for all users.'));
+ $item->addIcon('fa-globe', pht('Installed'), $attrs);
+ }
+ }
+
$list->addItem($item);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 13, 8:16 PM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7631488
Default Alt Text
D10181.id24489.diff (1 KB)

Event Timeline