Page MenuHomePhabricator

D18918.diff
No OneTemporary

D18918.diff

diff --git a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
@@ -11,63 +11,40 @@
return 'PhabricatorDiffusionApplication';
}
- public function buildSavedQueryFromRequest(AphrontRequest $request) {
- $saved = new PhabricatorSavedQuery();
-
- $saved->setParameter(
- 'repositoryPHIDs',
- $this->readPHIDsFromRequest(
- $request,
- 'repositories',
- array(
- PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
- )));
-
- $saved->setParameter(
- 'pusherPHIDs',
- $this->readUsersFromRequest(
- $request,
- 'pushers'));
-
- return $saved;
+ public function newQuery() {
+ return new PhabricatorRepositoryPushLogQuery();
}
- public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
- $query = id(new PhabricatorRepositoryPushLogQuery());
+ protected function buildQueryFromParameters(array $map) {
+ $query = $this->newQuery();
- $repository_phids = $saved->getParameter('repositoryPHIDs');
- if ($repository_phids) {
- $query->withRepositoryPHIDs($repository_phids);
+ if ($map['repositoryPHIDs']) {
+ $query->withRepositoryPHIDs($map['repositoryPHIDs']);
}
- $pusher_phids = $saved->getParameter('pusherPHIDs');
- if ($pusher_phids) {
- $query->withPusherPHIDs($pusher_phids);
+ if ($map['pusherPHIDs']) {
+ $query->withPusherPHIDs($map['pusherPHIDs']);
}
return $query;
}
- public function buildSearchForm(
- AphrontFormView $form,
- PhabricatorSavedQuery $saved_query) {
-
- $repository_phids = $saved_query->getParameter('repositoryPHIDs', array());
- $pusher_phids = $saved_query->getParameter('pusherPHIDs', array());
-
- $form
- ->appendControl(
- id(new AphrontFormTokenizerControl())
- ->setDatasource(new DiffusionRepositoryDatasource())
- ->setName('repositories')
- ->setLabel(pht('Repositories'))
- ->setValue($repository_phids))
- ->appendControl(
- id(new AphrontFormTokenizerControl())
- ->setDatasource(new PhabricatorPeopleDatasource())
- ->setName('pushers')
- ->setLabel(pht('Pushers'))
- ->setValue($pusher_phids));
+ protected function buildCustomSearchFields() {
+ return array(
+ id(new PhabricatorSearchDatasourceField())
+ ->setDatasource(new DiffusionRepositoryDatasource())
+ ->setKey('repositoryPHIDs')
+ ->setAliases(array('repository', 'repositories', 'repositoryPHID'))
+ ->setLabel(pht('Repositories'))
+ ->setDescription(
+ pht('Search for pull logs for specific repositories.')),
+ id(new PhabricatorUsersSearchField())
+ ->setKey('pusherPHIDs')
+ ->setAliases(array('pusher', 'pushers', 'pusherPHID'))
+ ->setLabel(pht('Pushers'))
+ ->setDescription(
+ pht('Search for pull logs by specific users.')),
+ );
}
protected function getURI($path) {

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 11:06 PM (15 h, 39 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6919776
Default Alt Text
D18918.diff (3 KB)

Event Timeline