mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-03 19:31:02 +01:00
Add maniphest.priority.search method
Summary: Start on plan outlined in T12124. Adds a new Conduit method for querying information about task priorities. Test Plan: Ran locally; observed expected output: {F4979109} Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D18035
This commit is contained in:
parent
04fd93e51e
commit
9d37ad3022
3 changed files with 47 additions and 1 deletions
|
@ -1494,6 +1494,7 @@ phutil_register_library_map(array(
|
||||||
'ManiphestPointsConfigOptionType' => 'applications/maniphest/config/ManiphestPointsConfigOptionType.php',
|
'ManiphestPointsConfigOptionType' => 'applications/maniphest/config/ManiphestPointsConfigOptionType.php',
|
||||||
'ManiphestPriorityConfigOptionType' => 'applications/maniphest/config/ManiphestPriorityConfigOptionType.php',
|
'ManiphestPriorityConfigOptionType' => 'applications/maniphest/config/ManiphestPriorityConfigOptionType.php',
|
||||||
'ManiphestPriorityEmailCommand' => 'applications/maniphest/command/ManiphestPriorityEmailCommand.php',
|
'ManiphestPriorityEmailCommand' => 'applications/maniphest/command/ManiphestPriorityEmailCommand.php',
|
||||||
|
'ManiphestPrioritySearchConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestPrioritySearchConduitAPIMethod.php',
|
||||||
'ManiphestProjectNameFulltextEngineExtension' => 'applications/maniphest/engineextension/ManiphestProjectNameFulltextEngineExtension.php',
|
'ManiphestProjectNameFulltextEngineExtension' => 'applications/maniphest/engineextension/ManiphestProjectNameFulltextEngineExtension.php',
|
||||||
'ManiphestQueryConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php',
|
'ManiphestQueryConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php',
|
||||||
'ManiphestQueryStatusesConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestQueryStatusesConduitAPIMethod.php',
|
'ManiphestQueryStatusesConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestQueryStatusesConduitAPIMethod.php',
|
||||||
|
@ -6593,6 +6594,7 @@ phutil_register_library_map(array(
|
||||||
'ManiphestPointsConfigOptionType' => 'PhabricatorConfigJSONOptionType',
|
'ManiphestPointsConfigOptionType' => 'PhabricatorConfigJSONOptionType',
|
||||||
'ManiphestPriorityConfigOptionType' => 'PhabricatorConfigJSONOptionType',
|
'ManiphestPriorityConfigOptionType' => 'PhabricatorConfigJSONOptionType',
|
||||||
'ManiphestPriorityEmailCommand' => 'ManiphestEmailCommand',
|
'ManiphestPriorityEmailCommand' => 'ManiphestEmailCommand',
|
||||||
|
'ManiphestPrioritySearchConduitAPIMethod' => 'ManiphestConduitAPIMethod',
|
||||||
'ManiphestProjectNameFulltextEngineExtension' => 'PhabricatorFulltextEngineExtension',
|
'ManiphestProjectNameFulltextEngineExtension' => 'PhabricatorFulltextEngineExtension',
|
||||||
'ManiphestQueryConduitAPIMethod' => 'ManiphestConduitAPIMethod',
|
'ManiphestQueryConduitAPIMethod' => 'ManiphestConduitAPIMethod',
|
||||||
'ManiphestQueryStatusesConduitAPIMethod' => 'ManiphestConduitAPIMethod',
|
'ManiphestQueryStatusesConduitAPIMethod' => 'ManiphestConduitAPIMethod',
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ManiphestPrioritySearchConduitAPIMethod
|
||||||
|
extends ManiphestConduitAPIMethod {
|
||||||
|
|
||||||
|
public function getAPIMethodName() {
|
||||||
|
return 'maniphest.priority.search';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMethodSummary() {
|
||||||
|
return pht('Read information about task priorities.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMethodDescription() {
|
||||||
|
return pht(
|
||||||
|
'Returns information about the possible priorities for Maniphest '.
|
||||||
|
'tasks.');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function defineParamTypes() {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function defineReturnType() {
|
||||||
|
return 'map<string, wild>';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredScope() {
|
||||||
|
return self::SCOPE_ALWAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(ConduitAPIRequest $request) {
|
||||||
|
$config = ManiphestTaskPriority::getConfig();
|
||||||
|
|
||||||
|
$results = array();
|
||||||
|
foreach ($config as $code => $priority) {
|
||||||
|
$priority['value'] = $code;
|
||||||
|
$results[] = $priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
return array('data' => $results);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -110,7 +110,7 @@ final class ManiphestTaskPriority extends ManiphestConstants {
|
||||||
return idx($config, 'disabled', false);
|
return idx($config, 'disabled', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getConfig() {
|
public static function getConfig() {
|
||||||
$config = PhabricatorEnv::getEnvConfig('maniphest.priorities');
|
$config = PhabricatorEnv::getEnvConfig('maniphest.priorities');
|
||||||
krsort($config);
|
krsort($config);
|
||||||
return $config;
|
return $config;
|
||||||
|
|
Loading…
Reference in a new issue