@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.

Provide more API information about Maniphest task statuses and priorities

Summary: Ref T9964. Priorities and statuses have metadata (colors, names, etc) which we can reasonably just return from API callers. This is so ligthweight that I think it doesn't really make sense to put in an attachment. We also use this information in `arc tasks`.

Test Plan: Called API, got sensible looking status and priority data back.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

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

+22 -11
+22 -11
src/applications/maniphest/storage/ManiphestTask.php
··· 413 413 ->setDescription(pht('Current task owner, if task is assigned.')), 414 414 id(new PhabricatorConduitSearchFieldSpecification()) 415 415 ->setKey('status') 416 - ->setType('string') 417 - ->setDescription(pht('Task status.')), 416 + ->setType('map<string, wild>') 417 + ->setDescription(pht('Information about task status.')), 418 418 id(new PhabricatorConduitSearchFieldSpecification()) 419 419 ->setKey('priority') 420 - ->setType('int') 421 - ->setDescription(pht('Task priority.')), 422 - id(new PhabricatorConduitSearchFieldSpecification()) 423 - ->setKey('subpriority') 424 - ->setType('double') 425 - ->setDescription(pht('Order within priority level.')), 420 + ->setType('map<string, wild>') 421 + ->setDescription(pht('Information about task priority.')), 426 422 ); 427 423 } 428 424 429 425 public function getFieldValuesForConduit() { 426 + 427 + $status_value = $this->getStatus(); 428 + $status_info = array( 429 + 'value' => $status_value, 430 + 'name' => ManiphestTaskStatus::getTaskStatusName($status_value), 431 + 'color' => ManiphestTaskStatus::getStatusColor($status_value), 432 + ); 433 + 434 + $priority_value = (int)$this->getPriority(); 435 + $priority_info = array( 436 + 'value' => $priority_value, 437 + 'subpriority' => (double)$this->getSubpriority(), 438 + 'name' => ManiphestTaskPriority::getTaskPriorityName($priority_value), 439 + 'color' => ManiphestTaskPriority::getTaskPriorityColor($priority_value), 440 + ); 441 + 430 442 return array( 431 443 'name' => $this->getTitle(), 432 444 'authorPHID' => $this->getAuthorPHID(), 433 445 'ownerPHID' => $this->getOwnerPHID(), 434 - 'status' => $this->getStatus(), 435 - 'priority' => (int)$this->getPriority(), 436 - 'subpriority' => (double)$this->getSubpriority(), 446 + 'status' => $status_info, 447 + 'priority' => $priority_info, 437 448 ); 438 449 } 439 450