From a9158d34d46abf1cb76ec21b30a7176b68b46fc1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 19 Jan 2017 10:39:05 -0800 Subject: [PATCH] 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 --- .../audit/view/PhabricatorAuditListView.php | 20 +++++++++---------- .../view/DiffusionHistoryTableView.php | 20 ++++++++++++++++++- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/applications/audit/view/PhabricatorAuditListView.php b/src/applications/audit/view/PhabricatorAuditListView.php index 4afb069778..9207230e7c 100644 --- a/src/applications/audit/view/PhabricatorAuditListView.php +++ b/src/applications/audit/view/PhabricatorAuditListView.php @@ -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); diff --git a/src/applications/diffusion/view/DiffusionHistoryTableView.php b/src/applications/diffusion/view/DiffusionHistoryTableView.php index 4c19e3762b..bb3aee37da 100644 --- a/src/applications/diffusion/view/DiffusionHistoryTableView.php +++ b/src/applications/diffusion/view/DiffusionHistoryTableView.php @@ -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,