From b9fcaadce88b4ae7d34ce998aa0e3a7cfdb54fce Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 28 Nov 2015 17:49:56 -0800 Subject: [PATCH] Modernize Maniphest Summary: Updates (some) of Maniphest for modern methods. Didn't convert Reports (probably need a setNavigation call added). Test Plan: View List, edit task, new task, view reports. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14597 --- .../controller/ManiphestController.php | 12 +++----- .../ManiphestTaskDetailController.php | 30 +++++++++++-------- .../ManiphestTaskEditController.php | 21 ++++++------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/applications/maniphest/controller/ManiphestController.php b/src/applications/maniphest/controller/ManiphestController.php index 87eaf69706..b65811128d 100644 --- a/src/applications/maniphest/controller/ManiphestController.php +++ b/src/applications/maniphest/controller/ManiphestController.php @@ -6,21 +6,17 @@ abstract class ManiphestController extends PhabricatorController { return $this->buildSideNavView(true)->getMenu(); } - public function buildSideNavView($for_app = false) { - $user = $this->getRequest()->getUser(); + public function buildSideNavView() { + $viewer = $this->getViewer(); $nav = new AphrontSideNavFilterView(); $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); - if ($for_app) { - $nav->addFilter('task/create/', pht('Create Task')); - } - id(new ManiphestTaskSearchEngine()) - ->setViewer($user) + ->setViewer($viewer) ->addNavigationItems($nav->getMenu()); - if ($user->isLoggedIn()) { + if ($viewer->isLoggedIn()) { // For now, don't give logged-out users access to reports. $nav->addLabel(pht('Reports')); $nav->addFilter('report', pht('Reports')); diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php index 090bdb9bb7..d5fab7f9f5 100644 --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -349,19 +349,23 @@ final class ManiphestTaskDetailController extends ManiphestController { $object_box->addPropertyList($description); } - return $this->buildApplicationPage( - array( - $crumbs, - $info_view, - $object_box, - $timeline, - $comment_box, - $preview_panel, - ), - array( - 'title' => 'T'.$task->getID().' '.$task->getTitle(), - 'pageObjects' => array($task->getPHID()), - )); + $title = 'T'.$task->getID().' '.$task->getTitle(); + + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->setPageObjectPHIDs( + array( + $task->getPHID(), + )) + ->appendChild( + array( + $info_view, + $object_box, + $timeline, + $comment_box, + $preview_panel, + )); } private function buildHeaderView(ManiphestTask $task) { diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index 5c4a3b4862..e9ce5a567a 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -741,16 +741,17 @@ final class ManiphestTaskEditController extends ManiphestController { $crumbs->addTextCrumb($header_name); - return $this->buildApplicationPage( - array( - $crumbs, - $form_box, - $preview, - ), - array( - 'title' => $header_name, - 'pageObjects' => $page_objects, - )); + $title = $header_name; + + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->setPageObjectPHIDs($page_objects) + ->appendChild( + array( + $form_box, + $preview, + )); } }