@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Restrict watching and member project display better

Summary: Fixes T12713. We don't need to show watching and member info on other views other than ApplicationSearch (for now) so add a few methods to restrict the calls.

Test Plan: Visit project search, profile, project home, project home with subprojects

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12713

Differential Revision: https://secure.phabricator.com/D17883

+24 -13
-2
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 259 259 ->setViewer($viewer) 260 260 ->withParentProjectPHIDs(array($project->getPHID())) 261 261 ->needImages(true) 262 - ->needMembers(true) 263 - ->needWatchers(true) 264 262 ->withStatuses( 265 263 array( 266 264 PhabricatorProjectStatus::STATUS_ACTIVE,
-4
src/applications/project/controller/PhabricatorProjectSubprojectsController.php
··· 31 31 ->setViewer($viewer) 32 32 ->withParentProjectPHIDs(array($project->getPHID())) 33 33 ->needImages(true) 34 - ->needMembers(true) 35 - ->needWatchers(true) 36 34 ->withIsMilestone(false) 37 35 ->execute(); 38 36 } else { ··· 44 42 ->setViewer($viewer) 45 43 ->withParentProjectPHIDs(array($project->getPHID())) 46 44 ->needImages(true) 47 - ->needMembers(true) 48 - ->needWatchers(true) 49 45 ->withIsMilestone(true) 50 46 ->setOrderVector(array('milestoneNumber', 'id')) 51 47 ->execute();
+2
src/applications/project/query/PhabricatorProjectSearchEngine.php
··· 229 229 $list = id(new PhabricatorProjectListView()) 230 230 ->setUser($viewer) 231 231 ->setProjects($projects) 232 + ->setShowWatching(true) 233 + ->setShowMember(true) 232 234 ->renderList(); 233 235 234 236 return id(new PhabricatorApplicationSearchResultView())
+22 -7
src/applications/project/view/PhabricatorProjectListView.php
··· 3 3 final class PhabricatorProjectListView extends AphrontView { 4 4 5 5 private $projects; 6 + private $showMember; 7 + private $showWatching; 6 8 7 9 public function setProjects(array $projects) { 8 10 $this->projects = $projects; ··· 11 13 12 14 public function getProjects() { 13 15 return $this->projects; 16 + } 17 + 18 + public function setShowWatching($watching) { 19 + $this->showWatching = $watching; 20 + return $this; 21 + } 22 + 23 + public function setShowMember($member) { 24 + $this->showMember = $member; 25 + return $this; 14 26 } 15 27 16 28 public function renderList() { ··· 48 60 $item->setDisabled(true); 49 61 } 50 62 51 - $is_member = $project->isUserMember($viewer_phid); 52 - $is_watcher = $project->isUserWatcher($viewer_phid); 53 - 54 - if ($is_member) { 55 - $item->addIcon('fa-user', pht('Member')); 63 + if ($this->showMember) { 64 + $is_member = $project->isUserMember($viewer_phid); 65 + if ($is_member) { 66 + $item->addIcon('fa-user', pht('Member')); 67 + } 56 68 } 57 69 58 - if ($is_watcher) { 59 - $item->addIcon('fa-eye', pht('Watching')); 70 + if ($this->showWatching) { 71 + $is_watcher = $project->isUserWatcher($viewer_phid); 72 + if ($is_watcher) { 73 + $item->addIcon('fa-eye', pht('Watching')); 74 + } 60 75 } 61 76 62 77 $list->addItem($item);