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

Audit - polish list view a bit

Summary:
Grab an audit we have authority over if possible, relying on how that's sorted by actor first. This gets us the best description possible of what the audit is about in the list. Also sort out highlighting; right now it looks silly on some views when everything is highlighted.

An open question in the diff - when to highlight audits?

Options I see -

- never
- don't do it on "needs attention" but other views
- calculate what percentage of shown audits user has authority over, if most ( > N% ) don't highlight, otherwise highlight
- something else
- some combo of the above

Test Plan: lists of audits looked better

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

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

+6 -6
+6 -6
src/applications/audit/view/PhabricatorAuditListView.php
··· 92 92 $rowc = array(); 93 93 94 94 $list = new PHUIObjectItemListView(); 95 - $authority = array_fill_keys($this->authorityPHIDs, true); 96 95 foreach ($this->commits as $commit) { 97 96 $commit_phid = $commit->getPHID(); 98 97 $commit_handle = $this->getHandle($commit_phid); ··· 113 112 } 114 113 $auditors = phutil_implode_html(', ', $auditors); 115 114 116 - $audit = idx($audits, $user->getPHID()); 115 + $authority_audits = array_select_keys($audits, $this->authorityPHIDs); 116 + if ($authority_audits) { 117 + $audit = reset($authority_audits); 118 + } else { 119 + $audit = reset($audits); 120 + } 117 121 if ($audit) { 118 122 $reasons = $audit->getAuditReasons(); 119 123 $reasons = phutil_implode_html(', ', $reasons); ··· 141 145 142 146 if (!empty($auditors)) { 143 147 $item->addAttribute(pht('Auditors: %s', $auditors)); 144 - } 145 - 146 - if ($commit->getAuthorityAudits($user, $this->authorityPHIDs)) { 147 - $item->setEffect('highlighted'); 148 148 } 149 149 150 150 $list->addItem($item);