mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Allow projects to be queried by slug in "project.search"
Summary: Ref T13102. See PHI461. An install is interested in querying projects by slug. I think I omitted this capability originally only because we're not consistent about what slugs are called (they are "Slugs" internally, but "Hashtags" in the UI). However, this ship has sort of already sailed because the results have a "slug" field. Just expose this as "slugs" for consistency with the existing API field and try to smooth thing over with a little documentation hint. Test Plan: Queried for projects by slug, got the desired results back. Maniphest Tasks: T13102 Differential Revision: https://secure.phabricator.com/D19230
This commit is contained in:
parent
2b5c73fc3d
commit
c216fd4072
1 changed files with 12 additions and 0 deletions
|
@ -23,6 +23,14 @@ final class PhabricatorProjectSearchEngine
|
||||||
id(new PhabricatorSearchTextField())
|
id(new PhabricatorSearchTextField())
|
||||||
->setLabel(pht('Name'))
|
->setLabel(pht('Name'))
|
||||||
->setKey('name'),
|
->setKey('name'),
|
||||||
|
id(new PhabricatorSearchStringListField())
|
||||||
|
->setLabel(pht('Slugs'))
|
||||||
|
->setIsHidden(true)
|
||||||
|
->setKey('slugs')
|
||||||
|
->setDescription(
|
||||||
|
pht(
|
||||||
|
'Search for projects with particular slugs. (Slugs are the same '.
|
||||||
|
'as project hashtags.)')),
|
||||||
id(new PhabricatorUsersSearchField())
|
id(new PhabricatorUsersSearchField())
|
||||||
->setLabel(pht('Members'))
|
->setLabel(pht('Members'))
|
||||||
->setKey('memberPHIDs')
|
->setKey('memberPHIDs')
|
||||||
|
@ -81,6 +89,10 @@ final class PhabricatorProjectSearchEngine
|
||||||
$query->withNameTokens($tokens);
|
$query->withNameTokens($tokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($map['slugs']) {
|
||||||
|
$query->withSlugs($map['slugs']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($map['memberPHIDs']) {
|
if ($map['memberPHIDs']) {
|
||||||
$query->withMemberPHIDs($map['memberPHIDs']);
|
$query->withMemberPHIDs($map['memberPHIDs']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue