@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add "maniphest.search" Conduit API endpoint

Summary: Ref T9964. This is a basic implementation of the new "maniphest.search" endpoint.

Test Plan: Clicked the button in the web UI, got meaningful results back.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14760

+67 -1
+3
src/__phutil_library_map__.php
··· 1288 1288 'ManiphestReplyHandler' => 'applications/maniphest/mail/ManiphestReplyHandler.php', 1289 1289 'ManiphestReportController' => 'applications/maniphest/controller/ManiphestReportController.php', 1290 1290 'ManiphestSchemaSpec' => 'applications/maniphest/storage/ManiphestSchemaSpec.php', 1291 + 'ManiphestSearchConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestSearchConduitAPIMethod.php', 1291 1292 'ManiphestSearchIndexer' => 'applications/maniphest/search/ManiphestSearchIndexer.php', 1292 1293 'ManiphestStatusConfigOptionType' => 'applications/maniphest/config/ManiphestStatusConfigOptionType.php', 1293 1294 'ManiphestStatusEmailCommand' => 'applications/maniphest/command/ManiphestStatusEmailCommand.php', ··· 5282 5283 'ManiphestReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 5283 5284 'ManiphestReportController' => 'ManiphestController', 5284 5285 'ManiphestSchemaSpec' => 'PhabricatorConfigSchemaSpec', 5286 + 'ManiphestSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 5285 5287 'ManiphestSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 5286 5288 'ManiphestStatusConfigOptionType' => 'PhabricatorConfigJSONOptionType', 5287 5289 'ManiphestStatusEmailCommand' => 'ManiphestEmailCommand', ··· 5300 5302 'PhabricatorApplicationTransactionInterface', 5301 5303 'PhabricatorProjectInterface', 5302 5304 'PhabricatorSpacesInterface', 5305 + 'PhabricatorConduitResultInterface', 5303 5306 ), 5304 5307 'ManiphestTaskAssignHeraldAction' => 'HeraldAction', 5305 5308 'ManiphestTaskAssignOtherHeraldAction' => 'ManiphestTaskAssignHeraldAction',
+18
src/applications/maniphest/conduit/ManiphestSearchConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class ManiphestSearchConduitAPIMethod 4 + extends PhabricatorSearchEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'maniphest.search'; 8 + } 9 + 10 + public function newSearchEngine() { 11 + return new ManiphestTaskSearchEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht('Read information about tasks.'); 16 + } 17 + 18 + }
+46 -1
src/applications/maniphest/storage/ManiphestTask.php
··· 13 13 PhabricatorDestructibleInterface, 14 14 PhabricatorApplicationTransactionInterface, 15 15 PhabricatorProjectInterface, 16 - PhabricatorSpacesInterface { 16 + PhabricatorSpacesInterface, 17 + PhabricatorConduitResultInterface { 17 18 18 19 const MARKUP_FIELD_DESCRIPTION = 'markup:desc'; 19 20 ··· 390 391 391 392 public function getSpacePHID() { 392 393 return $this->spacePHID; 394 + } 395 + 396 + 397 + /* -( PhabricatorConduitResultInterface )---------------------------------- */ 398 + 399 + 400 + public function getFieldSpecificationsForConduit() { 401 + return array( 402 + 'title' => array( 403 + 'type' => 'string', 404 + 'description' => pht('The name of the object.'), 405 + ), 406 + 'authorPHID' => array( 407 + 'type' => 'phid', 408 + 'description' => pht('Original task author.'), 409 + ), 410 + 'ownerPHID' => array( 411 + 'type' => 'phid?', 412 + 'description' => pht('Current task owner.'), 413 + ), 414 + 'status' => array( 415 + 'type' => 'string', 416 + 'description' => pht('Current task status.'), 417 + ), 418 + 'priority' => array( 419 + 'type' => 'int', 420 + 'description' => pht('Task priority.'), 421 + ), 422 + 'subpriority' => array( 423 + 'type' => 'double', 424 + 'description' => pht('Order within priority level.'), 425 + ), 426 + ); 427 + } 428 + 429 + public function getFieldValuesForConduit() { 430 + return array( 431 + 'name' => $this->getTitle(), 432 + 'authorPHID' => $this->getAuthorPHID(), 433 + 'ownerPHID' => $this->getOwnerPHID(), 434 + 'status' => $this->getStatus(), 435 + 'priority' => (int)$this->getPriority(), 436 + 'subpriority' => (double)$this->getSubpriority(), 437 + ); 393 438 } 394 439 395 440 }