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

When a reviewer can't see a revision, show it clearly in the reviewer list

Summary: Ref T13602. Similar to subscriber and mention treatments, make it clear when a user doesn't have view permission.

Test Plan: {F8430595}

Maniphest Tasks: T13602

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

+51 -10
+3 -3
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '0e3cf785', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => '7cb6808c', 12 + 'core.pkg.css' => '0ae696de', 13 13 'core.pkg.js' => '079198f6', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => '5c459f92', ··· 180 180 'rsrc/css/phui/phui-remarkup-preview.css' => '91767007', 181 181 'rsrc/css/phui/phui-segment-bar-view.css' => '5166b370', 182 182 'rsrc/css/phui/phui-spacing.css' => 'b05cadc3', 183 - 'rsrc/css/phui/phui-status.css' => 'e5ff8be0', 183 + 'rsrc/css/phui/phui-status.css' => '293b5dad', 184 184 'rsrc/css/phui/phui-tag-view.css' => 'fb811341', 185 185 'rsrc/css/phui/phui-timeline-view.css' => '2d32d7a9', 186 186 'rsrc/css/phui/phui-two-column-view.css' => 'f96d319f', ··· 885 885 'phui-remarkup-preview-css' => '91767007', 886 886 'phui-segment-bar-view-css' => '5166b370', 887 887 'phui-spacing-css' => 'b05cadc3', 888 - 'phui-status-list-view-css' => 'e5ff8be0', 888 + 'phui-status-list-view-css' => '293b5dad', 889 889 'phui-tag-view-css' => 'fb811341', 890 890 'phui-theme-css' => '35883b37', 891 891 'phui-timeline-view-css' => '2d32d7a9',
+21 -2
src/applications/differential/view/DifferentialReviewersView.php
··· 26 26 public function render() { 27 27 $viewer = $this->getUser(); 28 28 $reviewers = $this->reviewers; 29 + $diff = $this->diff; 30 + $handles = $this->handles; 29 31 30 32 $view = new PHUIStatusListView(); 31 33 ··· 40 42 } 41 43 } 42 44 45 + PhabricatorPolicyFilterSet::loadHandleViewCapabilities( 46 + $viewer, 47 + $handles, 48 + array($diff)); 49 + 43 50 $reviewers = $head + $tail; 44 51 foreach ($reviewers as $reviewer) { 45 52 $phid = $reviewer->getReviewerPHID(); 46 - $handle = $this->handles[$phid]; 53 + $handle = $handles[$phid]; 47 54 48 55 $action_phid = $reviewer->getLastActionDiffPHID(); 49 56 $is_current_action = $this->isCurrent($action_phid); ··· 154 161 } 155 162 156 163 $item->setIcon($icon, $color, $label); 157 - $item->setTarget($handle->renderHovercardLink()); 164 + $item->setTarget( 165 + $handle->renderHovercardLink( 166 + null, 167 + $diff->getPHID())); 158 168 159 169 if ($reviewer->isPackage()) { 160 170 if (!$reviewer->getChangesets()) { 161 171 $item->setNote(pht('(Owns No Changed Paths)')); 172 + } 173 + } 174 + 175 + if ($handle->hasCapabilities()) { 176 + if (!$handle->hasViewCapability($diff)) { 177 + $item 178 + ->setIcon('fa-eye-slash', 'red') 179 + ->setNote(pht('No View Permission')) 180 + ->setIsExiled(true); 162 181 } 163 182 } 164 183
+10 -4
src/applications/phid/PhabricatorObjectHandle.php
··· 300 300 return $this->renderLinkWithAttributes($name, array()); 301 301 } 302 302 303 - public function renderHovercardLink($name = null) { 303 + public function renderHovercardLink($name = null, $context_phid = null) { 304 304 Javelin::initBehavior('phui-hovercards'); 305 305 306 + $hovercard_spec = array( 307 + 'objectPHID' => $this->getPHID(), 308 + ); 309 + 310 + if ($context_phid) { 311 + $hovercard_spec['contextPHID'] = $context_phid; 312 + } 313 + 306 314 $attributes = array( 307 315 'sigil' => 'hovercard', 308 316 'meta' => array( 309 - 'hovercardSpec' => array( 310 - 'objectPHID' => $this->getPHID(), 311 - ), 317 + 'hovercardSpec' => $hovercard_spec, 312 318 ), 313 319 ); 314 320
+10
src/view/phui/PHUIStatusItemView.php
··· 8 8 private $target; 9 9 private $note; 10 10 private $highlighted; 11 + private $isExiled; 11 12 12 13 const ICON_ACCEPT = 'fa-check-circle'; 13 14 const ICON_REJECT = 'fa-times-circle'; ··· 46 47 return $this; 47 48 } 48 49 50 + public function setIsExiled($is_exiled) { 51 + $this->isExiled = $is_exiled; 52 + return $this; 53 + } 54 + 49 55 protected function canAppendChild() { 50 56 return false; 51 57 } ··· 58 64 $classes = array(); 59 65 if ($this->highlighted) { 60 66 $classes[] = 'phui-status-item-highlighted'; 67 + } 68 + 69 + if ($this->isExiled) { 70 + $classes[] = 'phui-status-item-exiled'; 61 71 } 62 72 63 73 return array(
+7 -1
webroot/rsrc/css/phui/phui-status.css
··· 29 29 border-radius: 3px; 30 30 } 31 31 32 + .phui-status-item-exiled td { 33 + background-color: {$lightredbackground}; 34 + border-radius: 3px; 35 + } 36 + 32 37 .phui-status-list-view td a { 33 38 color: {$darkbluetext}; 34 39 } 35 40 36 - .phui-status-item-highlighted td.phui-status-item-note { 41 + .phui-status-item-highlighted td.phui-status-item-note, 42 + .phui-status-item-exiled td.phui-status-item-note { 37 43 background-color: transparent; 38 44 }