diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index e5927dc6d9..d8f5f33152 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -459,6 +459,7 @@ phutil_register_library_map(array( 'DifferentialUnitStatus' => 'applications/differential/constants/DifferentialUnitStatus.php', 'DifferentialUnitTestResult' => 'applications/differential/constants/DifferentialUnitTestResult.php', 'DifferentialViewPolicyField' => 'applications/differential/customfield/DifferentialViewPolicyField.php', + 'DiffusionArcanistProjectDatasource' => 'applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php', 'DiffusionBranchTableController' => 'applications/diffusion/controller/DiffusionBranchTableController.php', 'DiffusionBranchTableView' => 'applications/diffusion/view/DiffusionBranchTableView.php', 'DiffusionBrowseController' => 'applications/diffusion/controller/DiffusionBrowseController.php', @@ -3175,6 +3176,7 @@ phutil_register_library_map(array( 'DifferentialTransactionView' => 'PhabricatorApplicationTransactionView', 'DifferentialUnitField' => 'DifferentialCustomField', 'DifferentialViewPolicyField' => 'DifferentialCoreCustomField', + 'DiffusionArcanistProjectDatasource' => 'PhabricatorTypeaheadDatasource', 'DiffusionBranchTableController' => 'DiffusionController', 'DiffusionBranchTableView' => 'DiffusionView', 'DiffusionBrowseController' => 'DiffusionController', diff --git a/src/applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php b/src/applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php new file mode 100644 index 0000000000..b255cb112c --- /dev/null +++ b/src/applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php @@ -0,0 +1,30 @@ +getViewer(); + $raw_query = $this->getRawQuery(); + + $results = array(); + + $arcprojs = id(new PhabricatorRepositoryArcanistProject())->loadAll(); + foreach ($arcprojs as $proj) { + $results[] = id(new PhabricatorTypeaheadResult()) + ->setName($proj->getName()) + ->setPHID($proj->getPHID()); + } + + return $results; + } + +} diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php index 77dd9f9b23..e149b27a65 100644 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -593,6 +593,7 @@ final class HeraldRuleController extends HeraldController { 'legaldocuments' => new LegalpadDocumentDatasource(), 'taskpriority' => new ManiphestTaskPriorityDatasource(), 'buildplan' => new HarbormasterBuildPlanDatasource(), + 'arcanistprojects' => new DiffusionArcanistProjectDatasource(), ); $sources = mpull($sources, 'getDatasourceURI'); @@ -602,7 +603,6 @@ final class HeraldRuleController extends HeraldController { 'package' => '/typeahead/common/packages/', 'project' => '/typeahead/common/projects/', 'userorproject' => '/typeahead/common/accountsorprojects/', - 'arcanistprojects' => '/typeahead/common/arcanistprojects/', ); return array( diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php index f98075ddfd..56b7dc5bc6 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php @@ -95,7 +95,7 @@ final class PhabricatorRepositoryArcanistProjectEditController id(new AphrontFormTokenizerControl()) ->setLabel('Uses Symbols From') ->setName('symbolIndexProjects') - ->setDatasource('/typeahead/common/arcanistprojects/') + ->setDatasource(new DiffusionArcanistProjectDatasource()) ->setValue($uses)) ->appendChild( id(new AphrontFormSubmitControl()) diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php index 9596d85001..cc671b89ae 100644 --- a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php +++ b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php @@ -28,7 +28,6 @@ final class PhabricatorTypeaheadCommonDatasourceController $need_projs = false; $need_packages = false; $need_upforgrabs = false; - $need_arcanist_projects = false; $need_noproject = false; $need_symbols = false; $need_jump_objects = false; @@ -76,9 +75,6 @@ final class PhabricatorTypeaheadCommonDatasourceController case 'packages': $need_packages = true; break; - case 'arcanistprojects': - $need_arcanist_projects = true; - break; } $results = array(); @@ -243,15 +239,6 @@ final class PhabricatorTypeaheadCommonDatasourceController } } - if ($need_arcanist_projects) { - $arcprojs = id(new PhabricatorRepositoryArcanistProject())->loadAll(); - foreach ($arcprojs as $proj) { - $results[] = id(new PhabricatorTypeaheadResult()) - ->setName($proj->getName()) - ->setPHID($proj->getPHID()); - } - } - if ($need_applications) { $applications = PhabricatorApplication::getAllInstalledApplications(); foreach ($applications as $application) {