Skip to content

Commit

Permalink
Audit - tweak colors
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bobtrahan committed Jan 7, 2014
1 parent 46139bd commit db778cb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Expand Up @@ -31,4 +31,23 @@ public static function getOpenStatusConstants() {
);
}

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;
}

}
Expand Up @@ -40,6 +40,9 @@ public static function getStatusColor($code) {
case self::AUDIT_REQUIRED:
$color = 'orange';
break;
case self::ACCEPTED:
$color = 'green';
break;
default:
$color = null;
break;
Expand Down
Expand Up @@ -88,10 +88,14 @@ public function render() {
$auditors = phutil_implode_html(', ', $auditors);
}
$committed = phabricator_datetime($commit->getEpoch(), $this->user);
$audit_status = $commit->getAuditStatus();
$commit_status = PhabricatorAuditCommitStatusConstants::getStatusName(
$commit->getAuditStatus());
$audit_status);
$status_color = PhabricatorAuditCommitStatusConstants::getStatusColor(
$audit_status);

$item = id(new PHUIObjectItemView())
->setBarColor($status_color)
->setObjectName($commit_name)
->setHeader($commit_desc)
->setHref($commit_link)
Expand Down

0 comments on commit db778cb

Please sign in to comment.