mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-26 11:10:16 +01:00
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
This commit is contained in:
parent
b3d07ba0a9
commit
0db6aad80d
1 changed files with 6 additions and 6 deletions
|
@ -92,7 +92,6 @@ final class PhabricatorAuditListView extends AphrontView {
|
|||
$rowc = array();
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$authority = array_fill_keys($this->authorityPHIDs, true);
|
||||
foreach ($this->commits as $commit) {
|
||||
$commit_phid = $commit->getPHID();
|
||||
$commit_handle = $this->getHandle($commit_phid);
|
||||
|
@ -113,7 +112,12 @@ final class PhabricatorAuditListView extends AphrontView {
|
|||
}
|
||||
$auditors = phutil_implode_html(', ', $auditors);
|
||||
|
||||
$audit = idx($audits, $user->getPHID());
|
||||
$authority_audits = array_select_keys($audits, $this->authorityPHIDs);
|
||||
if ($authority_audits) {
|
||||
$audit = reset($authority_audits);
|
||||
} else {
|
||||
$audit = reset($audits);
|
||||
}
|
||||
if ($audit) {
|
||||
$reasons = $audit->getAuditReasons();
|
||||
$reasons = phutil_implode_html(', ', $reasons);
|
||||
|
@ -143,10 +147,6 @@ final class PhabricatorAuditListView extends AphrontView {
|
|||
$item->addAttribute(pht('Auditors: %s', $auditors));
|
||||
}
|
||||
|
||||
if ($commit->getAuthorityAudits($user, $this->authorityPHIDs)) {
|
||||
$item->setEffect('highlighted');
|
||||
}
|
||||
|
||||
$list->addItem($item);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue