From 10947c868433005f40476476d2ccf320f516c9e0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 10 Apr 2018 11:24:34 -0700 Subject: [PATCH] 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 --- src/__phutil_library_map__.php | 5 ++++ .../AlmanacNamespaceEditConduitAPIMethod.php | 19 +++++++++++++ ...AlmanacNamespaceSearchConduitAPIMethod.php | 18 +++++++++++++ .../almanac/storage/AlmanacNamespace.php | 27 ++++++++++++++++++- 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 src/applications/almanac/conduit/AlmanacNamespaceEditConduitAPIMethod.php create mode 100644 src/applications/almanac/conduit/AlmanacNamespaceSearchConduitAPIMethod.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index e00296b8cc..08c07e7083 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -88,6 +88,7 @@ phutil_register_library_map(array( 'AlmanacNamesTestCase' => 'applications/almanac/util/__tests__/AlmanacNamesTestCase.php', 'AlmanacNamespace' => 'applications/almanac/storage/AlmanacNamespace.php', 'AlmanacNamespaceController' => 'applications/almanac/controller/AlmanacNamespaceController.php', + 'AlmanacNamespaceEditConduitAPIMethod' => 'applications/almanac/conduit/AlmanacNamespaceEditConduitAPIMethod.php', 'AlmanacNamespaceEditController' => 'applications/almanac/controller/AlmanacNamespaceEditController.php', 'AlmanacNamespaceEditEngine' => 'applications/almanac/editor/AlmanacNamespaceEditEngine.php', 'AlmanacNamespaceEditor' => 'applications/almanac/editor/AlmanacNamespaceEditor.php', @@ -96,6 +97,7 @@ phutil_register_library_map(array( 'AlmanacNamespaceNameTransaction' => 'applications/almanac/xaction/AlmanacNamespaceNameTransaction.php', 'AlmanacNamespacePHIDType' => 'applications/almanac/phid/AlmanacNamespacePHIDType.php', 'AlmanacNamespaceQuery' => 'applications/almanac/query/AlmanacNamespaceQuery.php', + 'AlmanacNamespaceSearchConduitAPIMethod' => 'applications/almanac/conduit/AlmanacNamespaceSearchConduitAPIMethod.php', 'AlmanacNamespaceSearchEngine' => 'applications/almanac/query/AlmanacNamespaceSearchEngine.php', 'AlmanacNamespaceTransaction' => 'applications/almanac/storage/AlmanacNamespaceTransaction.php', 'AlmanacNamespaceTransactionQuery' => 'applications/almanac/query/AlmanacNamespaceTransactionQuery.php', @@ -5301,8 +5303,10 @@ phutil_register_library_map(array( 'AlmanacPropertyInterface', 'PhabricatorDestructibleInterface', 'PhabricatorNgramsInterface', + 'PhabricatorConduitResultInterface', ), 'AlmanacNamespaceController' => 'AlmanacController', + 'AlmanacNamespaceEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 'AlmanacNamespaceEditController' => 'AlmanacNamespaceController', 'AlmanacNamespaceEditEngine' => 'PhabricatorEditEngine', 'AlmanacNamespaceEditor' => 'AlmanacEditor', @@ -5311,6 +5315,7 @@ phutil_register_library_map(array( 'AlmanacNamespaceNameTransaction' => 'AlmanacNamespaceTransactionType', 'AlmanacNamespacePHIDType' => 'PhabricatorPHIDType', 'AlmanacNamespaceQuery' => 'AlmanacQuery', + 'AlmanacNamespaceSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 'AlmanacNamespaceSearchEngine' => 'PhabricatorApplicationSearchEngine', 'AlmanacNamespaceTransaction' => 'AlmanacModularTransaction', 'AlmanacNamespaceTransactionQuery' => 'PhabricatorApplicationTransactionQuery', diff --git a/src/applications/almanac/conduit/AlmanacNamespaceEditConduitAPIMethod.php b/src/applications/almanac/conduit/AlmanacNamespaceEditConduitAPIMethod.php new file mode 100644 index 0000000000..e739cd6bb7 --- /dev/null +++ b/src/applications/almanac/conduit/AlmanacNamespaceEditConduitAPIMethod.php @@ -0,0 +1,19 @@ +setKey('name') + ->setType('string') + ->setDescription(pht('The name of the namespace.')), + ); + } + + public function getFieldValuesForConduit() { + return array( + 'name' => $this->getName(), + ); + } + + public function getConduitSearchAttachments() { + return array(); + } + + }