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

Link search query to Dashboard header title

Summary: Makes the header text clickable to the full results.

Test Plan: Click on a few queries.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

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

+45 -11
+7
src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
··· 222 222 $header = id(new PHUIActionHeaderView()) 223 223 ->setHeaderTitle($panel->getName()) 224 224 ->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE); 225 + $panel_type = $panel->getImplementation(); 226 + $header = $panel_type->adjustPanelHeader( 227 + $this->getViewer(), 228 + $panel, 229 + $this, 230 + $header); 225 231 break; 226 232 } 227 233 return $header; ··· 255 261 } 256 262 return $header; 257 263 } 264 + 258 265 259 266 /** 260 267 * Detect graph cycles in panels, and deeply nested panels.
+8
src/applications/dashboard/paneltype/PhabricatorDashboardPanelType.php
··· 37 37 return true; 38 38 } 39 39 40 + public function adjustPanelHeader( 41 + PhabricatorUser $viewer, 42 + PhabricatorDashboardPanel $panel, 43 + PhabricatorDashboardPanelRenderingEngine $engine, 44 + PHUIActionHeaderView $header) { 45 + return $header; 46 + } 47 + 40 48 public static function getAllPanelTypes() { 41 49 static $types; 42 50
+30 -11
src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeQuery.php
··· 69 69 PhabricatorDashboardPanel $panel, 70 70 PhabricatorDashboardPanelRenderingEngine $engine) { 71 71 72 - $class = $panel->getProperty('class'); 73 - 74 - $engine = PhabricatorApplicationSearchEngine::getEngineByClassName($class); 75 - if (!$engine) { 76 - throw new Exception( 77 - pht( 78 - 'The application search engine "%s" is not known to Phabricator!', 79 - $class)); 80 - } 72 + $engine = $this->getSearchEngine($panel); 81 73 82 74 $engine->setViewer($viewer); 83 75 $engine->setContext(PhabricatorApplicationSearchEngine::CONTEXT_PANEL); ··· 88 80 } else { 89 81 $saved = id(new PhabricatorSavedQueryQuery()) 90 82 ->setViewer($viewer) 91 - ->withEngineClassNames(array($class)) 83 + ->withEngineClassNames(array(get_class($engine))) 92 84 ->withQueryKeys(array($key)) 93 85 ->executeOne(); 94 86 } ··· 98 90 pht( 99 91 'Query "%s" is unknown to application search engine "%s"!', 100 92 $key, 101 - $class)); 93 + get_class($engine))); 102 94 } 103 95 104 96 $query = $engine->buildQueryFromSavedQuery($saved); ··· 114 106 $results = $engine->executeQuery($query, $pager); 115 107 116 108 return $engine->renderResults($results, $saved); 109 + } 110 + 111 + 112 + public function adjustPanelHeader( 113 + PhabricatorUser $viewer, 114 + PhabricatorDashboardPanel $panel, 115 + PhabricatorDashboardPanelRenderingEngine $engine, 116 + PHUIActionHeaderView $header) { 117 + 118 + $search_engine = $this->getSearchEngine($panel); 119 + $key = $panel->getProperty('key'); 120 + $header->setHeaderHref($search_engine->getQueryResultsPageURI($key)); 121 + 122 + return $header; 123 + } 124 + 125 + private function getSearchEngine(PhabricatorDashboardPanel $panel) { 126 + $class = $panel->getProperty('class'); 127 + $engine = PhabricatorApplicationSearchEngine::getEngineByClassName($class); 128 + if (!$engine) { 129 + throw new Exception( 130 + pht( 131 + 'The application search engine "%s" is not known to Phabricator!', 132 + $class)); 133 + } 134 + 135 + return $engine; 117 136 } 118 137 119 138 }