Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14049354
D9013.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D9013.diff
View Options
diff --git a/src/applications/conduit/controller/PhabricatorConduitListController.php b/src/applications/conduit/controller/PhabricatorConduitListController.php
--- a/src/applications/conduit/controller/PhabricatorConduitListController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitListController.php
@@ -1,8 +1,7 @@
<?php
final class PhabricatorConduitListController
- extends PhabricatorConduitController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+ extends PhabricatorConduitController {
private $queryKey;
@@ -23,62 +22,4 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $methods,
- PhabricatorSavedQuery $query) {
- assert_instances_of($methods, 'ConduitAPIMethod');
-
- $viewer = $this->getRequest()->getUser();
-
- $out = array();
-
- $last = null;
- $list = null;
- foreach ($methods as $method) {
- $app = $method->getApplicationName();
- if ($app !== $last) {
- $last = $app;
- if ($list) {
- $out[] = $list;
- }
- $list = id(new PHUIObjectItemListView());
-
- $app_object = $method->getApplication();
- if ($app_object) {
- $app_name = $app_object->getName();
- } else {
- $app_name = $app;
- }
- }
-
- $method_name = $method->getAPIMethodName();
-
- $item = id(new PHUIObjectItemView())
- ->setHeader($method_name)
- ->setHref($this->getApplicationURI('method/'.$method_name.'/'))
- ->addAttribute($method->getMethodDescription());
-
- switch ($method->getMethodStatus()) {
- case ConduitAPIMethod::METHOD_STATUS_STABLE:
- break;
- case ConduitAPIMethod::METHOD_STATUS_UNSTABLE:
- $item->addIcon('warning-grey', pht('Unstable'));
- $item->setBarColor('yellow');
- break;
- case ConduitAPIMethod::METHOD_STATUS_DEPRECATED:
- $item->addIcon('warning', pht('Deprecated'));
- $item->setBarColor('red');
- break;
- }
-
- $list->addItem($item);
- }
-
- if ($list) {
- $out[] = $list;
- }
-
- return $out;
- }
-
}
diff --git a/src/applications/conduit/query/PhabricatorConduitSearchEngine.php b/src/applications/conduit/query/PhabricatorConduitSearchEngine.php
--- a/src/applications/conduit/query/PhabricatorConduitSearchEngine.php
+++ b/src/applications/conduit/query/PhabricatorConduitSearchEngine.php
@@ -3,6 +3,10 @@
final class PhabricatorConduitSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationConduit';
+ }
+
public function getPageSize(PhabricatorSavedQuery $saved) {
return PHP_INT_MAX - 1;
}
@@ -135,4 +139,63 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
+ protected function renderResultList(
+ array $methods,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($methods, 'ConduitAPIMethod');
+
+ $viewer = $this->requireViewer();
+
+ $out = array();
+
+ $last = null;
+ $list = null;
+ foreach ($methods as $method) {
+ $app = $method->getApplicationName();
+ if ($app !== $last) {
+ $last = $app;
+ if ($list) {
+ $out[] = $list;
+ }
+ $list = id(new PHUIObjectItemListView());
+
+ $app_object = $method->getApplication();
+ if ($app_object) {
+ $app_name = $app_object->getName();
+ } else {
+ $app_name = $app;
+ }
+ }
+
+ $method_name = $method->getAPIMethodName();
+
+ $item = id(new PHUIObjectItemView())
+ ->setHeader($method_name)
+ ->setHref($this->getApplicationURI('method/'.$method_name.'/'))
+ ->addAttribute($method->getMethodDescription());
+
+ switch ($method->getMethodStatus()) {
+ case ConduitAPIMethod::METHOD_STATUS_STABLE:
+ break;
+ case ConduitAPIMethod::METHOD_STATUS_UNSTABLE:
+ $item->addIcon('warning-grey', pht('Unstable'));
+ $item->setBarColor('yellow');
+ break;
+ case ConduitAPIMethod::METHOD_STATUS_DEPRECATED:
+ $item->addIcon('warning', pht('Deprecated'));
+ $item->setBarColor('red');
+ break;
+ }
+
+ $list->addItem($item);
+ }
+
+ if ($list) {
+ $out[] = $list;
+ }
+
+ return $out;
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 12:45 PM (3 d, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6722048
Default Alt Text
D9013.diff (4 KB)
Attached To
Mode
D9013: Move Conduit rendering to SearchEngine
Attached
Detach File
Event Timeline
Log In to Comment