mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
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
This commit is contained in:
parent
06380e8079
commit
e72296f927
1 changed files with 12 additions and 4 deletions
|
@ -19,10 +19,18 @@ final class HeraldRuleDatasource
|
|||
$viewer = $this->getViewer();
|
||||
$raw_query = $this->getRawQuery();
|
||||
|
||||
$rules = id(new HeraldRuleQuery())
|
||||
->setViewer($viewer)
|
||||
->withDatasourceQuery($raw_query)
|
||||
->execute();
|
||||
$query = id(new HeraldRuleQuery())
|
||||
->setViewer($viewer);
|
||||
|
||||
if (preg_match('/^[hH]\d+\z/', $raw_query)) {
|
||||
$id = trim($raw_query, 'hH');
|
||||
$id = (int)$id;
|
||||
$query->withIDs(array($id));
|
||||
} else {
|
||||
$query->withDatasourceQuery($raw_query);
|
||||
}
|
||||
|
||||
$rules = $query->execute();
|
||||
|
||||
$handles = id(new PhabricatorHandleQuery())
|
||||
->setViewer($viewer)
|
||||
|
|
Loading…
Reference in a new issue