mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10: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:
parent
7761288d76
commit
eaf6ca3b64
3 changed files with 39 additions and 53 deletions
|
@ -38,18 +38,50 @@ final class PhabricatorAuditStatusConstants {
|
|||
$color = 'red';
|
||||
break;
|
||||
case self::AUDIT_REQUIRED:
|
||||
case self::AUDIT_REQUESTED:
|
||||
$color = 'orange';
|
||||
break;
|
||||
case self::ACCEPTED:
|
||||
$color = 'green';
|
||||
break;
|
||||
case self::AUDIT_NOT_REQUIRED:
|
||||
$color = 'blue';
|
||||
break;
|
||||
case self::RESIGNED:
|
||||
case self::CLOSED:
|
||||
$color = 'dark';
|
||||
break;
|
||||
default:
|
||||
$color = null;
|
||||
$color = 'bluegrey';
|
||||
break;
|
||||
}
|
||||
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() {
|
||||
return array(
|
||||
self::AUDIT_REQUIRED,
|
||||
|
|
|
@ -95,7 +95,7 @@ final class DifferentialReviewersView extends AphrontView {
|
|||
if ($is_current) {
|
||||
$item->setIcon(
|
||||
PHUIStatusItemView::ICON_INFO,
|
||||
'bluegrey',
|
||||
'blue',
|
||||
pht('Commented'));
|
||||
} else {
|
||||
$item->setIcon(
|
||||
|
|
|
@ -1055,58 +1055,12 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
|
||||
$view = new PHUIStatusListView();
|
||||
foreach ($audit_requests as $request) {
|
||||
$code = $request->getAuditStatus();
|
||||
$item = new PHUIStatusItemView();
|
||||
|
||||
switch ($request->getAuditStatus()) {
|
||||
case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
|
||||
$item->setIcon(
|
||||
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;
|
||||
}
|
||||
$item->setIcon(
|
||||
PhabricatorAuditStatusConstants::getStatusIcon($code),
|
||||
PhabricatorAuditStatusConstants::getStatusColor($code),
|
||||
PhabricatorAuditStatusConstants::getStatusName($code));
|
||||
|
||||
$note = array();
|
||||
foreach ($request->getAuditReasons() as $reason) {
|
||||
|
|
Loading…
Reference in a new issue