@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.

Move dashboard list rendering to ApplicationSearch

Summary: Ref T4986. This is "good" and "desirable".

Test Plan: Saw dashboard list, panel.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4986

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

+31 -24
+2 -24
src/applications/dashboard/controller/PhabricatorDashboardListController.php
··· 1 1 <?php 2 2 3 3 final class PhabricatorDashboardListController 4 - extends PhabricatorDashboardController 5 - implements PhabricatorApplicationSearchResultsControllerInterface { 4 + extends PhabricatorDashboardController { 6 5 7 6 private $queryKey; 7 + 8 8 public function willProcessRequest(array $data) { 9 9 $this->queryKey = idx($data, 'queryKey'); 10 10 } ··· 46 46 ->setHref($this->getApplicationURI().'create/')); 47 47 48 48 return $crumbs; 49 - } 50 - 51 - public function renderResultsList( 52 - array $dashboards, 53 - PhabricatorSavedQuery $query) { 54 - $viewer = $this->getRequest()->getUser(); 55 - 56 - $list = new PHUIObjectItemListView(); 57 - $list->setUser($viewer); 58 - foreach ($dashboards as $dashboard) { 59 - $id = $dashboard->getID(); 60 - 61 - $item = id(new PHUIObjectItemView()) 62 - ->setObjectName(pht('Dashboard %d', $id)) 63 - ->setHeader($dashboard->getName()) 64 - ->setHref($this->getApplicationURI("view/{$id}/")) 65 - ->setObject($dashboard); 66 - 67 - $list->addItem($item); 68 - } 69 - 70 - return $list; 71 49 } 72 50 73 51 }
+29
src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
··· 3 3 final class PhabricatorDashboardSearchEngine 4 4 extends PhabricatorApplicationSearchEngine { 5 5 6 + public function getApplicationClassName() { 7 + return 'PhabricatorApplicationDashboard'; 8 + } 9 + 6 10 public function buildSavedQueryFromRequest(AphrontRequest $request) { 7 11 $saved = new PhabricatorSavedQuery(); 8 12 ··· 44 48 } 45 49 46 50 return parent::buildSavedQueryFromBuiltin($query_key); 51 + } 52 + 53 + 54 + protected function renderResultList( 55 + array $dashboards, 56 + PhabricatorSavedQuery $query, 57 + array $handles) { 58 + 59 + $viewer = $this->requireViewer(); 60 + 61 + $list = new PHUIObjectItemListView(); 62 + $list->setUser($viewer); 63 + foreach ($dashboards as $dashboard) { 64 + $id = $dashboard->getID(); 65 + 66 + $item = id(new PHUIObjectItemView()) 67 + ->setObjectName(pht('Dashboard %d', $id)) 68 + ->setHeader($dashboard->getName()) 69 + ->setHref($this->getApplicationURI("view/{$id}/")) 70 + ->setObject($dashboard); 71 + 72 + $list->addItem($item); 73 + } 74 + 75 + return $list; 47 76 } 48 77 49 78 }