diff --git a/src/applications/differential/constants/DifferentialRevisionStatus.php b/src/applications/differential/constants/DifferentialRevisionStatus.php index e5ef7d6a24..7afadfc9b1 100644 --- a/src/applications/differential/constants/DifferentialRevisionStatus.php +++ b/src/applications/differential/constants/DifferentialRevisionStatus.php @@ -32,6 +32,10 @@ final class DifferentialRevisionStatus extends Phobject { return idx($this->spec, 'color.tag', 'bluegrey'); } + public function getANSIColor() { + return idx($this->spec, 'color.ansi'); + } + public function getDisplayName() { return idx($this->spec, 'name'); } diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index a6ce99080a..8c96786a89 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -897,13 +897,26 @@ final class DifferentialRevision extends DifferentialDAO ->setKey('authorPHID') ->setType('phid') ->setDescription(pht('Revision author PHID.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('status') + ->setType('map') + ->setDescription(pht('Information about revision status.')), ); } public function getFieldValuesForConduit() { + $status = $this->getStatusObject(); + $status_info = array( + 'value' => $status->getKey(), + 'name' => $status->getDisplayName(), + 'closed' => $status->isClosedStatus(), + 'color.ansi' => $status->getANSIColor(), + ); + return array( 'title' => $this->getTitle(), 'authorPHID' => $this->getAuthorPHID(), + 'status' => $status_info, ); }