mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Add "almanac.namespace.edit" and "almanac.namespace.search" API methods
Summary: Depends on D19336. Ref T13120. Ref T12414. These are simple, straightforward, and uninteresting. Test Plan: - Searched for namespaces with "almanac.namespace.search". - Created and edited namespaces with "almanac.namespace.edit". Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13120, T12414 Differential Revision: https://secure.phabricator.com/D19337
This commit is contained in:
parent
9022e14082
commit
10947c8684
4 changed files with 68 additions and 1 deletions
|
@ -88,6 +88,7 @@ phutil_register_library_map(array(
|
||||||
'AlmanacNamesTestCase' => 'applications/almanac/util/__tests__/AlmanacNamesTestCase.php',
|
'AlmanacNamesTestCase' => 'applications/almanac/util/__tests__/AlmanacNamesTestCase.php',
|
||||||
'AlmanacNamespace' => 'applications/almanac/storage/AlmanacNamespace.php',
|
'AlmanacNamespace' => 'applications/almanac/storage/AlmanacNamespace.php',
|
||||||
'AlmanacNamespaceController' => 'applications/almanac/controller/AlmanacNamespaceController.php',
|
'AlmanacNamespaceController' => 'applications/almanac/controller/AlmanacNamespaceController.php',
|
||||||
|
'AlmanacNamespaceEditConduitAPIMethod' => 'applications/almanac/conduit/AlmanacNamespaceEditConduitAPIMethod.php',
|
||||||
'AlmanacNamespaceEditController' => 'applications/almanac/controller/AlmanacNamespaceEditController.php',
|
'AlmanacNamespaceEditController' => 'applications/almanac/controller/AlmanacNamespaceEditController.php',
|
||||||
'AlmanacNamespaceEditEngine' => 'applications/almanac/editor/AlmanacNamespaceEditEngine.php',
|
'AlmanacNamespaceEditEngine' => 'applications/almanac/editor/AlmanacNamespaceEditEngine.php',
|
||||||
'AlmanacNamespaceEditor' => 'applications/almanac/editor/AlmanacNamespaceEditor.php',
|
'AlmanacNamespaceEditor' => 'applications/almanac/editor/AlmanacNamespaceEditor.php',
|
||||||
|
@ -96,6 +97,7 @@ phutil_register_library_map(array(
|
||||||
'AlmanacNamespaceNameTransaction' => 'applications/almanac/xaction/AlmanacNamespaceNameTransaction.php',
|
'AlmanacNamespaceNameTransaction' => 'applications/almanac/xaction/AlmanacNamespaceNameTransaction.php',
|
||||||
'AlmanacNamespacePHIDType' => 'applications/almanac/phid/AlmanacNamespacePHIDType.php',
|
'AlmanacNamespacePHIDType' => 'applications/almanac/phid/AlmanacNamespacePHIDType.php',
|
||||||
'AlmanacNamespaceQuery' => 'applications/almanac/query/AlmanacNamespaceQuery.php',
|
'AlmanacNamespaceQuery' => 'applications/almanac/query/AlmanacNamespaceQuery.php',
|
||||||
|
'AlmanacNamespaceSearchConduitAPIMethod' => 'applications/almanac/conduit/AlmanacNamespaceSearchConduitAPIMethod.php',
|
||||||
'AlmanacNamespaceSearchEngine' => 'applications/almanac/query/AlmanacNamespaceSearchEngine.php',
|
'AlmanacNamespaceSearchEngine' => 'applications/almanac/query/AlmanacNamespaceSearchEngine.php',
|
||||||
'AlmanacNamespaceTransaction' => 'applications/almanac/storage/AlmanacNamespaceTransaction.php',
|
'AlmanacNamespaceTransaction' => 'applications/almanac/storage/AlmanacNamespaceTransaction.php',
|
||||||
'AlmanacNamespaceTransactionQuery' => 'applications/almanac/query/AlmanacNamespaceTransactionQuery.php',
|
'AlmanacNamespaceTransactionQuery' => 'applications/almanac/query/AlmanacNamespaceTransactionQuery.php',
|
||||||
|
@ -5301,8 +5303,10 @@ phutil_register_library_map(array(
|
||||||
'AlmanacPropertyInterface',
|
'AlmanacPropertyInterface',
|
||||||
'PhabricatorDestructibleInterface',
|
'PhabricatorDestructibleInterface',
|
||||||
'PhabricatorNgramsInterface',
|
'PhabricatorNgramsInterface',
|
||||||
|
'PhabricatorConduitResultInterface',
|
||||||
),
|
),
|
||||||
'AlmanacNamespaceController' => 'AlmanacController',
|
'AlmanacNamespaceController' => 'AlmanacController',
|
||||||
|
'AlmanacNamespaceEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||||
'AlmanacNamespaceEditController' => 'AlmanacNamespaceController',
|
'AlmanacNamespaceEditController' => 'AlmanacNamespaceController',
|
||||||
'AlmanacNamespaceEditEngine' => 'PhabricatorEditEngine',
|
'AlmanacNamespaceEditEngine' => 'PhabricatorEditEngine',
|
||||||
'AlmanacNamespaceEditor' => 'AlmanacEditor',
|
'AlmanacNamespaceEditor' => 'AlmanacEditor',
|
||||||
|
@ -5311,6 +5315,7 @@ phutil_register_library_map(array(
|
||||||
'AlmanacNamespaceNameTransaction' => 'AlmanacNamespaceTransactionType',
|
'AlmanacNamespaceNameTransaction' => 'AlmanacNamespaceTransactionType',
|
||||||
'AlmanacNamespacePHIDType' => 'PhabricatorPHIDType',
|
'AlmanacNamespacePHIDType' => 'PhabricatorPHIDType',
|
||||||
'AlmanacNamespaceQuery' => 'AlmanacQuery',
|
'AlmanacNamespaceQuery' => 'AlmanacQuery',
|
||||||
|
'AlmanacNamespaceSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
|
||||||
'AlmanacNamespaceSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
'AlmanacNamespaceSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||||
'AlmanacNamespaceTransaction' => 'AlmanacModularTransaction',
|
'AlmanacNamespaceTransaction' => 'AlmanacModularTransaction',
|
||||||
'AlmanacNamespaceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
'AlmanacNamespaceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class AlmanacNamespaceEditConduitAPIMethod
|
||||||
|
extends PhabricatorEditEngineAPIMethod {
|
||||||
|
|
||||||
|
public function getAPIMethodName() {
|
||||||
|
return 'almanac.namespace.edit';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newEditEngine() {
|
||||||
|
return new AlmanacNamespaceEditEngine();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMethodSummary() {
|
||||||
|
return pht(
|
||||||
|
'Apply transactions to create a new namespace or edit an existing one.');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class AlmanacNamespaceSearchConduitAPIMethod
|
||||||
|
extends PhabricatorSearchEngineAPIMethod {
|
||||||
|
|
||||||
|
public function getAPIMethodName() {
|
||||||
|
return 'almanac.namespace.search';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newSearchEngine() {
|
||||||
|
return new AlmanacNamespaceSearchEngine();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMethodSummary() {
|
||||||
|
return pht('Read information about Almanac namespaces.');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -8,7 +8,8 @@ final class AlmanacNamespace
|
||||||
PhabricatorProjectInterface,
|
PhabricatorProjectInterface,
|
||||||
AlmanacPropertyInterface,
|
AlmanacPropertyInterface,
|
||||||
PhabricatorDestructibleInterface,
|
PhabricatorDestructibleInterface,
|
||||||
PhabricatorNgramsInterface {
|
PhabricatorNgramsInterface,
|
||||||
|
PhabricatorConduitResultInterface {
|
||||||
|
|
||||||
protected $name;
|
protected $name;
|
||||||
protected $nameIndex;
|
protected $nameIndex;
|
||||||
|
@ -224,4 +225,28 @@ final class AlmanacNamespace
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -( PhabricatorConduitResultInterface )---------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
public function getFieldSpecificationsForConduit() {
|
||||||
|
return array(
|
||||||
|
id(new PhabricatorConduitSearchFieldSpecification())
|
||||||
|
->setKey('name')
|
||||||
|
->setType('string')
|
||||||
|
->setDescription(pht('The name of the namespace.')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFieldValuesForConduit() {
|
||||||
|
return array(
|
||||||
|
'name' => $this->getName(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getConduitSearchAttachments() {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue