Page MenuHomePhabricator

D8734.id.diff
No OneTemporary

D8734.id.diff

diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php
--- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php
+++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php
@@ -265,6 +265,8 @@
'isClosed' => $task->isClosed(),
'priority' => ManiphestTaskPriority::getTaskPriorityName(
$task->getPriority()),
+ 'priorityColor' => ManiphestTaskPriority::getTaskPriorityColor(
+ $task->getPriority()),
'title' => $task->getTitle(),
'description' => $task->getDescription(),
'projectPHIDs' => $task->getProjectPHIDs(),
diff --git a/src/applications/maniphest/constants/ManiphestTaskPriority.php b/src/applications/maniphest/constants/ManiphestTaskPriority.php
--- a/src/applications/maniphest/constants/ManiphestTaskPriority.php
+++ b/src/applications/maniphest/constants/ManiphestTaskPriority.php
@@ -64,6 +64,17 @@
return idx(self::getTaskPriorityMap(), $priority, $priority);
}
+ /**
+ * Retrieve the color of the priority level given
+ *
+ * @param int A priority level.
+ * @return string The color of the priority if the level is valid,
+ * or black if it is not.
+ */
+ public static function getTaskPriorityColor($priority) {
+ return idx(self::getColorMap(), $priority, 'black');
+ }
+
private static function getConfig() {
$config = PhabricatorEnv::getEnvConfig('maniphest.priorities');

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 22, 6:25 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6741383
Default Alt Text
D8734.id.diff (1 KB)

Event Timeline