Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13970137
D9017.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
52 KB
Referenced Files
None
Subscribers
None
D9017.diff
View Options
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
@@ -3061,11 +3061,7 @@
'DifferentialRevisionEditController' => 'DifferentialController',
'DifferentialRevisionIDField' => 'DifferentialCustomField',
'DifferentialRevisionLandController' => 'DifferentialController',
- 'DifferentialRevisionListController' =>
- array(
- 0 => 'DifferentialController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'DifferentialRevisionListController' => 'DifferentialController',
'DifferentialRevisionListView' => 'AphrontView',
'DifferentialRevisionMailReceiver' => 'PhabricatorObjectMailReceiver',
'DifferentialRevisionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
@@ -3150,11 +3146,7 @@
'DiffusionPathValidateController' => 'DiffusionController',
'DiffusionPushEventViewController' => 'DiffusionPushLogController',
'DiffusionPushLogController' => 'DiffusionController',
- 'DiffusionPushLogListController' =>
- array(
- 0 => 'DiffusionPushLogController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'DiffusionPushLogListController' => 'DiffusionPushLogController',
'DiffusionQuery' => 'PhabricatorQuery',
'DiffusionRawDiffQuery' => 'DiffusionQuery',
'DiffusionRepositoryController' => 'DiffusionController',
@@ -3172,11 +3164,7 @@
'DiffusionRepositoryEditLocalController' => 'DiffusionRepositoryEditController',
'DiffusionRepositoryEditMainController' => 'DiffusionRepositoryEditController',
'DiffusionRepositoryEditSubversionController' => 'DiffusionRepositoryEditController',
- 'DiffusionRepositoryListController' =>
- array(
- 0 => 'DiffusionController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'DiffusionRepositoryListController' => 'DiffusionController',
'DiffusionRepositoryNewController' => 'DiffusionController',
'DiffusionRepositoryRef' => 'Phobject',
'DiffusionRepositoryRemarkupRule' => 'PhabricatorRemarkupRuleObject',
@@ -3208,11 +3196,7 @@
'DivinerArticleAtomizer' => 'DivinerAtomizer',
'DivinerAtomCache' => 'DivinerDiskCache',
'DivinerAtomController' => 'DivinerController',
- 'DivinerAtomListController' =>
- array(
- 0 => 'DivinerController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'DivinerAtomListController' => 'DivinerController',
'DivinerAtomQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'DivinerAtomSearchEngine' => 'PhabricatorApplicationSearchEngine',
'DivinerAtomizeWorkflow' => 'DivinerWorkflow',
@@ -3281,11 +3265,7 @@
'DrydockBlueprintCreateController' => 'DrydockBlueprintController',
'DrydockBlueprintEditController' => 'DrydockBlueprintController',
'DrydockBlueprintEditor' => 'PhabricatorApplicationTransactionEditor',
- 'DrydockBlueprintListController' =>
- array(
- 0 => 'DrydockBlueprintController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'DrydockBlueprintListController' => 'DrydockBlueprintController',
'DrydockBlueprintQuery' => 'DrydockQuery',
'DrydockBlueprintSearchEngine' => 'PhabricatorApplicationSearchEngine',
'DrydockBlueprintTransaction' => 'PhabricatorApplicationTransaction',
@@ -3438,11 +3418,7 @@
2 => 'HarbormasterBuildableInterface',
),
'HarbormasterBuildableActionController' => 'HarbormasterController',
- 'HarbormasterBuildableListController' =>
- array(
- 0 => 'HarbormasterController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'HarbormasterBuildableListController' => 'HarbormasterController',
'HarbormasterBuildableQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'HarbormasterBuildableSearchEngine' => 'PhabricatorApplicationSearchEngine',
'HarbormasterBuildableViewController' => 'HarbormasterController',
@@ -3466,11 +3442,7 @@
'HarbormasterPlanController' => 'HarbormasterController',
'HarbormasterPlanDisableController' => 'HarbormasterPlanController',
'HarbormasterPlanEditController' => 'HarbormasterPlanController',
- 'HarbormasterPlanListController' =>
- array(
- 0 => 'HarbormasterPlanController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'HarbormasterPlanListController' => 'HarbormasterPlanController',
'HarbormasterPlanOrderController' => 'HarbormasterController',
'HarbormasterPlanRunController' => 'HarbormasterController',
'HarbormasterPlanViewController' => 'HarbormasterPlanController',
@@ -3520,11 +3492,7 @@
'HeraldRuleEditHistoryController' => 'HeraldController',
'HeraldRuleEditHistoryView' => 'AphrontView',
'HeraldRuleEditor' => 'PhabricatorApplicationTransactionEditor',
- 'HeraldRuleListController' =>
- array(
- 0 => 'HeraldController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'HeraldRuleListController' => 'HeraldController',
'HeraldRuleQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'HeraldRuleSearchEngine' => 'PhabricatorApplicationSearchEngine',
'HeraldRuleTransaction' => 'PhabricatorApplicationTransaction',
@@ -4133,11 +4101,7 @@
'PhabricatorConduitConsoleController' => 'PhabricatorConduitController',
'PhabricatorConduitController' => 'PhabricatorController',
'PhabricatorConduitDAO' => 'PhabricatorLiskDAO',
- 'PhabricatorConduitListController' =>
- array(
- 0 => 'PhabricatorConduitController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'PhabricatorConduitListController' => 'PhabricatorConduitController',
'PhabricatorConduitLogController' => 'PhabricatorConduitController',
'PhabricatorConduitLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorConduitMethodCallLog' =>
@@ -4202,11 +4166,7 @@
'PhabricatorCountdownDAO' => 'PhabricatorLiskDAO',
'PhabricatorCountdownDeleteController' => 'PhabricatorCountdownController',
'PhabricatorCountdownEditController' => 'PhabricatorCountdownController',
- 'PhabricatorCountdownListController' =>
- array(
- 0 => 'PhabricatorCountdownController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'PhabricatorCountdownListController' => 'PhabricatorCountdownController',
'PhabricatorCountdownPHIDTypeCountdown' => 'PhabricatorPHIDType',
'PhabricatorCountdownQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorCountdownRemarkupRule' => 'PhabricatorRemarkupRuleObject',
@@ -4265,11 +4225,7 @@
'PhabricatorDashboardController' => 'PhabricatorController',
'PhabricatorDashboardDAO' => 'PhabricatorLiskDAO',
'PhabricatorDashboardEditController' => 'PhabricatorDashboardController',
- 'PhabricatorDashboardListController' =>
- array(
- 0 => 'PhabricatorDashboardController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'PhabricatorDashboardListController' => 'PhabricatorDashboardController',
'PhabricatorDashboardPHIDTypeDashboard' => 'PhabricatorPHIDType',
'PhabricatorDashboardPHIDTypePanel' => 'PhabricatorPHIDType',
'PhabricatorDashboardPanel' =>
@@ -4286,11 +4242,7 @@
'PhabricatorDashboardPanelCreateController' => 'PhabricatorDashboardController',
'PhabricatorDashboardPanelCustomField' => 'PhabricatorCustomField',
'PhabricatorDashboardPanelEditController' => 'PhabricatorDashboardController',
- 'PhabricatorDashboardPanelListController' =>
- array(
- 0 => 'PhabricatorDashboardController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'PhabricatorDashboardPanelListController' => 'PhabricatorDashboardController',
'PhabricatorDashboardPanelQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorDashboardPanelRenderController' => 'PhabricatorDashboardController',
'PhabricatorDashboardPanelRenderingEngine' => 'Phobject',
@@ -4415,11 +4367,7 @@
'PhabricatorFileInfoController' => 'PhabricatorFileController',
'PhabricatorFileLinkListView' => 'AphrontView',
'PhabricatorFileLinkView' => 'AphrontView',
- 'PhabricatorFileListController' =>
- array(
- 0 => 'PhabricatorFileController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'PhabricatorFileListController' => 'PhabricatorFileController',
'PhabricatorFilePHIDTypeFile' => 'PhabricatorPHIDType',
'PhabricatorFileQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorFileSearchEngine' => 'PhabricatorApplicationSearchEngine',
@@ -4452,11 +4400,7 @@
'PhabricatorFlagDAO' => 'PhabricatorLiskDAO',
'PhabricatorFlagDeleteController' => 'PhabricatorFlagController',
'PhabricatorFlagEditController' => 'PhabricatorFlagController',
- 'PhabricatorFlagListController' =>
- array(
- 0 => 'PhabricatorFlagController',
- 1 => 'PhabricatorApplicationSearchResultsControllerInterface',
- ),
+ 'PhabricatorFlagListController' => 'PhabricatorFlagController',
'PhabricatorFlagQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorFlagSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorFlagSelectControl' => 'AphrontFormControl',
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php
@@ -1,10 +1,10 @@
<?php
final class PhabricatorDashboardPanelListController
- extends PhabricatorDashboardController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+ extends PhabricatorDashboardController {
private $queryKey;
+
public function willProcessRequest(array $data) {
$this->queryKey = idx($data, 'queryKey');
}
@@ -47,25 +47,4 @@
return $crumbs;
}
- public function renderResultsList(
- array $panels,
- PhabricatorSavedQuery $query) {
-
- $viewer = $this->getRequest()->getUser();
-
- $list = new PHUIObjectItemListView();
- $list->setUser($viewer);
- foreach ($panels as $panel) {
- $item = id(new PHUIObjectItemView())
- ->setObjectName($panel->getMonogram())
- ->setHeader($panel->getName())
- ->setHref('/'.$panel->getMonogram())
- ->setObject($panel);
-
- $list->addItem($item);
- }
-
- return $list;
- }
-
}
diff --git a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
--- a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
+++ b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
@@ -3,6 +3,10 @@
final class PhabricatorDashboardPanelSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationDashboard';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -46,4 +50,26 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
+ protected function renderResultList(
+ array $panels,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+
+ $viewer = $this->requireViewer();
+
+ $list = new PHUIObjectItemListView();
+ $list->setUser($viewer);
+ foreach ($panels as $panel) {
+ $item = id(new PHUIObjectItemView())
+ ->setObjectName($panel->getMonogram())
+ ->setHeader($panel->getName())
+ ->setHref('/'.$panel->getMonogram())
+ ->setObject($panel);
+
+ $list->addItem($item);
+ }
+
+ return $list;
+ }
+
}
diff --git a/src/applications/differential/controller/DifferentialRevisionListController.php b/src/applications/differential/controller/DifferentialRevisionListController.php
--- a/src/applications/differential/controller/DifferentialRevisionListController.php
+++ b/src/applications/differential/controller/DifferentialRevisionListController.php
@@ -1,7 +1,6 @@
<?php
-final class DifferentialRevisionListController extends DifferentialController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class DifferentialRevisionListController extends DifferentialController {
private $queryKey;
@@ -23,64 +22,4 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $revisions,
- PhabricatorSavedQuery $query) {
- assert_instances_of($revisions, 'DifferentialRevision');
-
- $user = $this->getRequest()->getUser();
- $template = id(new DifferentialRevisionListView())
- ->setUser($user);
-
- $views = array();
- if ($query->getQueryKey() == 'active') {
- $split = DifferentialRevisionQuery::splitResponsible(
- $revisions,
- $query->getParameter('responsiblePHIDs'));
- list($blocking, $active, $waiting) = $split;
-
- $views[] = id(clone $template)
- ->setHeader(pht('Blocking Others'))
- ->setNoDataString(
- pht('No revisions are blocked on your action.'))
- ->setHighlightAge(true)
- ->setRevisions($blocking)
- ->setHandles(array());
-
- $views[] = id(clone $template)
- ->setHeader(pht('Action Required'))
- ->setNoDataString(
- pht('No revisions require your action.'))
- ->setHighlightAge(true)
- ->setRevisions($active)
- ->setHandles(array());
-
- $views[] = id(clone $template)
- ->setHeader(pht('Waiting on Others'))
- ->setNoDataString(
- pht('You have no revisions waiting on others.'))
- ->setRevisions($waiting)
- ->setHandles(array());
- } else {
- $views[] = id(clone $template)
- ->setRevisions($revisions)
- ->setHandles(array());
- }
-
- $phids = array_mergev(mpull($views, 'getRequiredHandlePHIDs'));
- $handles = $this->loadViewerHandles($phids);
-
- foreach ($views as $view) {
- $view->setHandles($handles);
- }
-
- if (count($views) == 1) {
- // Reduce this to a PHUIObjectItemListView so we can get the free
- // support from ApplicationSearch.
- return head($views)->render();
- } else {
- return $views;
- }
- }
-
}
diff --git a/src/applications/differential/query/DifferentialRevisionSearchEngine.php b/src/applications/differential/query/DifferentialRevisionSearchEngine.php
--- a/src/applications/differential/query/DifferentialRevisionSearchEngine.php
+++ b/src/applications/differential/query/DifferentialRevisionSearchEngine.php
@@ -3,6 +3,10 @@
final class DifferentialRevisionSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationDifferential';
+ }
+
public function getPageSize(PhabricatorSavedQuery $saved) {
if ($saved->getQueryKey() == 'active') {
return 0xFFFF;
@@ -243,4 +247,72 @@
);
}
+ protected function renderResultList(
+ array $revisions,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($revisions, 'DifferentialRevision');
+
+ $viewer = $this->requireViewer();
+ $template = id(new DifferentialRevisionListView())
+ ->setUser($viewer);
+
+ $views = array();
+ if ($query->getQueryKey() == 'active') {
+ $split = DifferentialRevisionQuery::splitResponsible(
+ $revisions,
+ $query->getParameter('responsiblePHIDs'));
+ list($blocking, $active, $waiting) = $split;
+
+ $views[] = id(clone $template)
+ ->setHeader(pht('Blocking Others'))
+ ->setNoDataString(
+ pht('No revisions are blocked on your action.'))
+ ->setHighlightAge(true)
+ ->setRevisions($blocking)
+ ->setHandles(array());
+
+ $views[] = id(clone $template)
+ ->setHeader(pht('Action Required'))
+ ->setNoDataString(
+ pht('No revisions require your action.'))
+ ->setHighlightAge(true)
+ ->setRevisions($active)
+ ->setHandles(array());
+
+ $views[] = id(clone $template)
+ ->setHeader(pht('Waiting on Others'))
+ ->setNoDataString(
+ pht('You have no revisions waiting on others.'))
+ ->setRevisions($waiting)
+ ->setHandles(array());
+ } else {
+ $views[] = id(clone $template)
+ ->setRevisions($revisions)
+ ->setHandles(array());
+ }
+
+ $phids = array_mergev(mpull($views, 'getRequiredHandlePHIDs'));
+ if ($phids) {
+ $handles = id(new PhabricatorHandleQuery())
+ ->setViewer($viewer)
+ ->withPHIDs($phids)
+ ->execute();
+ } else {
+ $handles = array();
+ }
+
+ foreach ($views as $view) {
+ $view->setHandles($handles);
+ }
+
+ if (count($views) == 1) {
+ // Reduce this to a PHUIObjectItemListView so we can get the free
+ // support from ApplicationSearch.
+ return head($views)->render();
+ } else {
+ return $views;
+ }
+ }
+
}
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,7 +1,6 @@
<?php
-final class DiffusionPushLogListController extends DiffusionPushLogController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class DiffusionPushLogListController extends DiffusionPushLogController {
private $queryKey;
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryListController.php b/src/applications/diffusion/controller/DiffusionRepositoryListController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryListController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryListController.php
@@ -1,7 +1,6 @@
<?php
-final class DiffusionRepositoryListController extends DiffusionController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class DiffusionRepositoryListController extends DiffusionController {
private $queryKey;
@@ -23,83 +22,6 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $repositories,
- PhabricatorSavedQuery $query) {
- assert_instances_of($repositories, 'PhabricatorRepository');
-
- $viewer = $this->getRequest()->getUser();
-
- $project_phids = array_fuse(
- array_mergev(
- mpull($repositories, 'getProjectPHIDs')));
- $project_handles = $this->loadViewerHandles($project_phids);
-
- $list = new PHUIObjectItemListView();
- $list->setCards(true);
- foreach ($repositories as $repository) {
- $id = $repository->getID();
-
- $item = id(new PHUIObjectItemView())
- ->setUser($viewer)
- ->setHeader($repository->getName())
- ->setObjectName('r'.$repository->getCallsign())
- ->setHref($this->getApplicationURI($repository->getCallsign().'/'));
-
- $commit = $repository->getMostRecentCommit();
- if ($commit) {
- $commit_link = DiffusionView::linkCommit(
- $repository,
- $commit->getCommitIdentifier(),
- $commit->getSummary());
- $item->setSubhead($commit_link);
- $item->setEpoch($commit->getEpoch());
- }
-
- $item->addIcon(
- 'none',
- PhabricatorRepositoryType::getNameForRepositoryType(
- $repository->getVersionControlSystem()));
-
- $size = $repository->getCommitCount();
- if ($size) {
- $history_uri = DiffusionRequest::generateDiffusionURI(
- array(
- 'callsign' => $repository->getCallsign(),
- 'action' => 'history',
- ));
-
- $item->addAttribute(
- phutil_tag(
- 'a',
- array(
- 'href' => $history_uri,
- ),
- pht('%s Commit(s)', new PhutilNumber($size))));
- } else {
- $item->addAttribute(pht('No Commits'));
- }
-
- $handles = array_select_keys(
- $project_handles,
- $repository->getProjectPHIDs());
- if ($handles) {
- $item->addAttribute(
- id(new ManiphestTaskProjectsView())
- ->setHandles($handles));
- }
-
- if (!$repository->isTracked()) {
- $item->setDisabled(true);
- $item->addIcon('disable-grey', pht('Inactive'));
- }
-
- $list->addItem($item);
- }
-
- return $list;
- }
-
public function buildSideNavView($for_app = false) {
$viewer = $this->getRequest()->getUser();
diff --git a/src/applications/diviner/controller/DivinerAtomListController.php b/src/applications/diviner/controller/DivinerAtomListController.php
--- a/src/applications/diviner/controller/DivinerAtomListController.php
+++ b/src/applications/diviner/controller/DivinerAtomListController.php
@@ -1,7 +1,6 @@
<?php
-final class DivinerAtomListController extends DivinerController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class DivinerAtomListController extends DivinerController {
private $key;
@@ -23,32 +22,4 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $symbols,
- PhabricatorSavedQuery $query) {
-
- assert_instances_of($symbols, 'DivinerLiveSymbol');
-
- $request = $this->getRequest();
- $viewer = $request->getUser();
-
- $list = id(new PHUIObjectItemListView())
- ->setUser($viewer);
-
- foreach ($symbols as $symbol) {
- $type = $symbol->getType();
- $type_name = DivinerAtom::getAtomTypeNameString($type);
-
- $item = id(new PHUIObjectItemView())
- ->setHeader($symbol->getTitle())
- ->setHref($symbol->getURI())
- ->addAttribute($symbol->getSummary())
- ->addIcon('none', $type_name);
-
- $list->addItem($item);
- }
-
- return $list;
- }
-
}
diff --git a/src/applications/diviner/query/DivinerAtomSearchEngine.php b/src/applications/diviner/query/DivinerAtomSearchEngine.php
--- a/src/applications/diviner/query/DivinerAtomSearchEngine.php
+++ b/src/applications/diviner/query/DivinerAtomSearchEngine.php
@@ -3,6 +3,10 @@
final class DivinerAtomSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationDiviner';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -88,4 +92,32 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
+ protected function renderResultList(
+ array $symbols,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+
+ assert_instances_of($symbols, 'DivinerLiveSymbol');
+
+ $viewer = $this->requireViewer();
+
+ $list = id(new PHUIObjectItemListView())
+ ->setUser($viewer);
+
+ foreach ($symbols as $symbol) {
+ $type = $symbol->getType();
+ $type_name = DivinerAtom::getAtomTypeNameString($type);
+
+ $item = id(new PHUIObjectItemView())
+ ->setHeader($symbol->getTitle())
+ ->setHref($symbol->getURI())
+ ->addAttribute($symbol->getSummary())
+ ->addIcon('none', $type_name);
+
+ $list->addItem($item);
+ }
+
+ return $list;
+ }
+
}
diff --git a/src/applications/drydock/controller/DrydockBlueprintListController.php b/src/applications/drydock/controller/DrydockBlueprintListController.php
--- a/src/applications/drydock/controller/DrydockBlueprintListController.php
+++ b/src/applications/drydock/controller/DrydockBlueprintListController.php
@@ -1,7 +1,6 @@
<?php
-final class DrydockBlueprintListController extends DrydockBlueprintController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class DrydockBlueprintListController extends DrydockBlueprintController {
private $queryKey;
@@ -23,32 +22,6 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $blueprints,
- PhabricatorSavedQuery $query) {
- assert_instances_of($blueprints, 'DrydockBlueprint');
-
- $viewer = $this->getRequest()->getUser();
- $view = new PHUIObjectItemListView();
-
- foreach ($blueprints as $blueprint) {
- $item = id(new PHUIObjectItemView())
- ->setHeader($blueprint->getBlueprintName())
- ->setHref($this->getApplicationURI('/blueprint/'.$blueprint->getID()))
- ->setObjectName(pht('Blueprint %d', $blueprint->getID()));
-
- if (!$blueprint->getImplementation()->isEnabled()) {
- $item->setDisabled(true);
- }
-
- $item->addAttribute($blueprint->getImplementation()->getBlueprintName());
-
- $view->addItem($item);
- }
-
- return $view;
- }
-
public function buildApplicationCrumbs() {
$can_create = $this->hasApplicationCapability(
DrydockCapabilityCreateBlueprints::CAPABILITY);
diff --git a/src/applications/drydock/query/DrydockBlueprintSearchEngine.php b/src/applications/drydock/query/DrydockBlueprintSearchEngine.php
--- a/src/applications/drydock/query/DrydockBlueprintSearchEngine.php
+++ b/src/applications/drydock/query/DrydockBlueprintSearchEngine.php
@@ -3,6 +3,10 @@
final class DrydockBlueprintSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationDrydock';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -45,4 +49,31 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
+ public function renderResultList(
+ array $blueprints,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($blueprints, 'DrydockBlueprint');
+
+ $viewer = $this->requireViewer();
+ $view = new PHUIObjectItemListView();
+
+ foreach ($blueprints as $blueprint) {
+ $item = id(new PHUIObjectItemView())
+ ->setHeader($blueprint->getBlueprintName())
+ ->setHref($this->getApplicationURI('/blueprint/'.$blueprint->getID()))
+ ->setObjectName(pht('Blueprint %d', $blueprint->getID()));
+
+ if (!$blueprint->getImplementation()->isEnabled()) {
+ $item->setDisabled(true);
+ }
+
+ $item->addAttribute($blueprint->getImplementation()->getBlueprintName());
+
+ $view->addItem($item);
+ }
+
+ return $view;
+ }
+
}
diff --git a/src/applications/files/application/PhabricatorApplicationFiles.php b/src/applications/files/application/PhabricatorApplicationFiles.php
--- a/src/applications/files/application/PhabricatorApplicationFiles.php
+++ b/src/applications/files/application/PhabricatorApplicationFiles.php
@@ -1,8 +1,5 @@
<?php
-/**
- * @group file
- */
final class PhabricatorApplicationFiles extends PhabricatorApplication {
public function getBaseURI() {
diff --git a/src/applications/files/controller/PhabricatorFileListController.php b/src/applications/files/controller/PhabricatorFileListController.php
--- a/src/applications/files/controller/PhabricatorFileListController.php
+++ b/src/applications/files/controller/PhabricatorFileListController.php
@@ -1,7 +1,6 @@
<?php
-final class PhabricatorFileListController extends PhabricatorFileController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class PhabricatorFileListController extends PhabricatorFileController {
private $key;
@@ -23,65 +22,4 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $files,
- PhabricatorSavedQuery $query) {
-
- assert_instances_of($files, 'PhabricatorFile');
-
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $highlighted_ids = $request->getStrList('h');
- $this->loadHandles(mpull($files, 'getAuthorPHID'));
-
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $highlighted_ids = array_fill_keys($highlighted_ids, true);
-
- $list_view = id(new PHUIObjectItemListView())
- ->setUser($user);
-
- foreach ($files as $file) {
- $id = $file->getID();
- $phid = $file->getPHID();
- $name = $file->getName();
- $file_uri = $this->getApplicationURI("/info/{$phid}/");
-
- $date_created = phabricator_date($file->getDateCreated(), $user);
- $author_phid = $file->getAuthorPHID();
- if ($author_phid) {
- $author_link = $this->getHandle($author_phid)->renderLink();
- $uploaded = pht('Uploaded by %s on %s', $author_link, $date_created);
- } else {
- $uploaded = pht('Uploaded on %s', $date_created);
- }
-
- $item = id(new PHUIObjectItemView())
- ->setObject($file)
- ->setObjectName("F{$id}")
- ->setHeader($name)
- ->setHref($file_uri)
- ->addAttribute($uploaded)
- ->addIcon('none', phabricator_format_bytes($file->getByteSize()));
-
- $ttl = $file->getTTL();
- if ($ttl !== null) {
- $item->addIcon('blame', pht('Temporary'));
- }
-
- if (isset($highlighted_ids[$id])) {
- $item->setEffect('highlighted');
- }
-
- $list_view->addItem($item);
- }
-
- $list_view->appendChild(id(new PhabricatorGlobalUploadTargetView())
- ->setUser($user));
-
- return $list_view;
- }
-
}
diff --git a/src/applications/files/query/PhabricatorFileSearchEngine.php b/src/applications/files/query/PhabricatorFileSearchEngine.php
--- a/src/applications/files/query/PhabricatorFileSearchEngine.php
+++ b/src/applications/files/query/PhabricatorFileSearchEngine.php
@@ -1,11 +1,12 @@
<?php
-/**
- * @group file
- */
final class PhabricatorFileSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationFiles';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
$saved->setParameter(
@@ -113,4 +114,72 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
+ protected function getRequiredHandlePHIDsForResultList(
+ array $files,
+ PhabricatorSavedQuery $query) {
+ return mpull($files, 'getAuthorPHID');
+ }
+
+ protected function renderResultList(
+ array $files,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+
+ assert_instances_of($files, 'PhabricatorFile');
+
+ $request = $this->getRequest();
+ if ($request) {
+ $highlighted_ids = $request->getStrList('h');
+ } else {
+ $highlighted_ids = array();
+ }
+
+ $viewer = $this->requireViewer();
+
+ $highlighted_ids = array_fill_keys($highlighted_ids, true);
+
+ $list_view = id(new PHUIObjectItemListView())
+ ->setUser($viewer);
+
+ foreach ($files as $file) {
+ $id = $file->getID();
+ $phid = $file->getPHID();
+ $name = $file->getName();
+ $file_uri = $this->getApplicationURI("/info/{$phid}/");
+
+ $date_created = phabricator_date($file->getDateCreated(), $viewer);
+ $author_phid = $file->getAuthorPHID();
+ if ($author_phid) {
+ $author_link = $handles[$author_phid]->renderLink();
+ $uploaded = pht('Uploaded by %s on %s', $author_link, $date_created);
+ } else {
+ $uploaded = pht('Uploaded on %s', $date_created);
+ }
+
+ $item = id(new PHUIObjectItemView())
+ ->setObject($file)
+ ->setObjectName("F{$id}")
+ ->setHeader($name)
+ ->setHref($file_uri)
+ ->addAttribute($uploaded)
+ ->addIcon('none', phabricator_format_bytes($file->getByteSize()));
+
+ $ttl = $file->getTTL();
+ if ($ttl !== null) {
+ $item->addIcon('blame', pht('Temporary'));
+ }
+
+ if (isset($highlighted_ids[$id])) {
+ $item->setEffect('highlighted');
+ }
+
+ $list_view->addItem($item);
+ }
+
+ $list_view->appendChild(id(new PhabricatorGlobalUploadTargetView())
+ ->setUser($viewer));
+
+ return $list_view;
+ }
+
}
diff --git a/src/applications/flag/controller/PhabricatorFlagListController.php b/src/applications/flag/controller/PhabricatorFlagListController.php
--- a/src/applications/flag/controller/PhabricatorFlagListController.php
+++ b/src/applications/flag/controller/PhabricatorFlagListController.php
@@ -1,7 +1,6 @@
<?php
-final class PhabricatorFlagListController extends PhabricatorFlagController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class PhabricatorFlagListController extends PhabricatorFlagController {
private $queryKey;
@@ -23,56 +22,4 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $flags,
- PhabricatorSavedQuery $query) {
- assert_instances_of($flags, 'PhabricatorFlag');
-
- $viewer = $this->getRequest()->getUser();
-
- $list = id(new PHUIObjectItemListView())
- ->setUser($viewer);
- foreach ($flags as $flag) {
- $id = $flag->getID();
- $phid = $flag->getObjectPHID();
-
- $class = PhabricatorFlagColor::getCSSClass($flag->getColor());
-
- $flag_icon = phutil_tag(
- 'div',
- array(
- 'class' => 'phabricator-flag-icon '.$class,
- ),
- '');
-
- $item = id(new PHUIObjectItemView())
- ->addHeadIcon($flag_icon)
- ->setHeader($flag->getHandle()->renderLink());
-
- $item->addAction(
- id(new PHUIListItemView())
- ->setIcon('edit')
- ->setHref($this->getApplicationURI("edit/{$phid}/"))
- ->setWorkflow(true));
-
- $item->addAction(
- id(new PHUIListItemView())
- ->setIcon('delete')
- ->setHref($this->getApplicationURI("delete/{$id}/"))
- ->setWorkflow(true));
-
- if ($flag->getNote()) {
- $item->addAttribute($flag->getNote());
- }
-
- $item->addIcon(
- 'none',
- phabricator_datetime($flag->getDateCreated(), $viewer));
-
- $list->addItem($item);
- }
-
- return $list;
- }
-
}
diff --git a/src/applications/flag/query/PhabricatorFlagSearchEngine.php b/src/applications/flag/query/PhabricatorFlagSearchEngine.php
--- a/src/applications/flag/query/PhabricatorFlagSearchEngine.php
+++ b/src/applications/flag/query/PhabricatorFlagSearchEngine.php
@@ -3,6 +3,10 @@
final class PhabricatorFlagSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationFlags';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
$saved->setParameter('colors', $request->getArr('colors'));
@@ -115,4 +119,58 @@
return $options;
}
+ protected function renderResultList(
+ array $flags,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($flags, 'PhabricatorFlag');
+
+ $viewer = $this->requireViewer();
+
+ $list = id(new PHUIObjectItemListView())
+ ->setUser($viewer);
+ foreach ($flags as $flag) {
+ $id = $flag->getID();
+ $phid = $flag->getObjectPHID();
+
+ $class = PhabricatorFlagColor::getCSSClass($flag->getColor());
+
+ $flag_icon = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phabricator-flag-icon '.$class,
+ ),
+ '');
+
+ $item = id(new PHUIObjectItemView())
+ ->addHeadIcon($flag_icon)
+ ->setHeader($flag->getHandle()->renderLink());
+
+ $item->addAction(
+ id(new PHUIListItemView())
+ ->setIcon('edit')
+ ->setHref($this->getApplicationURI("edit/{$phid}/"))
+ ->setWorkflow(true));
+
+ $item->addAction(
+ id(new PHUIListItemView())
+ ->setIcon('delete')
+ ->setHref($this->getApplicationURI("delete/{$id}/"))
+ ->setWorkflow(true));
+
+ if ($flag->getNote()) {
+ $item->addAttribute($flag->getNote());
+ }
+
+ $item->addIcon(
+ 'none',
+ phabricator_datetime($flag->getDateCreated(), $viewer));
+
+ $list->addItem($item);
+ }
+
+ return $list;
+ }
+
+
}
diff --git a/src/applications/harbormaster/controller/HarbormasterBuildableListController.php b/src/applications/harbormaster/controller/HarbormasterBuildableListController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildableListController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildableListController.php
@@ -1,8 +1,6 @@
<?php
-final class HarbormasterBuildableListController
- extends HarbormasterController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class HarbormasterBuildableListController extends HarbormasterController {
private $queryKey;
@@ -24,58 +22,6 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $buildables,
- PhabricatorSavedQuery $query) {
- assert_instances_of($buildables, 'HarbormasterBuildable');
-
- $viewer = $this->getRequest()->getUser();
-
- $list = new PHUIObjectItemListView();
- $list->setCards(true);
- foreach ($buildables as $buildable) {
- $id = $buildable->getID();
-
- $item = id(new PHUIObjectItemView())
- ->setHeader(pht('Buildable %d', $buildable->getID()));
- if ($buildable->getContainerHandle() !== null) {
- $item->addAttribute($buildable->getContainerHandle()->getName());
- }
- if ($buildable->getBuildableHandle() !== null) {
- $item->addAttribute($buildable->getBuildableHandle()->getFullName());
- }
-
- if ($id) {
- $item->setHref("/B{$id}");
- }
-
- if ($buildable->getIsManualBuildable()) {
- $item->addIcon('wrench-grey', pht('Manual'));
- }
-
- switch ($buildable->getBuildableStatus()) {
- case HarbormasterBuildable::STATUS_PASSED:
- $item->setBarColor('green');
- $item->addByline(pht('Build Passed'));
- break;
- case HarbormasterBuildable::STATUS_FAILED:
- $item->setBarColor('red');
- $item->addByline(pht('Build Failed'));
- break;
- case HarbormasterBuildable::STATUS_BUILDING:
- $item->setBarColor('red');
- $item->addByline(pht('Building'));
- break;
-
- }
-
- $list->addItem($item);
-
- }
-
- return $list;
- }
-
public function buildSideNavView($for_app = false) {
$user = $this->getRequest()->getUser();
diff --git a/src/applications/harbormaster/controller/HarbormasterPlanListController.php b/src/applications/harbormaster/controller/HarbormasterPlanListController.php
--- a/src/applications/harbormaster/controller/HarbormasterPlanListController.php
+++ b/src/applications/harbormaster/controller/HarbormasterPlanListController.php
@@ -1,8 +1,6 @@
<?php
-final class HarbormasterPlanListController
- extends HarbormasterPlanController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class HarbormasterPlanListController extends HarbormasterPlanController {
private $queryKey;
@@ -24,33 +22,6 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $plans,
- PhabricatorSavedQuery $query) {
- assert_instances_of($plans, 'HarbormasterBuildPlan');
-
- $viewer = $this->getRequest()->getUser();
-
- $list = new PHUIObjectItemListView();
- foreach ($plans as $plan) {
- $id = $plan->getID();
-
- $item = id(new PHUIObjectItemView())
- ->setObjectName(pht('Plan %d', $plan->getID()))
- ->setHeader($plan->getName());
-
- if ($plan->isDisabled()) {
- $item->setDisabled(true);
- }
-
- $item->setHref($this->getApplicationURI("plan/{$id}/"));
-
- $list->addItem($item);
- }
-
- return $list;
- }
-
public function buildSideNavView($for_app = false) {
$user = $this->getRequest()->getUser();
diff --git a/src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php b/src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php
--- a/src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php
+++ b/src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php
@@ -3,6 +3,10 @@
final class HarbormasterBuildPlanSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationHarbormaster';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -79,4 +83,32 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
+ protected function renderResultList(
+ array $plans,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($plans, 'HarbormasterBuildPlan');
+
+ $viewer = $this->requireViewer();
+
+ $list = new PHUIObjectItemListView();
+ foreach ($plans as $plan) {
+ $id = $plan->getID();
+
+ $item = id(new PHUIObjectItemView())
+ ->setObjectName(pht('Plan %d', $plan->getID()))
+ ->setHeader($plan->getName());
+
+ if ($plan->isDisabled()) {
+ $item->setDisabled(true);
+ }
+
+ $item->setHref($this->getApplicationURI("plan/{$id}/"));
+
+ $list->addItem($item);
+ }
+
+ return $list;
+ }
+
}
diff --git a/src/applications/harbormaster/query/HarbormasterBuildableSearchEngine.php b/src/applications/harbormaster/query/HarbormasterBuildableSearchEngine.php
--- a/src/applications/harbormaster/query/HarbormasterBuildableSearchEngine.php
+++ b/src/applications/harbormaster/query/HarbormasterBuildableSearchEngine.php
@@ -3,6 +3,10 @@
final class HarbormasterBuildableSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationHarbormaster';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -172,4 +176,56 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
+ protected function renderResultList(
+ array $buildables,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($buildables, 'HarbormasterBuildable');
+
+ $viewer = $this->requireViewer();
+
+ $list = new PHUIObjectItemListView();
+ $list->setCards(true);
+ foreach ($buildables as $buildable) {
+ $id = $buildable->getID();
+
+ $item = id(new PHUIObjectItemView())
+ ->setHeader(pht('Buildable %d', $buildable->getID()));
+ if ($buildable->getContainerHandle() !== null) {
+ $item->addAttribute($buildable->getContainerHandle()->getName());
+ }
+ if ($buildable->getBuildableHandle() !== null) {
+ $item->addAttribute($buildable->getBuildableHandle()->getFullName());
+ }
+
+ if ($id) {
+ $item->setHref("/B{$id}");
+ }
+
+ if ($buildable->getIsManualBuildable()) {
+ $item->addIcon('wrench-grey', pht('Manual'));
+ }
+
+ switch ($buildable->getBuildableStatus()) {
+ case HarbormasterBuildable::STATUS_PASSED:
+ $item->setBarColor('green');
+ $item->addByline(pht('Build Passed'));
+ break;
+ case HarbormasterBuildable::STATUS_FAILED:
+ $item->setBarColor('red');
+ $item->addByline(pht('Build Failed'));
+ break;
+ case HarbormasterBuildable::STATUS_BUILDING:
+ $item->setBarColor('red');
+ $item->addByline(pht('Building'));
+ break;
+
+ }
+
+ $list->addItem($item);
+
+ }
+
+ return $list;
+ }
}
diff --git a/src/applications/herald/controller/HeraldRuleListController.php b/src/applications/herald/controller/HeraldRuleListController.php
--- a/src/applications/herald/controller/HeraldRuleListController.php
+++ b/src/applications/herald/controller/HeraldRuleListController.php
@@ -1,7 +1,6 @@
<?php
-final class HeraldRuleListController extends HeraldController
- implements PhabricatorApplicationSearchResultsControllerInterface {
+final class HeraldRuleListController extends HeraldController {
private $queryKey;
@@ -23,57 +22,5 @@
return $this->delegateToController($controller);
}
- public function renderResultsList(
- array $rules,
- PhabricatorSavedQuery $query) {
- assert_instances_of($rules, 'HeraldRule');
-
- $viewer = $this->getRequest()->getUser();
-
- $phids = mpull($rules, 'getAuthorPHID');
- $this->loadHandles($phids);
-
- $content_type_map = HeraldAdapter::getEnabledAdapterMap($viewer);
-
- $list = id(new PHUIObjectItemListView())
- ->setUser($viewer)
- ->setCards(true);
- foreach ($rules as $rule) {
- $id = $rule->getID();
-
- $item = id(new PHUIObjectItemView())
- ->setObjectName("H{$id}")
- ->setHeader($rule->getName())
- ->setHref($this->getApplicationURI("rule/{$id}/"));
-
- if ($rule->isPersonalRule()) {
- $item->addIcon('user', pht('Personal Rule'));
- $item->addByline(
- pht(
- 'Authored by %s',
- $this->getHandle($rule->getAuthorPHID())->renderLink()));
- } else {
- $item->addIcon('world', pht('Global Rule'));
- }
-
- if ($rule->getIsDisabled()) {
- $item->setDisabled(true);
- $item->addIcon('disable-grey', pht('Disabled'));
- }
-
- $item->addAction(
- id(new PHUIListItemView())
- ->setHref($this->getApplicationURI("history/{$id}/"))
- ->setIcon('transcript')
- ->setName(pht('Edit Log')));
-
- $content_type_name = idx($content_type_map, $rule->getContentType());
- $item->addAttribute(pht('Affects: %s', $content_type_name));
-
- $list->addItem($item);
- }
-
- return $list;
- }
}
diff --git a/src/applications/herald/query/HeraldRuleSearchEngine.php b/src/applications/herald/query/HeraldRuleSearchEngine.php
--- a/src/applications/herald/query/HeraldRuleSearchEngine.php
+++ b/src/applications/herald/query/HeraldRuleSearchEngine.php
@@ -3,6 +3,10 @@
final class HeraldRuleSearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationHerald';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -152,4 +156,61 @@
return array_fuse(array_keys(HeraldRuleTypeConfig::getRuleTypeMap()));
}
+ protected function getRequiredHandlePHIDsForResultList(
+ array $rules,
+ PhabricatorSavedQuery $query) {
+ return mpull($rules, 'getAuthorPHID');
+ }
+
+ protected function renderResultList(
+ array $rules,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($rules, 'HeraldRule');
+
+ $viewer = $this->requireViewer();
+
+ $content_type_map = HeraldAdapter::getEnabledAdapterMap($viewer);
+
+ $list = id(new PHUIObjectItemListView())
+ ->setUser($viewer)
+ ->setCards(true);
+ foreach ($rules as $rule) {
+ $id = $rule->getID();
+
+ $item = id(new PHUIObjectItemView())
+ ->setObjectName("H{$id}")
+ ->setHeader($rule->getName())
+ ->setHref($this->getApplicationURI("rule/{$id}/"));
+
+ if ($rule->isPersonalRule()) {
+ $item->addIcon('user', pht('Personal Rule'));
+ $item->addByline(
+ pht(
+ 'Authored by %s',
+ $handles[$rule->getAuthorPHID()]->renderLink()));
+ } else {
+ $item->addIcon('world', pht('Global Rule'));
+ }
+
+ if ($rule->getIsDisabled()) {
+ $item->setDisabled(true);
+ $item->addIcon('disable-grey', pht('Disabled'));
+ }
+
+ $item->addAction(
+ id(new PHUIListItemView())
+ ->setHref($this->getApplicationURI("history/{$id}/"))
+ ->setIcon('transcript')
+ ->setName(pht('Edit Log')));
+
+ $content_type_name = idx($content_type_map, $rule->getContentType());
+ $item->addAttribute(pht('Affects: %s', $content_type_name));
+
+ $list->addItem($item);
+ }
+
+ return $list;
+ }
+
}
diff --git a/src/applications/repository/query/PhabricatorRepositorySearchEngine.php b/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
@@ -3,6 +3,10 @@
final class PhabricatorRepositorySearchEngine
extends PhabricatorApplicationSearchEngine {
+ public function getApplicationClassName() {
+ return 'PhabricatorApplicationDiffusion';
+ }
+
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
@@ -215,4 +219,83 @@
);
}
+ protected function getRequiredHandlePHIDsForResultList(
+ array $repositories,
+ PhabricatorSavedQuery $query) {
+ return array_mergev(mpull($repositories, 'getProjectPHIDs'));
+ }
+
+ protected function renderResultList(
+ array $repositories,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($repositories, 'PhabricatorRepository');
+
+ $viewer = $this->requireViewer();;
+
+ $list = new PHUIObjectItemListView();
+ $list->setCards(true);
+ foreach ($repositories as $repository) {
+ $id = $repository->getID();
+
+ $item = id(new PHUIObjectItemView())
+ ->setUser($viewer)
+ ->setHeader($repository->getName())
+ ->setObjectName('r'.$repository->getCallsign())
+ ->setHref($this->getApplicationURI($repository->getCallsign().'/'));
+
+ $commit = $repository->getMostRecentCommit();
+ if ($commit) {
+ $commit_link = DiffusionView::linkCommit(
+ $repository,
+ $commit->getCommitIdentifier(),
+ $commit->getSummary());
+ $item->setSubhead($commit_link);
+ $item->setEpoch($commit->getEpoch());
+ }
+
+ $item->addIcon(
+ 'none',
+ PhabricatorRepositoryType::getNameForRepositoryType(
+ $repository->getVersionControlSystem()));
+
+ $size = $repository->getCommitCount();
+ if ($size) {
+ $history_uri = DiffusionRequest::generateDiffusionURI(
+ array(
+ 'callsign' => $repository->getCallsign(),
+ 'action' => 'history',
+ ));
+
+ $item->addAttribute(
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => $history_uri,
+ ),
+ pht('%s Commit(s)', new PhutilNumber($size))));
+ } else {
+ $item->addAttribute(pht('No Commits'));
+ }
+
+ $project_handles = array_select_keys(
+ $handles,
+ $repository->getProjectPHIDs());
+ if ($project_handles) {
+ $item->addAttribute(
+ id(new ManiphestTaskProjectsView())
+ ->setHandles($project_handles));
+ }
+
+ if (!$repository->isTracked()) {
+ $item->setDisabled(true);
+ $item->addIcon('disable-grey', pht('Inactive'));
+ }
+
+ $list->addItem($item);
+ }
+
+ return $list;
+ }
+
}
diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -220,6 +220,8 @@
if ($parent instanceof $interface) {
$list = $parent->renderResultsList($objects, $saved_query);
} else {
+ $engine->setRequest($request);
+
$list = $engine->renderResults(
$objects,
$saved_query);
diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
--- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
+++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
@@ -21,6 +21,7 @@
private $viewer;
private $errors = array();
private $customFields = false;
+ private $request;
public function setViewer(PhabricatorUser $viewer) {
$this->viewer = $viewer;
@@ -593,6 +594,15 @@
/* -( Rendering )---------------------------------------------------------- */
+ public function setRequest(AphrontRequest $request) {
+ $this->request = $request;
+ return $this;
+ }
+
+ public function getRequest() {
+ return $this->request;
+ }
+
public function renderResults(
array $objects,
PhabricatorSavedQuery $query) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 18, 5:53 AM (3 w, 6 d ago)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/2w/rr/gnbyqoosvdjvtkxp
Default Alt Text
D9017.diff (52 KB)
Attached To
Mode
D9017: Move a bunch more rendering into SearchEngine
Attached
Detach File
Event Timeline
Log In to Comment