mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
Provide revision status information via API all "differential.revision.search"
Summary: Ref T2543. Now that the integer status constants are banished to the internals, we can expose status information from "differential.revision.search". Test Plan: Searched for revisions. {F5093873} Reviewers: chad Reviewed By: chad Maniphest Tasks: T2543 Differential Revision: https://secure.phabricator.com/D18400
This commit is contained in:
parent
ef8d4e2126
commit
36197bf783
2 changed files with 17 additions and 0 deletions
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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<string, wild>')
|
||||
->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,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue