@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add "Installed" icon to Dashboard list view.

Summary: Fixes T5478. For "personal" installs use the person icon; for global use the global icon. For both providing explanatory tooltip text about what's going on. This will need to be updated if / when we start installing dashboards to other applications. Also, this query isn't 100% optimized but the major part *is* so I think its okay.

Test Plan: Installed a dashboard for personal use and verified correct icon / text showed up. Did the same for global installed dashboard...!

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5478

Differential Revision: https://secure.phabricator.com/D10181

+27 -1
+27 -1
src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
··· 53 53 PhabricatorSavedQuery $query, 54 54 array $handles) { 55 55 56 + $dashboards = mpull($dashboards, null, 'getPHID'); 56 57 $viewer = $this->requireViewer(); 58 + $installs = id(new PhabricatorDashboardInstall()) 59 + ->loadAllWhere( 60 + 'objectPHID IN (%Ls) AND dashboardPHID IN (%Ls)', 61 + array(PhabricatorHomeApplication::DASHBOARD_DEFAULT, 62 + $viewer->getPHID()), 63 + array_keys($dashboards)); 64 + $installs = mpull($installs, null, 'getDashboardPHID'); 57 65 58 66 $list = new PHUIObjectItemListView(); 59 67 $list->setUser($viewer); 60 - foreach ($dashboards as $dashboard) { 68 + $list->initBehavior('phabricator-tooltips', array()); 69 + $list->requireResource('aphront-tooltip-css'); 70 + 71 + foreach ($dashboards as $dashboard_phid => $dashboard) { 61 72 $id = $dashboard->getID(); 62 73 63 74 $item = id(new PHUIObjectItemView()) ··· 65 76 ->setHeader($dashboard->getName()) 66 77 ->setHref($this->getApplicationURI("view/{$id}/")) 67 78 ->setObject($dashboard); 79 + 80 + if (isset($installs[$dashboard_phid])) { 81 + $install = $installs[$dashboard_phid]; 82 + if ($install->getObjectPHID() == $viewer->getPHID()) { 83 + $attrs = array( 84 + 'tip' => pht( 85 + 'This dashboard is installed to your personal homepage.')); 86 + $item->addIcon('fa-user', pht('Installed'), $attrs); 87 + } else { 88 + $attrs = array( 89 + 'tip' => pht( 90 + 'This dashboard is the default homepage for all users.')); 91 + $item->addIcon('fa-globe', pht('Installed'), $attrs); 92 + } 93 + } 68 94 69 95 $list->addItem($item); 70 96 }