mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +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 {
|
abstract class PholioController extends PhabricatorController {
|
||||||
|
|
||||||
public function buildSideNavView($for_app = false) {
|
public function buildApplicationMenu() {
|
||||||
$user = $this->getRequest()->getUser();
|
return $this->newApplicationMenu()
|
||||||
|
->setSearchEngine(new PholioMockSearchEngine());
|
||||||
$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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildApplicationCrumbs() {
|
protected function buildApplicationCrumbs() {
|
||||||
|
@ -33,8 +19,4 @@ abstract class PholioController extends PhabricatorController {
|
||||||
return $crumbs;
|
return $crumbs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildApplicationMenu() {
|
|
||||||
return $this->buildSideNavView(true)->getMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -384,10 +384,13 @@ final class PholioMockEditController extends PholioController {
|
||||||
|
|
||||||
$this->addExtraQuicksandConfig(
|
$this->addExtraQuicksandConfig(
|
||||||
array('mockEditConfig' => true));
|
array('mockEditConfig' => true));
|
||||||
return $this->buildApplicationPage(
|
|
||||||
$content,
|
return $this->newPage()
|
||||||
array(
|
->setTitle($title)
|
||||||
'title' => $title,
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild(
|
||||||
|
array(
|
||||||
|
$form_box,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,9 @@ final class PholioMockListController extends PholioController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$querykey = $request->getURIData('queryKey');
|
return id(new PholioMockSearchEngine())
|
||||||
|
->setController($this)
|
||||||
$controller = id(new PhabricatorApplicationSearchController())
|
->buildResponse();
|
||||||
->setQueryKey($querykey)
|
|
||||||
->setSearchEngine(new PholioMockSearchEngine())
|
|
||||||
->setNavigation($this->buildSideNavView());
|
|
||||||
|
|
||||||
return $this->delegateToController($controller);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,20 +98,17 @@ final class PholioMockViewController extends PholioController {
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->setMock($mock);
|
->setMock($mock);
|
||||||
|
|
||||||
$content = array(
|
return $this->newPage()
|
||||||
$crumbs,
|
->setTitle('M'.$mock->getID().' '.$title)
|
||||||
$object_box,
|
->setCrumbs($crumbs)
|
||||||
$output,
|
->setPageObjectPHIDs(array($mock->getPHID()))
|
||||||
$thumb_grid,
|
->appendChild(
|
||||||
$timeline,
|
array(
|
||||||
$add_comment,
|
$object_box,
|
||||||
);
|
$output,
|
||||||
|
$thumb_grid,
|
||||||
return $this->buildApplicationPage(
|
$timeline,
|
||||||
$content,
|
$add_comment,
|
||||||
array(
|
|
||||||
'title' => 'M'.$mock->getID().' '.$title,
|
|
||||||
'pageObjects' => array($mock->getPHID()),
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue