1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 06:50:55 +01:00

Normalize AuditStatusConstant Colors

Summary: Ref T6345, This adds more consistent color choices to match how Phabricator generally works across Differential/Diffusion per user statuses.

Test Plan: Review a few Audits in my sandbox.

Reviewers: epriestley, btrahan

Reviewed By: btrahan

Subscribers: Korvin, epriestley

Maniphest Tasks: T6345

Differential Revision: https://secure.phabricator.com/D10726
This commit is contained in:
Chad Little 2014-10-20 15:47:10 -07:00
parent 7761288d76
commit eaf6ca3b64
3 changed files with 39 additions and 53 deletions

View file

@ -38,18 +38,50 @@ final class PhabricatorAuditStatusConstants {
$color = 'red'; $color = 'red';
break; break;
case self::AUDIT_REQUIRED: case self::AUDIT_REQUIRED:
case self::AUDIT_REQUESTED:
$color = 'orange'; $color = 'orange';
break; break;
case self::ACCEPTED: case self::ACCEPTED:
$color = 'green'; $color = 'green';
break; break;
case self::AUDIT_NOT_REQUIRED:
$color = 'blue';
break;
case self::RESIGNED:
case self::CLOSED:
$color = 'dark';
break;
default: default:
$color = null; $color = 'bluegrey';
break; break;
} }
return $color; return $color;
} }
public static function getStatusIcon($code) {
switch ($code) {
case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
case PhabricatorAuditStatusConstants::RESIGNED:
$icon = PHUIStatusItemView::ICON_OPEN;
break;
case PhabricatorAuditStatusConstants::AUDIT_REQUIRED:
case PhabricatorAuditStatusConstants::AUDIT_REQUESTED:
$icon = PHUIStatusItemView::ICON_WARNING;
break;
case PhabricatorAuditStatusConstants::CONCERNED:
$icon = PHUIStatusItemView::ICON_REJECT;
break;
case PhabricatorAuditStatusConstants::ACCEPTED:
case PhabricatorAuditStatusConstants::CLOSED:
$icon = PHUIStatusItemView::ICON_ACCEPT;
break;
default:
$icon = PHUIStatusItemView::ICON_QUESTION;
break;
}
return $icon;
}
public static function getOpenStatusConstants() { public static function getOpenStatusConstants() {
return array( return array(
self::AUDIT_REQUIRED, self::AUDIT_REQUIRED,

View file

@ -95,7 +95,7 @@ final class DifferentialReviewersView extends AphrontView {
if ($is_current) { if ($is_current) {
$item->setIcon( $item->setIcon(
PHUIStatusItemView::ICON_INFO, PHUIStatusItemView::ICON_INFO,
'bluegrey', 'blue',
pht('Commented')); pht('Commented'));
} else { } else {
$item->setIcon( $item->setIcon(

View file

@ -1055,58 +1055,12 @@ final class DiffusionCommitController extends DiffusionController {
$view = new PHUIStatusListView(); $view = new PHUIStatusListView();
foreach ($audit_requests as $request) { foreach ($audit_requests as $request) {
$code = $request->getAuditStatus();
$item = new PHUIStatusItemView(); $item = new PHUIStatusItemView();
$item->setIcon(
switch ($request->getAuditStatus()) { PhabricatorAuditStatusConstants::getStatusIcon($code),
case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED: PhabricatorAuditStatusConstants::getStatusColor($code),
$item->setIcon( PhabricatorAuditStatusConstants::getStatusName($code));
PHUIStatusItemView::ICON_OPEN,
'blue',
pht('Commented'));
break;
case PhabricatorAuditStatusConstants::AUDIT_REQUIRED:
$item->setIcon(
PHUIStatusItemView::ICON_WARNING,
'blue',
pht('Audit Required'));
break;
case PhabricatorAuditStatusConstants::CONCERNED:
$item->setIcon(
PHUIStatusItemView::ICON_REJECT,
'red',
pht('Concern Raised'));
break;
case PhabricatorAuditStatusConstants::ACCEPTED:
$item->setIcon(
PHUIStatusItemView::ICON_ACCEPT,
'green',
pht('Accepted'));
break;
case PhabricatorAuditStatusConstants::AUDIT_REQUESTED:
$item->setIcon(
PHUIStatusItemView::ICON_WARNING,
'dark',
pht('Audit Requested'));
break;
case PhabricatorAuditStatusConstants::RESIGNED:
$item->setIcon(
PHUIStatusItemView::ICON_OPEN,
'dark',
pht('Resigned'));
break;
case PhabricatorAuditStatusConstants::CLOSED:
$item->setIcon(
PHUIStatusItemView::ICON_ACCEPT,
'blue',
pht('Closed'));
break;
default:
$item->setIcon(
PHUIStatusItemView::ICON_QUESTION,
'dark',
pht('%s?', $request->getAuditStatus()));
break;
}
$note = array(); $note = array();
foreach ($request->getAuditReasons() as $reason) { foreach ($request->getAuditReasons() as $reason) {