@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a priorityColor property to the maniphest conduit endpoint

Summary:
I added a getTaskPriorityColor function to the ManiphestTaskPriority class which returns the color set in the maniphest config for the given priority.

This is in preparation for a change to arcanist which will allow it to display the priority color (if it is a supported color) upon running `arc tasks`.

Fixed some linting issues

Test Plan:
Invoke the maniphest.info method from conduit and ensure that:
* The priorityColor property is given in the json
* the priorityColor property is set correctly

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8734

authored by

Brayden Winterton and committed by
epriestley
b6609607 2d43cf12

+13
+2
src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php
··· 265 265 'isClosed' => $task->isClosed(), 266 266 'priority' => ManiphestTaskPriority::getTaskPriorityName( 267 267 $task->getPriority()), 268 + 'priorityColor' => ManiphestTaskPriority::getTaskPriorityColor( 269 + $task->getPriority()), 268 270 'title' => $task->getTitle(), 269 271 'description' => $task->getDescription(), 270 272 'projectPHIDs' => $task->getProjectPHIDs(),
+11
src/applications/maniphest/constants/ManiphestTaskPriority.php
··· 64 64 return idx(self::getTaskPriorityMap(), $priority, $priority); 65 65 } 66 66 67 + /** 68 + * Retrieve the color of the priority level given 69 + * 70 + * @param int A priority level. 71 + * @return string The color of the priority if the level is valid, 72 + * or black if it is not. 73 + */ 74 + public static function getTaskPriorityColor($priority) { 75 + return idx(self::getColorMap(), $priority, 'black'); 76 + } 77 + 67 78 68 79 private static function getConfig() { 69 80 $config = PhabricatorEnv::getEnvConfig('maniphest.priorities');