Page MenuHomePhabricator

D10726.diff
No OneTemporary

D10726.diff

diff --git a/src/applications/audit/constants/PhabricatorAuditStatusConstants.php b/src/applications/audit/constants/PhabricatorAuditStatusConstants.php
--- a/src/applications/audit/constants/PhabricatorAuditStatusConstants.php
+++ b/src/applications/audit/constants/PhabricatorAuditStatusConstants.php
@@ -38,18 +38,50 @@
$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,
diff --git a/src/applications/differential/view/DifferentialReviewersView.php b/src/applications/differential/view/DifferentialReviewersView.php
--- a/src/applications/differential/view/DifferentialReviewersView.php
+++ b/src/applications/differential/view/DifferentialReviewersView.php
@@ -95,7 +95,7 @@
if ($is_current) {
$item->setIcon(
PHUIStatusItemView::ICON_INFO,
- 'bluegrey',
+ 'blue',
pht('Commented'));
} else {
$item->setIcon(
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -1055,58 +1055,12 @@
$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) {

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 19, 6:23 AM (2 h, 17 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7018700
Default Alt Text
D10726.diff (4 KB)

Event Timeline