@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.

Highlight reviews the viewer is responsible for in Differential

Summary: Ref T1279. No logical changes, but cosmetically highlight stuff you have authority for, like we do in Diffusion.

Test Plan: See screenshot.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1279

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

+28 -1
+16 -1
src/applications/differential/field/specification/DifferentialProjectReviewersFieldSpecification.php
··· 27 27 return null; 28 28 } 29 29 30 + $highlight = array(); 31 + if ($this->getUser()->getPHID() != $this->getRevision()->getAuthorPHID()) { 32 + // Determine which of these projects the viewer is a member of, so we can 33 + // highlight them. (If the viewer is the author, skip this since they 34 + // can't review.) 35 + $phids = mpull($reviewers, 'getReviewerPHID'); 36 + $projects = id(new PhabricatorProjectQuery()) 37 + ->setViewer($this->getUser()) 38 + ->withPHIDs($phids) 39 + ->withMemberPHIDs(array($this->getUser()->getPHID())) 40 + ->execute(); 41 + $highlight = mpull($projects, 'getPHID'); 42 + } 43 + 30 44 $view = id(new DifferentialReviewersView()) 31 45 ->setReviewers($reviewers) 32 - ->setHandles($this->getLoadedHandles()); 46 + ->setHandles($this->getLoadedHandles()) 47 + ->setHighlightPHIDs($highlight); 33 48 34 49 $diff = $this->getRevision()->loadActiveDiff(); 35 50 if ($diff) {
+1
src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php
··· 33 33 34 34 $view = id(new DifferentialReviewersView()) 35 35 ->setReviewers($reviewers) 36 + ->setHighlightPHIDs(array($this->getUser()->getPHID())) 36 37 ->setHandles($this->getLoadedHandles()); 37 38 38 39 $diff = $this->getRevision()->loadActiveDiff();
+11
src/applications/differential/view/DifferentialReviewersView.php
··· 5 5 private $reviewers; 6 6 private $handles; 7 7 private $diff; 8 + private $highlightPHIDs = array(); 8 9 9 10 public function setReviewers(array $reviewers) { 10 11 assert_instances_of($reviewers, 'DifferentialReviewer'); ··· 20 21 21 22 public function setActiveDiff(DifferentialDiff $diff) { 22 23 $this->diff = $diff; 24 + return $this; 25 + } 26 + 27 + public function setHighlightPHIDs(array $phids) { 28 + $this->highlightPHIDs = $phids; 23 29 return $this; 24 30 } 25 31 26 32 public function render() { 27 33 $view = new PHUIStatusListView(); 28 34 35 + $highlighted = array_fuse($this->highlightPHIDs); 36 + 29 37 foreach ($this->reviewers as $reviewer) { 30 38 $phid = $reviewer->getReviewerPHID(); 31 39 $handle = $this->handles[$phid]; ··· 38 46 39 47 $item = new PHUIStatusItemView(); 40 48 49 + if (isset($highlighted[$phid])) { 50 + $item->setHighlighted(true); 51 + } 41 52 42 53 switch ($reviewer->getStatus()) { 43 54 case DifferentialReviewerStatus::STATUS_ADDED: