mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Audit - tweak colors
Summary: See github issue 413. This diff adds color to the commit view as the user expects *AND* adds green to both audit and commit views. I looked in the history (D6184) and I can't tell how expected green was, but it feels nice to me given differential color coding. Test Plan: looked at lists of audits and commits with pretty colors. Reviewers: epriestley, chad Reviewed By: epriestley CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7900
This commit is contained in:
parent
46139bd1f6
commit
db778cb3e3
3 changed files with 27 additions and 1 deletions
|
@ -31,4 +31,23 @@ final class PhabricatorAuditCommitStatusConstants {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getStatusColor($code) {
|
||||||
|
switch ($code) {
|
||||||
|
case self::CONCERN_RAISED:
|
||||||
|
$color = 'red';
|
||||||
|
break;
|
||||||
|
case self::NEEDS_AUDIT:
|
||||||
|
case self::PARTIALLY_AUDITED:
|
||||||
|
$color = 'orange';
|
||||||
|
break;
|
||||||
|
case self::FULLY_AUDITED:
|
||||||
|
$color = 'green';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$color = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $color;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,9 @@ final class PhabricatorAuditStatusConstants {
|
||||||
case self::AUDIT_REQUIRED:
|
case self::AUDIT_REQUIRED:
|
||||||
$color = 'orange';
|
$color = 'orange';
|
||||||
break;
|
break;
|
||||||
|
case self::ACCEPTED:
|
||||||
|
$color = 'green';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$color = null;
|
$color = null;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -88,10 +88,14 @@ final class PhabricatorAuditCommitListView extends AphrontView {
|
||||||
$auditors = phutil_implode_html(', ', $auditors);
|
$auditors = phutil_implode_html(', ', $auditors);
|
||||||
}
|
}
|
||||||
$committed = phabricator_datetime($commit->getEpoch(), $this->user);
|
$committed = phabricator_datetime($commit->getEpoch(), $this->user);
|
||||||
|
$audit_status = $commit->getAuditStatus();
|
||||||
$commit_status = PhabricatorAuditCommitStatusConstants::getStatusName(
|
$commit_status = PhabricatorAuditCommitStatusConstants::getStatusName(
|
||||||
$commit->getAuditStatus());
|
$audit_status);
|
||||||
|
$status_color = PhabricatorAuditCommitStatusConstants::getStatusColor(
|
||||||
|
$audit_status);
|
||||||
|
|
||||||
$item = id(new PHUIObjectItemView())
|
$item = id(new PHUIObjectItemView())
|
||||||
|
->setBarColor($status_color)
|
||||||
->setObjectName($commit_name)
|
->setObjectName($commit_name)
|
||||||
->setHeader($commit_desc)
|
->setHeader($commit_desc)
|
||||||
->setHref($commit_link)
|
->setHref($commit_link)
|
||||||
|
|
Loading…
Reference in a new issue