@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 package or project has been accepted or rejected, show who did it ("Accepted (by dog)")

Summary: Makes it more clear whose authority actions have been taken under.

Test Plan: {F4916376}

Reviewers: chad

Reviewed By: chad

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

+62 -41
+1 -1
src/applications/base/PhabricatorApplication.php
··· 643 643 644 644 645 645 public function getApplicationTransactionEditor() { 646 - return new PhabricatorApplicationEditor(); 646 + return new PhutilMethodNotImplementedException(pht('Coming Soon!')); 647 647 } 648 648 649 649 public function getApplicationTransactionObject() {
+61 -40
src/applications/differential/view/DifferentialReviewersView.php
··· 55 55 56 56 $item->setHighlighted($reviewer->hasAuthority($viewer)); 57 57 58 + // If someone other than the reviewer acted on the reviewer's behalf, 59 + // show who is responsible for the current state. This is usually a 60 + // user accepting for a package or project. 61 + $authority_phid = $reviewer->getLastActorPHID(); 62 + if ($authority_phid && ($authority_phid !== $phid)) { 63 + $authority_name = $viewer->renderHandle($authority_phid) 64 + ->setAsText(true); 65 + } else { 66 + $authority_name = null; 67 + } 68 + 58 69 switch ($reviewer->getReviewerStatus()) { 59 70 case DifferentialReviewerStatus::STATUS_ADDED: 60 71 if ($comment_phid) { 61 72 if ($is_current_comment) { 62 - $item->setIcon( 63 - 'fa-comment', 64 - 'blue', 65 - pht('Commented')); 73 + $icon = 'fa-comment'; 74 + $color = 'blue'; 75 + $label = pht('Commented'); 66 76 } else { 67 - $item->setIcon( 68 - 'fa-comment-o', 69 - 'bluegrey', 70 - pht('Commented Previously')); 77 + $icon = 'fa-comment-o'; 78 + $color = 'bluegrey'; 79 + $label = pht('Commented Previously'); 71 80 } 72 81 } else { 73 - $item->setIcon( 74 - PHUIStatusItemView::ICON_OPEN, 75 - 'bluegrey', 76 - pht('Review Requested')); 82 + $icon = PHUIStatusItemView::ICON_OPEN; 83 + $color = 'bluegrey'; 84 + $label = pht('Review Requested'); 77 85 } 78 86 break; 79 87 80 88 case DifferentialReviewerStatus::STATUS_ACCEPTED: 81 89 if ($is_current_action) { 82 - $item->setIcon( 83 - PHUIStatusItemView::ICON_ACCEPT, 84 - 'green', 85 - pht('Accepted')); 90 + $icon = PHUIStatusItemView::ICON_ACCEPT; 91 + $color = 'green'; 92 + if ($authority_name !== null) { 93 + $label = pht('Accepted (by %s)', $authority_name); 94 + } else { 95 + $label = pht('Accepted'); 96 + } 86 97 } else { 87 - $item->setIcon( 88 - 'fa-check-circle-o', 89 - 'bluegrey', 90 - pht('Accepted Prior Diff')); 98 + $icon = 'fa-check-circle-o'; 99 + $color = 'bluegrey'; 100 + if ($authority_name !== null) { 101 + $label = pht('Accepted Prior Diff (by %s)', $authority_name); 102 + } else { 103 + $label = pht('Accepted Prior Diff'); 104 + } 91 105 } 92 106 break; 93 107 94 108 case DifferentialReviewerStatus::STATUS_REJECTED: 95 109 if ($is_current_action) { 96 - $item->setIcon( 97 - PHUIStatusItemView::ICON_REJECT, 98 - 'red', 99 - pht('Requested Changes')); 110 + $icon = PHUIStatusItemView::ICON_REJECT; 111 + $color = 'red'; 112 + if ($authority_name !== null) { 113 + $label = pht('Requested Changes (by %s)', $authority_name); 114 + } else { 115 + $label = pht('Requested Changes'); 116 + } 100 117 } else { 101 - $item->setIcon( 102 - 'fa-times-circle-o', 103 - 'bluegrey', 104 - pht('Requested Changes to Prior Diff')); 118 + $icon = 'fa-times-circle-o'; 119 + $color = 'bluegrey'; 120 + if ($authority_name !== null) { 121 + $label = pht( 122 + 'Requested Changes to Prior Diff (by %s)', 123 + $authority_name); 124 + } else { 125 + $label = pht('Requested Changes to Prior Diff'); 126 + } 105 127 } 106 128 break; 107 129 108 130 case DifferentialReviewerStatus::STATUS_BLOCKING: 109 - $item->setIcon( 110 - PHUIStatusItemView::ICON_MINUS, 111 - 'red', 112 - pht('Blocking Review')); 131 + $icon = PHUIStatusItemView::ICON_MINUS; 132 + $color = 'red'; 133 + $label = pht('Blocking Review'); 113 134 break; 114 135 115 136 case DifferentialReviewerStatus::STATUS_RESIGNED: 116 - $item->setIcon( 117 - 'fa-times', 118 - 'grey', 119 - pht('Resigned')); 137 + $icon = 'fa-times'; 138 + $color = 'grey'; 139 + $label = pht('Resigned'); 120 140 break; 121 141 122 142 default: 123 - $item->setIcon( 124 - PHUIStatusItemView::ICON_QUESTION, 125 - 'bluegrey', 126 - pht('%s?', $reviewer->getReviewerStatus())); 143 + $icon = PHUIStatusItemView::ICON_QUESTION; 144 + $color = 'bluegrey'; 145 + $label = pht('Unknown ("%s")', $reviewer->getReviewerStatus()); 127 146 break; 128 147 129 148 } 130 149 150 + $item->setIcon($icon, $color, $label); 131 151 $item->setTarget($handle->renderHovercardLink()); 152 + 132 153 $view->addItem($item); 133 154 } 134 155