Page MenuHomePhabricator

D9025.id21451.diff
No OneTemporary

D9025.id21451.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -4895,11 +4895,7 @@
'PhabricatorSearchAttachController' => 'PhabricatorSearchBaseController',
'PhabricatorSearchBaseController' => 'PhabricatorController',
'PhabricatorSearchConfigOptions' => 'PhabricatorApplicationConfigOptions',
- 'PhabricatorSearchController' =>
- array(
- 0 => 'PhabricatorSearchBaseController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'PhabricatorSearchController' => 'PhabricatorSearchBaseController',
'PhabricatorSearchDAO' => 'PhabricatorLiskDAO',
'PhabricatorSearchDeleteController' => 'PhabricatorSearchBaseController',
'PhabricatorSearchDocument' => 'PhabricatorSearchDAO',
@@ -5524,11 +5520,7 @@
'ReleephProductEditController' => 'ReleephProductController',
'ReleephProductEditor' => 'PhabricatorApplicationTransactionEditor',
'ReleephProductHistoryController' => 'ReleephProductController',
- 'ReleephProductListController' =>
- array(
- 0 => 'ReleephController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'ReleephProductListController' => 'ReleephController',
'ReleephProductQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'ReleephProductSearchEngine' => 'PhabricatorApplicationSearchEngine',
'ReleephProductTransaction' => 'PhabricatorApplicationTransaction',
diff --git a/src/applications/diffusion/controller/DiffusionPushLogListController.php b/src/applications/diffusion/controller/DiffusionPushLogListController.php
--- a/src/applications/diffusion/controller/DiffusionPushLogListController.php
+++ b/src/applications/diffusion/controller/DiffusionPushLogListController.php
@@ -1,6 +1,7 @@
<?php
-final class DiffusionPushLogListController extends DiffusionPushLogController {
+final class DiffusionPushLogListController extends DiffusionPushLogController
+ implements PhabricatorApplicationSearchResultsControllerInterface {
private $queryKey;
diff --git a/src/applications/releeph/controller/product/ReleephProductListController.php b/src/applications/releeph/controller/product/ReleephProductListController.php
--- a/src/applications/releeph/controller/product/ReleephProductListController.php
+++ b/src/applications/releeph/controller/product/ReleephProductListController.php
@@ -1,7 +1,6 @@
<?php
-final class ReleephProductListController extends ReleephController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class ReleephProductListController extends ReleephController {
private $queryKey;
@@ -23,47 +22,6 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $products,
- PhabricatorSavedQuery $query) {
- assert_instances_of($products, 'ReleephProject');
- $viewer = $this->getRequest()->getUser();
-
- $list = id(new PHUIObjectItemListView())
- ->setUser($viewer);
-
- foreach ($products as $product) {
- $id = $product->getID();
-
- $item = id(new PHUIObjectItemView())
- ->setHeader($product->getName())
- ->setHref($this->getApplicationURI("product/{$id}/"));
-
- if (!$product->getIsActive()) {
- $item->setDisabled(true);
- $item->addIcon('none', pht('Inactive'));
- }
-
- $repo = $product->getRepository();
- $item->addAttribute(
- phutil_tag(
- 'a',
- array(
- 'href' => '/diffusion/'.$repo->getCallsign().'/',
- ),
- 'r'.$repo->getCallsign()));
-
- $arc = $product->getArcanistProject();
- if ($arc) {
- $item->addAttribute($arc->getName());
- }
-
- $list->addItem($item);
- }
-
- return $list;
- }
-
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
diff --git a/src/applications/releeph/query/ReleephProductSearchEngine.php b/src/applications/releeph/query/ReleephProductSearchEngine.php
--- a/src/applications/releeph/query/ReleephProductSearchEngine.php
+++ b/src/applications/releeph/query/ReleephProductSearchEngine.php
@@ -3,6 +3,10 @@
final class ReleephProductSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationReleeph';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -83,4 +87,48 @@
);
}
+ protected function renderResultList(
+ array $products,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+
+ assert_instances_of($products, 'ReleephProject');
+ $viewer = $this->requireViewer();
+
+ $list = id(new PHUIObjectItemListView())
+ ->setUser($viewer);
+
+ foreach ($products as $product) {
+ $id = $product->getID();
+
+ $item = id(new PHUIObjectItemView())
+ ->setHeader($product->getName())
+ ->setHref($this->getApplicationURI("product/{$id}/"));
+
+ if (!$product->getIsActive()) {
+ $item->setDisabled(true);
+ $item->addIcon('none', pht('Inactive'));
+ }
+
+ $repo = $product->getRepository();
+ $item->addAttribute(
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => '/diffusion/'.$repo->getCallsign().'/',
+ ),
+ 'r'.$repo->getCallsign()));
+
+ $arc = $product->getArcanistProject();
+ if ($arc) {
+ $item->addAttribute($arc->getName());
+ }
+
+ $list->addItem($item);
+ }
+
+ return $list;
+ }
+
+
}
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
@@ -3,6 +3,10 @@
final class PhabricatorRepositoryPushLogSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationDiffusion';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
diff --git a/src/applications/search/controller/PhabricatorSearchController.php b/src/applications/search/controller/PhabricatorSearchController.php
--- a/src/applications/search/controller/PhabricatorSearchController.php
+++ b/src/applications/search/controller/PhabricatorSearchController.php
@@ -1,8 +1,7 @@
<?php
final class PhabricatorSearchController
- extends PhabricatorSearchBaseController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+ extends PhabricatorSearchBaseController {
private $queryKey;
@@ -96,45 +95,4 @@
return $nav;
}
- public function renderResultsList(
- array $results,
- PhabricatorSavedQuery $query) {
-
- $viewer = $this->getRequest()->getUser();
-
- if ($results) {
- $objects = id(new PhabricatorObjectQuery())
- ->setViewer($viewer)
- ->withPHIDs(mpull($results, 'getPHID'))
- ->execute();
-
- $output = array();
- foreach ($results as $phid => $handle) {
- $view = id(new PhabricatorSearchResultView())
- ->setHandle($handle)
- ->setQuery($query)
- ->setObject(idx($objects, $phid));
- $output[] = $view->render();
- }
-
- $results = phutil_tag_div(
- 'phabricator-search-result-list',
- $output);
- } else {
- $results = phutil_tag_div(
- 'phabricator-search-result-list',
- phutil_tag(
- 'p',
- array('class' => 'phabricator-search-no-results'),
- pht('No search results.')));
- }
-
- return id(new PHUIBoxView())
- ->addMargin(PHUI::MARGIN_LARGE)
- ->addPadding(PHUI::PADDING_LARGE)
- ->setBorder(true)
- ->appendChild($results)
- ->addClass('phabricator-search-result-box');
- }
-
}
diff --git a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
--- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
+++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
@@ -3,6 +3,10 @@
final class PhabricatorSearchApplicationSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationSearch';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -233,5 +237,46 @@
return true;
}
+ protected function renderResultList(
+ array $results,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+
+ $viewer = $this->requireViewer();
+
+ if ($results) {
+ $objects = id(new PhabricatorObjectQuery())
+ ->setViewer($viewer)
+ ->withPHIDs(mpull($results, 'getPHID'))
+ ->execute();
+
+ $output = array();
+ foreach ($results as $phid => $handle) {
+ $view = id(new PhabricatorSearchResultView())
+ ->setHandle($handle)
+ ->setQuery($query)
+ ->setObject(idx($objects, $phid));
+ $output[] = $view->render();
+ }
+
+ $results = phutil_tag_div(
+ 'phabricator-search-result-list',
+ $output);
+ } else {
+ $results = phutil_tag_div(
+ 'phabricator-search-result-list',
+ phutil_tag(
+ 'p',
+ array('class' => 'phabricator-search-no-results'),
+ pht('No search results.')));
+ }
+
+ return id(new PHUIBoxView())
+ ->addMargin(PHUI::MARGIN_LARGE)
+ ->addPadding(PHUI::PADDING_LARGE)
+ ->setBorder(true)
+ ->appendChild($results)
+ ->addClass('phabricator-search-result-box');
+ }
}

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 4, 2:02 PM (22 h, 9 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7385825
Default Alt Text
D9025.id21451.diff (9 KB)

Event Timeline