mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 14:30:56 +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:
parent
7761288d76
commit
eaf6ca3b64
3 changed files with 39 additions and 53 deletions
|
@ -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,
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
switch ($request->getAuditStatus()) {
|
|
||||||
case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
|
|
||||||
$item->setIcon(
|
$item->setIcon(
|
||||||
PHUIStatusItemView::ICON_OPEN,
|
PhabricatorAuditStatusConstants::getStatusIcon($code),
|
||||||
'blue',
|
PhabricatorAuditStatusConstants::getStatusColor($code),
|
||||||
pht('Commented'));
|
PhabricatorAuditStatusConstants::getStatusName($code));
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in a new issue