mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Modernize Pholio
Summary: Use modern methods in Pholio Test Plan: View list, create mock, edit mock, view mobile menu Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9690 Differential Revision: https://secure.phabricator.com/D14595
This commit is contained in:
parent
b35f578ae9
commit
5686fb7fa4
4 changed files with 24 additions and 47 deletions
|
@ -2,23 +2,9 @@
|
|||
|
||||
abstract class PholioController extends PhabricatorController {
|
||||
|
||||
public function buildSideNavView($for_app = false) {
|
||||
$user = $this->getRequest()->getUser();
|
||||
|
||||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
|
||||
id(new PholioMockSearchEngine())
|
||||
->setViewer($user)
|
||||
->addNavigationItems($nav->getMenu());
|
||||
|
||||
if ($for_app) {
|
||||
$nav->addFilter('new/', pht('Create Mock'));
|
||||
}
|
||||
|
||||
$nav->selectFilter(null);
|
||||
|
||||
return $nav;
|
||||
public function buildApplicationMenu() {
|
||||
return $this->newApplicationMenu()
|
||||
->setSearchEngine(new PholioMockSearchEngine());
|
||||
}
|
||||
|
||||
protected function buildApplicationCrumbs() {
|
||||
|
@ -33,8 +19,4 @@ abstract class PholioController extends PhabricatorController {
|
|||
return $crumbs;
|
||||
}
|
||||
|
||||
public function buildApplicationMenu() {
|
||||
return $this->buildSideNavView(true)->getMenu();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -384,10 +384,13 @@ final class PholioMockEditController extends PholioController {
|
|||
|
||||
$this->addExtraQuicksandConfig(
|
||||
array('mockEditConfig' => true));
|
||||
return $this->buildApplicationPage(
|
||||
$content,
|
||||
array(
|
||||
'title' => $title,
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$form_box,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -7,14 +7,9 @@ final class PholioMockListController extends PholioController {
|
|||
}
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$querykey = $request->getURIData('queryKey');
|
||||
|
||||
$controller = id(new PhabricatorApplicationSearchController())
|
||||
->setQueryKey($querykey)
|
||||
->setSearchEngine(new PholioMockSearchEngine())
|
||||
->setNavigation($this->buildSideNavView());
|
||||
|
||||
return $this->delegateToController($controller);
|
||||
return id(new PholioMockSearchEngine())
|
||||
->setController($this)
|
||||
->buildResponse();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -98,20 +98,17 @@ final class PholioMockViewController extends PholioController {
|
|||
->setUser($viewer)
|
||||
->setMock($mock);
|
||||
|
||||
$content = array(
|
||||
$crumbs,
|
||||
$object_box,
|
||||
$output,
|
||||
$thumb_grid,
|
||||
$timeline,
|
||||
$add_comment,
|
||||
);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$content,
|
||||
array(
|
||||
'title' => 'M'.$mock->getID().' '.$title,
|
||||
'pageObjects' => array($mock->getPHID()),
|
||||
return $this->newPage()
|
||||
->setTitle('M'.$mock->getID().' '.$title)
|
||||
->setCrumbs($crumbs)
|
||||
->setPageObjectPHIDs(array($mock->getPHID()))
|
||||
->appendChild(
|
||||
array(
|
||||
$object_box,
|
||||
$output,
|
||||
$thumb_grid,
|
||||
$timeline,
|
||||
$add_comment,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue