mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Internalize Maniphest task status colors
Summary: Ref T1812. These are a bit fluff and don't make too much sense to make configurable, at least for now. Test Plan: Grepped for external callers. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T1812 Differential Revision: https://secure.phabricator.com/D8581
This commit is contained in:
parent
2a6d930480
commit
fdc7b8672b
1 changed files with 8 additions and 32 deletions
|
@ -9,9 +9,6 @@ final class ManiphestTaskStatus extends ManiphestConstants {
|
||||||
const STATUS_CLOSED_DUPLICATE = 4;
|
const STATUS_CLOSED_DUPLICATE = 4;
|
||||||
const STATUS_CLOSED_SPITE = 5;
|
const STATUS_CLOSED_SPITE = 5;
|
||||||
|
|
||||||
const COLOR_STATUS_OPEN = 'status';
|
|
||||||
const COLOR_STATUS_CLOSED = 'status-dark';
|
|
||||||
|
|
||||||
public static function getTaskStatusMap() {
|
public static function getTaskStatusMap() {
|
||||||
$open = pht('Open');
|
$open = pht('Open');
|
||||||
$resolved = pht('Resolved');
|
$resolved = pht('Resolved');
|
||||||
|
@ -60,39 +57,18 @@ final class ManiphestTaskStatus extends ManiphestConstants {
|
||||||
return idx($map, $status, '???');
|
return idx($map, $status, '???');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getTaskStatusColor($status) {
|
|
||||||
$default = self::COLOR_STATUS_OPEN;
|
|
||||||
|
|
||||||
$map = array(
|
|
||||||
self::STATUS_OPEN => self::COLOR_STATUS_OPEN,
|
|
||||||
self::STATUS_CLOSED_RESOLVED => self::COLOR_STATUS_CLOSED,
|
|
||||||
self::STATUS_CLOSED_WONTFIX => self::COLOR_STATUS_CLOSED,
|
|
||||||
self::STATUS_CLOSED_INVALID => self::COLOR_STATUS_CLOSED,
|
|
||||||
self::STATUS_CLOSED_DUPLICATE => self::COLOR_STATUS_CLOSED,
|
|
||||||
self::STATUS_CLOSED_SPITE => self::COLOR_STATUS_CLOSED,
|
|
||||||
);
|
|
||||||
return idx($map, $status, $default);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getIcon($status) {
|
|
||||||
$default = 'oh-open';
|
|
||||||
$map = array(
|
|
||||||
self::STATUS_OPEN => 'oh-open',
|
|
||||||
self::STATUS_CLOSED_RESOLVED => 'oh-closed-dark',
|
|
||||||
self::STATUS_CLOSED_WONTFIX => 'oh-closed-dark',
|
|
||||||
self::STATUS_CLOSED_INVALID => 'oh-closed-dark',
|
|
||||||
self::STATUS_CLOSED_DUPLICATE => 'oh-closed-dark',
|
|
||||||
self::STATUS_CLOSED_SPITE => 'oh-closed-dark',
|
|
||||||
);
|
|
||||||
return idx($map, $status, $default);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function renderFullDescription($status) {
|
public static function renderFullDescription($status) {
|
||||||
$color = self::getTaskStatusColor($status);
|
if (self::isOpenStatus($status)) {
|
||||||
|
$color = 'status';
|
||||||
|
$icon = 'oh-open';
|
||||||
|
} else {
|
||||||
|
$color = 'status-dark';
|
||||||
|
$icon = 'oh-closed-dark';
|
||||||
|
}
|
||||||
|
|
||||||
$img = id(new PHUIIconView())
|
$img = id(new PHUIIconView())
|
||||||
->setSpriteSheet(PHUIIconView::SPRITE_STATUS)
|
->setSpriteSheet(PHUIIconView::SPRITE_STATUS)
|
||||||
->setSpriteIcon(self::getIcon($status));
|
->setSpriteIcon($icon);
|
||||||
|
|
||||||
$tag = phutil_tag(
|
$tag = phutil_tag(
|
||||||
'span',
|
'span',
|
||||||
|
|
Loading…
Reference in a new issue