1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Before anyone notices, break the API

Summary: See PHI439. Use slightly richer "dominion" return values for consistency.

Test Plan: Fetched results with `owners.search` API method.

Differential Revision: https://secure.phabricator.com/D19208
This commit is contained in:
epriestley 2018-03-09 12:16:10 -08:00
parent 3e992c6713
commit 9d0cf3c8b8

View file

@ -609,8 +609,8 @@ final class PhabricatorOwnersPackage
->setDescription(pht('Auto audit information.')), ->setDescription(pht('Auto audit information.')),
id(new PhabricatorConduitSearchFieldSpecification()) id(new PhabricatorConduitSearchFieldSpecification())
->setKey('dominion') ->setKey('dominion')
->setType('string') ->setType('map<string, wild>')
->setDescription(pht('Dominion setting.')), ->setDescription(pht('Dominion setting information.')),
); );
} }
@ -648,6 +648,22 @@ final class PhabricatorOwnersPackage
'label' => $audit_label, 'label' => $audit_label,
); );
$dominion_value = $this->getDominion();
$dominion_map = self::getDominionOptionsMap();
if (isset($dominion_map[$dominion_value])) {
$dominion_label = $dominion_map[$dominion_value]['name'];
$dominion_short = $dominion_map[$dominion_value]['short'];
} else {
$dominion_label = pht('Unknown ("%s")', $dominion_value);
$dominion_short = pht('Unknown ("%s")', $dominion_value);
}
$dominion = array(
'value' => $dominion_value,
'label' => $dominion_label,
'short' => $dominion_short,
);
return array( return array(
'name' => $this->getName(), 'name' => $this->getName(),
'description' => $this->getDescription(), 'description' => $this->getDescription(),
@ -655,7 +671,7 @@ final class PhabricatorOwnersPackage
'owners' => $owner_list, 'owners' => $owner_list,
'review' => $review, 'review' => $review,
'audit' => $audit, 'audit' => $audit,
'dominion' => $this->getDominion(), 'dominion' => $dominion,
); );
} }