From 760655aa0987ff32bd916e354df4e1a7f4d4b8f0 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 28 Nov 2015 14:57:04 -0800 Subject: [PATCH] Modernize Badges Summary: Ref T9690, updates Badges in various ways. Test Plan: View List, View Badge, Create Badge, Assign Badge Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9690 Differential Revision: https://secure.phabricator.com/D14591 --- .../AlmanacServiceViewController.php | 6 ++--- .../PhabricatorBadgesEditController.php | 13 +++++----- ...bricatorBadgesEditRecipientsController.php | 15 ++++++----- .../PhabricatorBadgesListController.php | 25 +++---------------- .../PhabricatorBadgesViewController.php | 21 ++++++++-------- 5 files changed, 29 insertions(+), 51 deletions(-) diff --git a/src/applications/almanac/controller/AlmanacServiceViewController.php b/src/applications/almanac/controller/AlmanacServiceViewController.php index a6fa6d8ac9..bfeed96e2f 100644 --- a/src/applications/almanac/controller/AlmanacServiceViewController.php +++ b/src/applications/almanac/controller/AlmanacServiceViewController.php @@ -62,9 +62,9 @@ final class AlmanacServiceViewController ->appendChild( array( $box, - $bindings, - $this->buildAlmanacPropertiesTable($service), - $timeline, + $bindings, + $this->buildAlmanacPropertiesTable($service), + $timeline, )); } diff --git a/src/applications/badges/controller/PhabricatorBadgesEditController.php b/src/applications/badges/controller/PhabricatorBadgesEditController.php index 77ced98533..5085a6ed21 100644 --- a/src/applications/badges/controller/PhabricatorBadgesEditController.php +++ b/src/applications/badges/controller/PhabricatorBadgesEditController.php @@ -199,13 +199,12 @@ final class PhabricatorBadgesEditController ->setHeaderText($title) ->appendChild($form); - return $this->buildApplicationPage( - array( - $crumbs, - $box, - ), - array( - 'title' => $title, + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->appendChild( + array( + $box, )); } diff --git a/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php b/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php index d54b4fafeb..872b715e5b 100644 --- a/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php +++ b/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php @@ -106,14 +106,13 @@ final class PhabricatorBadgesEditRecipientsController $crumbs->addTextCrumb($badge->getName(), $badge_url); $crumbs->addTextCrumb(pht('Recipients')); - return $this->buildApplicationPage( - array( - $crumbs, - $form_box, - $recipient_list, - ), - array( - 'title' => $title, + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->appendChild( + array( + $form_box, + $recipient_list, )); } diff --git a/src/applications/badges/controller/PhabricatorBadgesListController.php b/src/applications/badges/controller/PhabricatorBadgesListController.php index 828fb3fd3a..c47f38fc5d 100644 --- a/src/applications/badges/controller/PhabricatorBadgesListController.php +++ b/src/applications/badges/controller/PhabricatorBadgesListController.php @@ -8,28 +8,9 @@ final class PhabricatorBadgesListController } public function handleRequest(AphrontRequest $request) { - $query_key = $request->getURIData('queryKey'); - $controller = id(new PhabricatorApplicationSearchController()) - ->setQueryKey($query_key) - ->setSearchEngine(new PhabricatorBadgesSearchEngine()) - ->setNavigation($this->buildSideNavView()); - - return $this->delegateToController($controller); - } - - public function buildSideNavView() { - $user = $this->getRequest()->getUser(); - - $nav = new AphrontSideNavFilterView(); - $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); - - id(new PhabricatorBadgesSearchEngine()) - ->setViewer($user) - ->addNavigationItems($nav->getMenu()); - - $nav->selectFilter(null); - - return $nav; + return id(new PhabricatorBadgesSearchEngine()) + ->setController($this) + ->buildResponse(); } protected function buildApplicationCrumbs() { diff --git a/src/applications/badges/controller/PhabricatorBadgesViewController.php b/src/applications/badges/controller/PhabricatorBadgesViewController.php index 411970f0bd..a2e61fee8e 100644 --- a/src/applications/badges/controller/PhabricatorBadgesViewController.php +++ b/src/applications/badges/controller/PhabricatorBadgesViewController.php @@ -64,17 +64,16 @@ final class PhabricatorBadgesViewController $add_comment = $this->buildCommentForm($badge); - return $this->buildApplicationPage( - array( - $crumbs, - $box, - $recipient_list, - $timeline, - $add_comment, - ), - array( - 'title' => $title, - 'pageObjects' => array($badge->getPHID()), + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->setPageObjectPHIDs(array($badge->getPHID())) + ->appendChild( + array( + $box, + $recipient_list, + $timeline, + $add_comment, )); }