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

In Audit list and Owners list, show overall commit audit status instead of semi-viewer status

Summary:
Fixes T9482. Historically, Audit was somewhat confused about whether queries and views should act on the viewer's status or the object's status.

This realigns Audit to work like Differential: we show overall status for the commit, just like we show overall status for revisions. This better aligns with expectation and isn't weird/confusing, and bucketing should handle all the "what do //I// need to do" stuff now (or, at least, seems to have in Differential).

This is also how every other type of object works in every other application, AFAIK (all of them show object status, not viewer's-relationship-to-the-object status).

Test Plan:
- Viewed commit lists in Owners and Audit.
- Saw commit overall statuses, not my personal status.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9482

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

+11 -35
+1 -5
src/applications/audit/query/PhabricatorCommitSearchEngine.php
··· 139 139 140 140 $bucket = $this->getResultBucket($query); 141 141 142 - $authority_phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser( 143 - $viewer); 144 - 145 142 $template = id(new PhabricatorAuditListView()) 146 - ->setViewer($viewer) 147 - ->setAuthorityPHIDs($authority_phids); 143 + ->setViewer($viewer); 148 144 149 145 $views = array(); 150 146 if ($bucket) {
+10 -30
src/applications/audit/view/PhabricatorAuditListView.php
··· 3 3 final class PhabricatorAuditListView extends AphrontView { 4 4 5 5 private $commits; 6 - private $authorityPHIDs = array(); 7 6 private $header; 8 7 private $noDataString; 9 8 private $highlightedAudits; 10 - 11 - public function setAuthorityPHIDs(array $phids) { 12 - $this->authorityPHIDs = $phids; 13 - return $this; 14 - } 15 9 16 10 public function setNoDataString($no_data_string) { 17 11 $this->noDataString = $no_data_string; ··· 101 95 } 102 96 $auditors = phutil_implode_html(', ', $auditors); 103 97 104 - $authority_audits = array_select_keys($audits, $this->authorityPHIDs); 105 - if ($authority_audits) { 106 - $audit = reset($authority_audits); 107 - } else { 108 - $audit = reset($audits); 109 - } 110 - if ($audit) { 111 - $reasons = $audit->getAuditReasons(); 112 - $reasons = phutil_implode_html(', ', $reasons); 113 - $status_code = $audit->getAuditStatus(); 114 - $status_text = 115 - PhabricatorAuditStatusConstants::getStatusName($status_code); 116 - $status_color = 117 - PhabricatorAuditStatusConstants::getStatusColor($status_code); 118 - $status_icon = 119 - PhabricatorAuditStatusConstants::getStatusIcon($status_code); 120 - } else { 121 - $reasons = null; 122 - $status_text = null; 123 - $status_color = null; 124 - $status_icon = null; 125 - } 98 + $status = $commit->getAuditStatus(); 99 + 100 + $status_text = 101 + PhabricatorAuditCommitStatusConstants::getStatusName($status); 102 + $status_color = 103 + PhabricatorAuditCommitStatusConstants::getStatusColor($status); 104 + $status_icon = 105 + PhabricatorAuditCommitStatusConstants::getStatusIcon($status); 106 + 126 107 $author_phid = $commit->getAuthorPHID(); 127 108 if ($author_phid) { 128 109 $author_name = $viewer->renderHandle($author_phid); ··· 143 124 } 144 125 145 126 if ($status_color) { 146 - $item->setStatusIcon( 147 - $status_icon.' '.$status_color, $status_text); 127 + $item->setStatusIcon($status_icon.' '.$status_color, $status_text); 148 128 } 149 129 150 130 $list->addItem($item);