1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Show commit audit status in repository history tables, including merge commit lists

Summary:
Fixes T6024. Ref T12121. Currently, we show build status in commit history tables; show audit status alongside it.

Also:

  - Change the "Author/Committer" header to just "Author"; I think it's reasonably obvious what "x/y" means (if you can't guess, you can click the commit and likely figure it out) and this gives us a little more space.
  - Make the audit list look more like the corresponding list in Differential, with similar formatting.

Test Plan:
  - Viewed history of a repostiory, saw audit status.
  - Viewed a merge commit, saw audit status in the list of merged commits.
  - Viewed a commit search results list.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12121, T6024

Differential Revision: https://secure.phabricator.com/D17227
This commit is contained in:
epriestley 2017-01-19 10:39:05 -08:00
parent b0dfd42eef
commit a9158d34d4
2 changed files with 28 additions and 12 deletions

View file

@ -139,7 +139,9 @@ final class PhabricatorAuditListView extends AphrontView {
$item = id(new PHUIObjectItemView())
->setObjectName($commit_name)
->setHeader($commit_desc)
->setHref($commit_link);
->setHref($commit_link)
->addByline(pht('Author: %s', $author_name))
->addIcon('none', $committed);
if ($show_drafts) {
if ($commit->getHasDraft($viewer)) {
@ -147,20 +149,16 @@ final class PhabricatorAuditListView extends AphrontView {
}
}
$item
->addAttribute(pht('Author: %s', $author_name))
->addIcon('none', $committed);
$audits = $commit->getAudits();
$auditor_phids = mpull($audits, 'getAuditorPHID');
if ($auditor_phids) {
$item->addByLine(
array(
pht('Auditors:'),
' ',
$handles->newSublist($auditor_phids)->renderList(),
));
$auditor_list = $handles->newSublist($auditor_phids)
->renderList()
->setAsInline(true);
} else {
$auditor_list = phutil_tag('em', array(), pht('None'));
}
$item->addAttribute(pht('Auditors: %s', $auditor_list));
if ($status_color) {
$item->setStatusIcon($status_icon.' '.$status_color, $status_text);

View file

@ -187,6 +187,19 @@ final class DiffusionHistoryTableView extends DiffusionView {
'type' => $history->getFileType(),
));
$status = $commit->getAuditStatus();
$icon = PhabricatorAuditCommitStatusConstants::getStatusIcon($status);
$color = PhabricatorAuditCommitStatusConstants::getStatusColor($status);
$name = PhabricatorAuditCommitStatusConstants::getStatusName($status);
$audit_view = id(new PHUIIconView())
->setIcon($icon, $color)
->addSigil('has-tooltip')
->setMetadata(
array(
'tip' => $name,
));
$rows[] = array(
$graph ? $graph[$ii++] : null,
$browse,
@ -194,6 +207,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
$drequest->getRepository(),
$history->getCommitIdentifier()),
$build,
$audit_view,
($commit ?
self::linkRevision(idx($this->revisions, $commit->getPHID())) :
null),
@ -211,7 +225,8 @@ final class DiffusionHistoryTableView extends DiffusionView {
pht('Commit'),
null,
null,
pht('Author/Committer'),
null,
pht('Author'),
pht('Details'),
pht('Committed'),
));
@ -221,6 +236,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
'nudgeright',
'',
'icon',
'icon',
'',
'',
'wide',
@ -232,6 +248,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
true,
true,
$has_any_build,
true,
$show_revisions,
));
$view->setDeviceVisibility(
@ -241,6 +258,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
true,
true,
true,
true,
false,
true,
false,