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

Support querying Herald rules by monogram in typeahead datsources

Summary:
Depends on D19556. See PHI765. Ref T13164. Currently, if you type `H1` in this datasource, it isn't smart enough to pull up the right object.

Add support for querying by monogram. This is similar to existing support in Owners packages, etc.

Test Plan: Typed `H1` in the new push log filter, got the right object as a result in the typeahead.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13164

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

+12 -4
+12 -4
src/applications/herald/typeahead/HeraldRuleDatasource.php
··· 19 19 $viewer = $this->getViewer(); 20 20 $raw_query = $this->getRawQuery(); 21 21 22 - $rules = id(new HeraldRuleQuery()) 23 - ->setViewer($viewer) 24 - ->withDatasourceQuery($raw_query) 25 - ->execute(); 22 + $query = id(new HeraldRuleQuery()) 23 + ->setViewer($viewer); 24 + 25 + if (preg_match('/^[hH]\d+\z/', $raw_query)) { 26 + $id = trim($raw_query, 'hH'); 27 + $id = (int)$id; 28 + $query->withIDs(array($id)); 29 + } else { 30 + $query->withDatasourceQuery($raw_query); 31 + } 32 + 33 + $rules = $query->execute(); 26 34 27 35 $handles = id(new PhabricatorHandleQuery()) 28 36 ->setViewer($viewer)