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

Make the dashboard panel datasource work properly with hundreds of panels

Summary:
Ref T13151. See PHI727. Update the dashboard widget/panel datasource to actually query results using what the user typed.

The current approach is blind to what the user typed when pulling results from the database, and gets limited to an artificially small number of results somewhere in the pipeline.

Test Plan:
- Queried for panels with text queries.
- Queried for panels with `W123` queries.
- This is substantially similar to the Owners datasource, which received a similar update in D17142 and has worked well since then.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13151

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

+11 -2
+11 -2
src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
··· 20 20 return $this->filterResultsAgainstTokens($results); 21 21 } 22 22 23 - 24 23 protected function renderSpecialTokens(array $values) { 25 24 return $this->renderTokensFromResults($this->buildResults(), $values); 26 25 } 27 26 28 27 public function buildResults() { 29 - $query = id(new PhabricatorDashboardPanelQuery()); 28 + $query = new PhabricatorDashboardPanelQuery(); 29 + 30 + $raw_query = $this->getRawQuery(); 31 + if (preg_match('/^[wW]\d+\z/', $raw_query)) { 32 + $id = trim($raw_query, 'wW'); 33 + $id = (int)$id; 34 + $query->withIDs(array($id)); 35 + } else { 36 + $query->withNameNgrams($raw_query); 37 + } 38 + 30 39 $panels = $this->executeQuery($query); 31 40 32 41 $results = array();