@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 more information to Dashboard ApplicationSearch list

Summary: Fixes T4984. This is about as fancy as I want to get this pass. Adds in the list of panel titles and the author. This does give me a rough idea what's on each dashboard.

Test Plan:
Visit a list of dashboards and see various authors and panels.

{F2810876}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T4984

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

+21 -21
+21 -21
src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
··· 13 13 14 14 public function newQuery() { 15 15 return id(new PhabricatorDashboardQuery()) 16 - ->needProjects(true); 16 + ->needPanels(true); 17 17 } 18 18 19 19 protected function buildCustomSearchFields() { ··· 98 98 PhabricatorSavedQuery $query, 99 99 array $handles) { 100 100 101 - $dashboards = mpull($dashboards, null, 'getPHID'); 102 101 $viewer = $this->requireViewer(); 103 102 104 - $proj_phids = array(); 103 + $phids = array(); 105 104 foreach ($dashboards as $dashboard) { 106 - foreach ($dashboard->getProjectPHIDs() as $project_phid) { 107 - $proj_phids[] = $project_phid; 105 + $author_phid = $dashboard->getAuthorPHID(); 106 + if ($author_phid) { 107 + $phids[] = $author_phid; 108 108 } 109 109 } 110 110 111 - $proj_handles = id(new PhabricatorHandleQuery()) 112 - ->setViewer($viewer) 113 - ->withPHIDs($proj_phids) 114 - ->execute(); 111 + $handles = $viewer->loadHandles($phids); 115 112 116 113 $list = id(new PHUIObjectItemListView()) 117 114 ->setUser($viewer); 118 115 119 - foreach ($dashboards as $dashboard_phid => $dashboard) { 116 + foreach ($dashboards as $dashboard) { 120 117 $id = $dashboard->getID(); 121 118 122 119 $item = id(new PHUIObjectItemView()) ··· 125 122 ->setHref($this->getApplicationURI("view/{$id}/")) 126 123 ->setObject($dashboard); 127 124 128 - $project_handles = array_select_keys( 129 - $proj_handles, 130 - $dashboard->getProjectPHIDs()); 131 - 132 - $item->addAttribute( 133 - id(new PHUIHandleTagListView()) 134 - ->setLimit(4) 135 - ->setNoDataString(pht('No Projects')) 136 - ->setSlim(true) 137 - ->setHandles($project_handles)); 138 - 139 125 if ($dashboard->isArchived()) { 140 126 $item->setDisabled(true); 141 127 } 142 128 129 + $panels = $dashboard->getPanels(); 130 + foreach ($panels as $panel) { 131 + $item->addAttribute($panel->getName()); 132 + } 133 + 134 + if (empty($panels)) { 135 + $empty = phutil_tag('em', array(), pht('No panels.')); 136 + $item->addAttribute($empty); 137 + } 138 + 143 139 $icon = id(new PHUIIconView()) 144 140 ->setIcon($dashboard->getIcon()) 145 141 ->setBackground('bg-dark'); 146 142 $item->setImageIcon($icon); 147 143 $item->setEpoch($dashboard->getDateModified()); 144 + 145 + $author_phid = $dashboard->getAuthorPHID(); 146 + $author_name = $handles[$author_phid]->renderLink(); 147 + $item->addByline(pht('Author: %s', $author_name)); 148 148 149 149 $list->addItem($item); 150 150 }