From ef839192aa5a351c6b28575320f27efa0aa15826 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 15 May 2017 19:50:59 -0700 Subject: [PATCH] Only show member/watcher notes on Members page in Projects Summary: Restricts the view of the membership privileges to just the Members page itself, and not other pages like Home/Details. Test Plan: Test Home, Test Members, see correct layouts. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17896 --- ...PhabricatorProjectMembersViewController.php | 6 ++++-- .../view/PhabricatorProjectUserListView.php | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/applications/project/controller/PhabricatorProjectMembersViewController.php b/src/applications/project/controller/PhabricatorProjectMembersViewController.php index cd80d0c724..30ff425a51 100644 --- a/src/applications/project/controller/PhabricatorProjectMembersViewController.php +++ b/src/applications/project/controller/PhabricatorProjectMembersViewController.php @@ -26,13 +26,15 @@ final class PhabricatorProjectMembersViewController ->setUser($viewer) ->setProject($project) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) - ->setUserPHIDs($project->getMemberPHIDs()); + ->setUserPHIDs($project->getMemberPHIDs()) + ->setShowNote(true); $watcher_list = id(new PhabricatorProjectWatcherListView()) ->setUser($viewer) ->setProject($project) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) - ->setUserPHIDs($project->getWatcherPHIDs()); + ->setUserPHIDs($project->getWatcherPHIDs()) + ->setShowNote(true); $nav = $this->getProfileMenu(); $nav->selectFilter(PhabricatorProject::ITEM_MEMBERS); diff --git a/src/applications/project/view/PhabricatorProjectUserListView.php b/src/applications/project/view/PhabricatorProjectUserListView.php index 0c0e2c1d2b..51c2ced6d1 100644 --- a/src/applications/project/view/PhabricatorProjectUserListView.php +++ b/src/applications/project/view/PhabricatorProjectUserListView.php @@ -6,6 +6,7 @@ abstract class PhabricatorProjectUserListView extends AphrontView { private $userPHIDs; private $limit; private $background; + private $showNote; public function setProject(PhabricatorProject $project) { $this->project = $project; @@ -39,6 +40,11 @@ abstract class PhabricatorProjectUserListView extends AphrontView { return $this; } + public function setShowNote($show) { + $this->showNote = $show; + return $this; + } + abstract protected function canEditList(); abstract protected function getNoDataString(); abstract protected function getRemoveURI($phid); @@ -136,11 +142,13 @@ abstract class PhabricatorProjectUserListView extends AphrontView { ->setHeader($header) ->setObjectList($list); - if ($this->getMembershipNote()) { - $info = id(new PHUIInfoView()) - ->setSeverity(PHUIInfoView::SEVERITY_PLAIN) - ->appendChild($this->getMembershipNote()); - $box->setInfoView($info); + if ($this->showNote) { + if ($this->getMembershipNote()) { + $info = id(new PHUIInfoView()) + ->setSeverity(PHUIInfoView::SEVERITY_PLAIN) + ->appendChild($this->getMembershipNote()); + $box->setInfoView($info); + } } if ($this->background) {