mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
Use modern SearchEngine construction in Nuance
Summary: Ref T10537. Minor cleanup of controllers to be more modern / work better on mobile. Test Plan: Browsed all queue / source pages. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10537 Differential Revision: https://secure.phabricator.com/D15428
This commit is contained in:
parent
2ddd78647b
commit
98542637a1
10 changed files with 51 additions and 58 deletions
|
@ -1433,6 +1433,7 @@ phutil_register_library_map(array(
|
||||||
'NuancePhabricatorFormSourceDefinition' => 'applications/nuance/source/NuancePhabricatorFormSourceDefinition.php',
|
'NuancePhabricatorFormSourceDefinition' => 'applications/nuance/source/NuancePhabricatorFormSourceDefinition.php',
|
||||||
'NuanceQuery' => 'applications/nuance/query/NuanceQuery.php',
|
'NuanceQuery' => 'applications/nuance/query/NuanceQuery.php',
|
||||||
'NuanceQueue' => 'applications/nuance/storage/NuanceQueue.php',
|
'NuanceQueue' => 'applications/nuance/storage/NuanceQueue.php',
|
||||||
|
'NuanceQueueController' => 'applications/nuance/controller/NuanceQueueController.php',
|
||||||
'NuanceQueueDatasource' => 'applications/nuance/typeahead/NuanceQueueDatasource.php',
|
'NuanceQueueDatasource' => 'applications/nuance/typeahead/NuanceQueueDatasource.php',
|
||||||
'NuanceQueueEditController' => 'applications/nuance/controller/NuanceQueueEditController.php',
|
'NuanceQueueEditController' => 'applications/nuance/controller/NuanceQueueEditController.php',
|
||||||
'NuanceQueueEditor' => 'applications/nuance/editor/NuanceQueueEditor.php',
|
'NuanceQueueEditor' => 'applications/nuance/editor/NuanceQueueEditor.php',
|
||||||
|
@ -1457,6 +1458,7 @@ phutil_register_library_map(array(
|
||||||
'NuanceSchemaSpec' => 'applications/nuance/storage/NuanceSchemaSpec.php',
|
'NuanceSchemaSpec' => 'applications/nuance/storage/NuanceSchemaSpec.php',
|
||||||
'NuanceSource' => 'applications/nuance/storage/NuanceSource.php',
|
'NuanceSource' => 'applications/nuance/storage/NuanceSource.php',
|
||||||
'NuanceSourceActionController' => 'applications/nuance/controller/NuanceSourceActionController.php',
|
'NuanceSourceActionController' => 'applications/nuance/controller/NuanceSourceActionController.php',
|
||||||
|
'NuanceSourceController' => 'applications/nuance/controller/NuanceSourceController.php',
|
||||||
'NuanceSourceCreateController' => 'applications/nuance/controller/NuanceSourceCreateController.php',
|
'NuanceSourceCreateController' => 'applications/nuance/controller/NuanceSourceCreateController.php',
|
||||||
'NuanceSourceDefaultEditCapability' => 'applications/nuance/capability/NuanceSourceDefaultEditCapability.php',
|
'NuanceSourceDefaultEditCapability' => 'applications/nuance/capability/NuanceSourceDefaultEditCapability.php',
|
||||||
'NuanceSourceDefaultViewCapability' => 'applications/nuance/capability/NuanceSourceDefaultViewCapability.php',
|
'NuanceSourceDefaultViewCapability' => 'applications/nuance/capability/NuanceSourceDefaultViewCapability.php',
|
||||||
|
@ -5678,17 +5680,18 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorPolicyInterface',
|
'PhabricatorPolicyInterface',
|
||||||
'PhabricatorApplicationTransactionInterface',
|
'PhabricatorApplicationTransactionInterface',
|
||||||
),
|
),
|
||||||
|
'NuanceQueueController' => 'NuanceController',
|
||||||
'NuanceQueueDatasource' => 'PhabricatorTypeaheadDatasource',
|
'NuanceQueueDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||||
'NuanceQueueEditController' => 'NuanceController',
|
'NuanceQueueEditController' => 'NuanceQueueController',
|
||||||
'NuanceQueueEditor' => 'PhabricatorApplicationTransactionEditor',
|
'NuanceQueueEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||||
'NuanceQueueListController' => 'NuanceController',
|
'NuanceQueueListController' => 'NuanceQueueController',
|
||||||
'NuanceQueuePHIDType' => 'PhabricatorPHIDType',
|
'NuanceQueuePHIDType' => 'PhabricatorPHIDType',
|
||||||
'NuanceQueueQuery' => 'NuanceQuery',
|
'NuanceQueueQuery' => 'NuanceQuery',
|
||||||
'NuanceQueueSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
'NuanceQueueSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||||
'NuanceQueueTransaction' => 'NuanceTransaction',
|
'NuanceQueueTransaction' => 'NuanceTransaction',
|
||||||
'NuanceQueueTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
'NuanceQueueTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||||
'NuanceQueueTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
'NuanceQueueTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||||
'NuanceQueueViewController' => 'NuanceController',
|
'NuanceQueueViewController' => 'NuanceQueueController',
|
||||||
'NuanceRequestor' => array(
|
'NuanceRequestor' => array(
|
||||||
'NuanceDAO',
|
'NuanceDAO',
|
||||||
'PhabricatorPolicyInterface',
|
'PhabricatorPolicyInterface',
|
||||||
|
@ -5710,14 +5713,15 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorPolicyInterface',
|
'PhabricatorPolicyInterface',
|
||||||
),
|
),
|
||||||
'NuanceSourceActionController' => 'NuanceController',
|
'NuanceSourceActionController' => 'NuanceController',
|
||||||
'NuanceSourceCreateController' => 'NuanceController',
|
'NuanceSourceController' => 'NuanceController',
|
||||||
|
'NuanceSourceCreateController' => 'NuanceSourceController',
|
||||||
'NuanceSourceDefaultEditCapability' => 'PhabricatorPolicyCapability',
|
'NuanceSourceDefaultEditCapability' => 'PhabricatorPolicyCapability',
|
||||||
'NuanceSourceDefaultViewCapability' => 'PhabricatorPolicyCapability',
|
'NuanceSourceDefaultViewCapability' => 'PhabricatorPolicyCapability',
|
||||||
'NuanceSourceDefinition' => 'Phobject',
|
'NuanceSourceDefinition' => 'Phobject',
|
||||||
'NuanceSourceDefinitionTestCase' => 'PhabricatorTestCase',
|
'NuanceSourceDefinitionTestCase' => 'PhabricatorTestCase',
|
||||||
'NuanceSourceEditController' => 'NuanceController',
|
'NuanceSourceEditController' => 'NuanceSourceController',
|
||||||
'NuanceSourceEditor' => 'PhabricatorApplicationTransactionEditor',
|
'NuanceSourceEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||||
'NuanceSourceListController' => 'NuanceController',
|
'NuanceSourceListController' => 'NuanceSourceController',
|
||||||
'NuanceSourceManageCapability' => 'PhabricatorPolicyCapability',
|
'NuanceSourceManageCapability' => 'PhabricatorPolicyCapability',
|
||||||
'NuanceSourcePHIDType' => 'PhabricatorPHIDType',
|
'NuanceSourcePHIDType' => 'PhabricatorPHIDType',
|
||||||
'NuanceSourceQuery' => 'NuanceQuery',
|
'NuanceSourceQuery' => 'NuanceQuery',
|
||||||
|
@ -5725,7 +5729,7 @@ phutil_register_library_map(array(
|
||||||
'NuanceSourceTransaction' => 'NuanceTransaction',
|
'NuanceSourceTransaction' => 'NuanceTransaction',
|
||||||
'NuanceSourceTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
'NuanceSourceTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||||
'NuanceSourceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
'NuanceSourceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||||
'NuanceSourceViewController' => 'NuanceController',
|
'NuanceSourceViewController' => 'NuanceSourceController',
|
||||||
'NuanceTransaction' => 'PhabricatorApplicationTransaction',
|
'NuanceTransaction' => 'PhabricatorApplicationTransaction',
|
||||||
'OwnersConduitAPIMethod' => 'ConduitAPIMethod',
|
'OwnersConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
'OwnersEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
'OwnersEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||||
|
|
11
src/applications/nuance/controller/NuanceQueueController.php
Normal file
11
src/applications/nuance/controller/NuanceQueueController.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
abstract class NuanceQueueController
|
||||||
|
extends NuanceController {
|
||||||
|
|
||||||
|
public function buildApplicationMenu() {
|
||||||
|
return $this->newApplicationMenu()
|
||||||
|
->setSearchEngine(new NuanceQueueSearchEngine());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class NuanceQueueEditController extends NuanceController {
|
final class NuanceQueueEditController
|
||||||
|
extends NuanceQueueController {
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
|
@ -1,31 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class NuanceQueueListController
|
final class NuanceQueueListController
|
||||||
extends NuanceController {
|
extends NuanceQueueController {
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$request = $this->getRequest();
|
return id(new NuanceQueueSearchEngine())
|
||||||
$controller = id(new PhabricatorApplicationSearchController($request))
|
->setController($this)
|
||||||
->setQueryKey($request->getURIData('queryKey'))
|
->buildResponse();
|
||||||
->setSearchEngine(new NuanceQueueSearchEngine())
|
|
||||||
->setNavigation($this->buildSideNavView());
|
|
||||||
|
|
||||||
return $this->delegateToController($controller);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildSideNavView($for_app = false) {
|
|
||||||
$user = $this->getRequest()->getUser();
|
|
||||||
|
|
||||||
$nav = new AphrontSideNavFilterView();
|
|
||||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
||||||
|
|
||||||
id(new NuanceQueueSearchEngine())
|
|
||||||
->setViewer($user)
|
|
||||||
->addNavigationItems($nav->getMenu());
|
|
||||||
|
|
||||||
$nav->selectFilter(null);
|
|
||||||
|
|
||||||
return $nav;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildApplicationCrumbs() {
|
protected function buildApplicationCrumbs() {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class NuanceQueueViewController extends NuanceController {
|
final class NuanceQueueViewController
|
||||||
|
extends NuanceQueueController {
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
abstract class NuanceSourceController
|
||||||
|
extends NuanceController {
|
||||||
|
|
||||||
|
public function buildApplicationMenu() {
|
||||||
|
return $this->newApplicationMenu()
|
||||||
|
->setSearchEngine(new NuanceSourceSearchEngine());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class NuanceSourceCreateController extends NuanceController {
|
final class NuanceSourceCreateController
|
||||||
|
extends NuanceSourceController {
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$can_edit = $this->requireApplicationCapability(
|
$can_edit = $this->requireApplicationCapability(
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class NuanceSourceEditController extends NuanceController {
|
final class NuanceSourceEditController
|
||||||
|
extends NuanceSourceController {
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$can_edit = $this->requireApplicationCapability(
|
$can_edit = $this->requireApplicationCapability(
|
||||||
|
|
|
@ -1,31 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class NuanceSourceListController
|
final class NuanceSourceListController
|
||||||
extends NuanceController {
|
extends NuanceSourceController {
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$request = $this->getRequest();
|
return id(new NuanceSourceSearchEngine())
|
||||||
$controller = id(new PhabricatorApplicationSearchController($request))
|
->setController($this)
|
||||||
->setQueryKey($request->getURIData('queryKey'))
|
->buildResponse();
|
||||||
->setSearchEngine(new NuanceSourceSearchEngine())
|
|
||||||
->setNavigation($this->buildSideNavView());
|
|
||||||
|
|
||||||
return $this->delegateToController($controller);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildSideNavView($for_app = false) {
|
|
||||||
$user = $this->getRequest()->getUser();
|
|
||||||
|
|
||||||
$nav = new AphrontSideNavFilterView();
|
|
||||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
||||||
|
|
||||||
id(new NuanceSourceSearchEngine())
|
|
||||||
->setViewer($user)
|
|
||||||
->addNavigationItems($nav->getMenu());
|
|
||||||
|
|
||||||
$nav->selectFilter(null);
|
|
||||||
|
|
||||||
return $nav;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildApplicationCrumbs() {
|
protected function buildApplicationCrumbs() {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class NuanceSourceViewController extends NuanceController {
|
final class NuanceSourceViewController
|
||||||
|
extends NuanceSourceController {
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
Loading…
Reference in a new issue