From acb1eb81ccf467bd32d2821511d652527f7191df Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 6 Jul 2015 22:52:04 +1000 Subject: [PATCH] Move some PhabricatorSearchField subclasses Summary: Move some `PhabricatorSearchField` subclasses to be adjacent to the application to which they belong. This seems generally better to me than lumping them all together in the `src/applications/search/field/` directory. I was also wondering if it makes sense to rename these subclasses as `PhabricatorXSearchField` rather than `PhabricatorSearchXField` (as per T5655), but wasn't really sure if these objects are meant to be search-fields, or just fields belonging to the #search application. Test Plan: N/A. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13374 --- src/__phutil_library_map__.php | 18 +++++++++--------- .../query/PhabricatorFileSearchEngine.php | 2 +- .../query/PhabricatorMacroSearchEngine.php | 2 +- .../query/ManiphestTaskSearchEngine.php | 4 ++-- .../PhabricatorMetaMTAMailSearchEngine.php | 4 ++-- .../PhabricatorOwnersSearchField.php} | 2 +- .../query/PhabricatorPasteSearchEngine.php | 2 +- .../search/PhabricatorUserSearchField.php} | 2 +- .../PhabricatorUserSearchIndexer.php | 0 .../pholio/query/PholioMockSearchEngine.php | 2 +- .../query/PhabricatorProjectSearchEngine.php | 2 +- .../PhabricatorProjectSearchField.php} | 2 +- .../PhabricatorApplicationSearchEngine.php | 4 ++-- .../PhabricatorSpacesSearchField.php} | 2 +- .../PhabricatorWorkerBulkJobSearchEngine.php | 2 +- 15 files changed, 25 insertions(+), 25 deletions(-) rename src/applications/{search/field/PhabricatorSearchOwnersField.php => owners/searchfield/PhabricatorOwnersSearchField.php} (89%) rename src/applications/{search/field/PhabricatorSearchUsersField.php => people/search/PhabricatorUserSearchField.php} (89%) rename src/applications/people/{search => searchfield}/PhabricatorUserSearchIndexer.php (100%) rename src/applications/{search/field/PhabricatorSearchProjectsField.php => project/searchfield/PhabricatorProjectSearchField.php} (96%) rename src/applications/{search/field/PhabricatorSearchSpacesField.php => spaces/searchfield/PhabricatorSpacesSearchField.php} (95%) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index aeda985b28..b2520b7b07 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2240,6 +2240,7 @@ phutil_register_library_map(array( 'PhabricatorOwnersPackageTransactionQuery' => 'applications/owners/query/PhabricatorOwnersPackageTransactionQuery.php', 'PhabricatorOwnersPath' => 'applications/owners/storage/PhabricatorOwnersPath.php', 'PhabricatorOwnersPathsController' => 'applications/owners/controller/PhabricatorOwnersPathsController.php', + 'PhabricatorOwnersSearchField' => 'applications/owners/searchfield/PhabricatorOwnersSearchField.php', 'PhabricatorPHDConfigOptions' => 'applications/config/option/PhabricatorPHDConfigOptions.php', 'PhabricatorPHID' => 'applications/phid/storage/PhabricatorPHID.php', 'PhabricatorPHIDConstants' => 'applications/phid/PhabricatorPHIDConstants.php', @@ -2416,6 +2417,7 @@ phutil_register_library_map(array( 'PhabricatorProjectQuery' => 'applications/project/query/PhabricatorProjectQuery.php', 'PhabricatorProjectSchemaSpec' => 'applications/project/storage/PhabricatorProjectSchemaSpec.php', 'PhabricatorProjectSearchEngine' => 'applications/project/query/PhabricatorProjectSearchEngine.php', + 'PhabricatorProjectSearchField' => 'applications/project/searchfield/PhabricatorProjectSearchField.php', 'PhabricatorProjectSearchIndexer' => 'applications/project/search/PhabricatorProjectSearchIndexer.php', 'PhabricatorProjectSlug' => 'applications/project/storage/PhabricatorProjectSlug.php', 'PhabricatorProjectStandardCustomField' => 'applications/project/customfield/PhabricatorProjectStandardCustomField.php', @@ -2588,20 +2590,16 @@ phutil_register_library_map(array( 'PhabricatorSearchManagementWorkflow' => 'applications/search/management/PhabricatorSearchManagementWorkflow.php', 'PhabricatorSearchOrderController' => 'applications/search/controller/PhabricatorSearchOrderController.php', 'PhabricatorSearchOrderField' => 'applications/search/field/PhabricatorSearchOrderField.php', - 'PhabricatorSearchOwnersField' => 'applications/search/field/PhabricatorSearchOwnersField.php', 'PhabricatorSearchPreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorSearchPreferencesSettingsPanel.php', - 'PhabricatorSearchProjectsField' => 'applications/search/field/PhabricatorSearchProjectsField.php', 'PhabricatorSearchRelationship' => 'applications/search/constants/PhabricatorSearchRelationship.php', 'PhabricatorSearchResultView' => 'applications/search/view/PhabricatorSearchResultView.php', 'PhabricatorSearchSelectController' => 'applications/search/controller/PhabricatorSearchSelectController.php', 'PhabricatorSearchSelectField' => 'applications/search/field/PhabricatorSearchSelectField.php', - 'PhabricatorSearchSpacesField' => 'applications/search/field/PhabricatorSearchSpacesField.php', 'PhabricatorSearchStringListField' => 'applications/search/field/PhabricatorSearchStringListField.php', 'PhabricatorSearchSubscribersField' => 'applications/search/field/PhabricatorSearchSubscribersField.php', 'PhabricatorSearchTextField' => 'applications/search/field/PhabricatorSearchTextField.php', 'PhabricatorSearchThreeStateField' => 'applications/search/field/PhabricatorSearchThreeStateField.php', 'PhabricatorSearchTokenizerField' => 'applications/search/field/PhabricatorSearchTokenizerField.php', - 'PhabricatorSearchUsersField' => 'applications/search/field/PhabricatorSearchUsersField.php', 'PhabricatorSearchWorker' => 'applications/search/worker/PhabricatorSearchWorker.php', 'PhabricatorSecurityConfigOptions' => 'applications/config/option/PhabricatorSecurityConfigOptions.php', 'PhabricatorSecuritySetupCheck' => 'applications/config/check/PhabricatorSecuritySetupCheck.php', @@ -2664,6 +2662,7 @@ phutil_register_library_map(array( 'PhabricatorSpacesNoAccessController' => 'applications/spaces/controller/PhabricatorSpacesNoAccessController.php', 'PhabricatorSpacesRemarkupRule' => 'applications/spaces/remarkup/PhabricatorSpacesRemarkupRule.php', 'PhabricatorSpacesSchemaSpec' => 'applications/spaces/storage/PhabricatorSpacesSchemaSpec.php', + 'PhabricatorSpacesSearchField' => 'applications/spaces/searchfield/PhabricatorSpacesSearchField.php', 'PhabricatorSpacesTestCase' => 'applications/spaces/__tests__/PhabricatorSpacesTestCase.php', 'PhabricatorSpacesViewController' => 'applications/spaces/controller/PhabricatorSpacesViewController.php', 'PhabricatorStandardCustomField' => 'infrastructure/customfield/standard/PhabricatorStandardCustomField.php', @@ -2814,13 +2813,14 @@ phutil_register_library_map(array( 'PhabricatorUserRealNameField' => 'applications/people/customfield/PhabricatorUserRealNameField.php', 'PhabricatorUserRolesField' => 'applications/people/customfield/PhabricatorUserRolesField.php', 'PhabricatorUserSchemaSpec' => 'applications/people/storage/PhabricatorUserSchemaSpec.php', - 'PhabricatorUserSearchIndexer' => 'applications/people/search/PhabricatorUserSearchIndexer.php', + 'PhabricatorUserSearchIndexer' => 'applications/people/searchfield/PhabricatorUserSearchIndexer.php', 'PhabricatorUserSinceField' => 'applications/people/customfield/PhabricatorUserSinceField.php', 'PhabricatorUserStatusField' => 'applications/people/customfield/PhabricatorUserStatusField.php', 'PhabricatorUserTestCase' => 'applications/people/storage/__tests__/PhabricatorUserTestCase.php', 'PhabricatorUserTitleField' => 'applications/people/customfield/PhabricatorUserTitleField.php', 'PhabricatorUserTransaction' => 'applications/people/storage/PhabricatorUserTransaction.php', 'PhabricatorUsersPolicyRule' => 'applications/policy/rule/PhabricatorUsersPolicyRule.php', + 'PhabricatorUsersSearchField' => 'applications/people/search/PhabricatorUserSearchField.php', 'PhabricatorVCSResponse' => 'applications/repository/response/PhabricatorVCSResponse.php', 'PhabricatorVeryWowEnglishTranslation' => 'infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php', 'PhabricatorViewerDatasource' => 'applications/people/typeahead/PhabricatorViewerDatasource.php', @@ -5939,6 +5939,7 @@ phutil_register_library_map(array( 'PhabricatorOwnersPackageTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PhabricatorOwnersPath' => 'PhabricatorOwnersDAO', 'PhabricatorOwnersPathsController' => 'PhabricatorOwnersController', + 'PhabricatorOwnersSearchField' => 'PhabricatorSearchTokenizerField', 'PhabricatorPHDConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPHID' => 'Phobject', 'PhabricatorPHIDConstants' => 'Phobject', @@ -6151,6 +6152,7 @@ phutil_register_library_map(array( 'PhabricatorProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorProjectSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', + 'PhabricatorProjectSearchField' => 'PhabricatorSearchTokenizerField', 'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorProjectSlug' => 'PhabricatorProjectDAO', 'PhabricatorProjectStandardCustomField' => array( @@ -6370,20 +6372,16 @@ phutil_register_library_map(array( 'PhabricatorSearchManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorSearchOrderController' => 'PhabricatorSearchBaseController', 'PhabricatorSearchOrderField' => 'PhabricatorSearchField', - 'PhabricatorSearchOwnersField' => 'PhabricatorSearchTokenizerField', 'PhabricatorSearchPreferencesSettingsPanel' => 'PhabricatorSettingsPanel', - 'PhabricatorSearchProjectsField' => 'PhabricatorSearchTokenizerField', 'PhabricatorSearchRelationship' => 'Phobject', 'PhabricatorSearchResultView' => 'AphrontView', 'PhabricatorSearchSelectController' => 'PhabricatorSearchBaseController', 'PhabricatorSearchSelectField' => 'PhabricatorSearchField', - 'PhabricatorSearchSpacesField' => 'PhabricatorSearchTokenizerField', 'PhabricatorSearchStringListField' => 'PhabricatorSearchField', 'PhabricatorSearchSubscribersField' => 'PhabricatorSearchTokenizerField', 'PhabricatorSearchTextField' => 'PhabricatorSearchField', 'PhabricatorSearchThreeStateField' => 'PhabricatorSearchField', 'PhabricatorSearchTokenizerField' => 'PhabricatorSearchField', - 'PhabricatorSearchUsersField' => 'PhabricatorSearchTokenizerField', 'PhabricatorSearchWorker' => 'PhabricatorWorker', 'PhabricatorSecurityConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorSecuritySetupCheck' => 'PhabricatorSetupCheck', @@ -6460,6 +6458,7 @@ phutil_register_library_map(array( 'PhabricatorSpacesNoAccessController' => 'PhabricatorSpacesController', 'PhabricatorSpacesRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PhabricatorSpacesSchemaSpec' => 'PhabricatorConfigSchemaSpec', + 'PhabricatorSpacesSearchField' => 'PhabricatorSearchTokenizerField', 'PhabricatorSpacesTestCase' => 'PhabricatorTestCase', 'PhabricatorSpacesViewController' => 'PhabricatorSpacesController', 'PhabricatorStandardCustomField' => 'PhabricatorCustomField', @@ -6634,6 +6633,7 @@ phutil_register_library_map(array( 'PhabricatorUserTitleField' => 'PhabricatorUserCustomField', 'PhabricatorUserTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorUsersPolicyRule' => 'PhabricatorPolicyRule', + 'PhabricatorUsersSearchField' => 'PhabricatorSearchTokenizerField', 'PhabricatorVCSResponse' => 'AphrontResponse', 'PhabricatorVeryWowEnglishTranslation' => 'PhutilTranslation', 'PhabricatorViewerDatasource' => 'PhabricatorTypeaheadDatasource', diff --git a/src/applications/files/query/PhabricatorFileSearchEngine.php b/src/applications/files/query/PhabricatorFileSearchEngine.php index 7625a637db..70dfaba23f 100644 --- a/src/applications/files/query/PhabricatorFileSearchEngine.php +++ b/src/applications/files/query/PhabricatorFileSearchEngine.php @@ -17,7 +17,7 @@ final class PhabricatorFileSearchEngine protected function buildCustomSearchFields() { return array( - id(new PhabricatorSearchUsersField()) + id(new PhabricatorUsersSearchField()) ->setKey('authorPHIDs') ->setAliases(array('author', 'authors')) ->setLabel(pht('Authors')), diff --git a/src/applications/macro/query/PhabricatorMacroSearchEngine.php b/src/applications/macro/query/PhabricatorMacroSearchEngine.php index 1adb7f8b56..2000b3275a 100644 --- a/src/applications/macro/query/PhabricatorMacroSearchEngine.php +++ b/src/applications/macro/query/PhabricatorMacroSearchEngine.php @@ -22,7 +22,7 @@ final class PhabricatorMacroSearchEngine ->setLabel(pht('Status')) ->setKey('status') ->setOptions(PhabricatorMacroQuery::getStatusOptions()), - id(new PhabricatorSearchUsersField()) + id(new PhabricatorUsersSearchField()) ->setLabel(pht('Authors')) ->setKey('authorPHIDs') ->setAliases(array('author', 'authors')), diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php index 54b9cd959f..1c0854218d 100644 --- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php +++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php @@ -45,11 +45,11 @@ final class ManiphestTaskSearchEngine protected function buildCustomSearchFields() { return array( - id(new PhabricatorSearchOwnersField()) + id(new PhabricatorOwnersSearchField()) ->setLabel(pht('Assigned To')) ->setKey('assignedPHIDs') ->setAliases(array('assigned')), - id(new PhabricatorSearchUsersField()) + id(new PhabricatorUsersSearchField()) ->setLabel(pht('Authors')) ->setKey('authorPHIDs') ->setAliases(array('author', 'authors')), diff --git a/src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php b/src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php index 6f7588289b..d4bdf041ef 100644 --- a/src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php +++ b/src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php @@ -21,11 +21,11 @@ final class PhabricatorMetaMTAMailSearchEngine protected function buildCustomSearchFields() { return array( - id(new PhabricatorSearchUsersField()) + id(new PhabricatorUsersSearchField()) ->setLabel(pht('Actors')) ->setKey('actorPHIDs') ->setAliases(array('actor', 'actors')), - id(new PhabricatorSearchUsersField()) + id(new PhabricatorUsersSearchField()) ->setLabel(pht('Recipients')) ->setKey('recipientPHIDs') ->setAliases(array('recipient', 'recipients')), diff --git a/src/applications/search/field/PhabricatorSearchOwnersField.php b/src/applications/owners/searchfield/PhabricatorOwnersSearchField.php similarity index 89% rename from src/applications/search/field/PhabricatorSearchOwnersField.php rename to src/applications/owners/searchfield/PhabricatorOwnersSearchField.php index 6d7d8db407..d39ed191f8 100644 --- a/src/applications/search/field/PhabricatorSearchOwnersField.php +++ b/src/applications/owners/searchfield/PhabricatorOwnersSearchField.php @@ -1,6 +1,6 @@ setAliases(array('authors')) ->setKey('authorPHIDs') ->setLabel(pht('Authors')), diff --git a/src/applications/search/field/PhabricatorSearchUsersField.php b/src/applications/people/search/PhabricatorUserSearchField.php similarity index 89% rename from src/applications/search/field/PhabricatorSearchUsersField.php rename to src/applications/people/search/PhabricatorUserSearchField.php index 889afe99be..6b821a6421 100644 --- a/src/applications/search/field/PhabricatorSearchUsersField.php +++ b/src/applications/people/search/PhabricatorUserSearchField.php @@ -1,6 +1,6 @@ setKey('authorPHIDs') ->setAliases(array('authors')) ->setLabel(pht('Authors')), diff --git a/src/applications/project/query/PhabricatorProjectSearchEngine.php b/src/applications/project/query/PhabricatorProjectSearchEngine.php index da2c9a913b..e63a0940c3 100644 --- a/src/applications/project/query/PhabricatorProjectSearchEngine.php +++ b/src/applications/project/query/PhabricatorProjectSearchEngine.php @@ -21,7 +21,7 @@ final class PhabricatorProjectSearchEngine id(new PhabricatorSearchTextField()) ->setLabel(pht('Name')) ->setKey('name'), - id(new PhabricatorSearchUsersField()) + id(new PhabricatorUsersSearchField()) ->setLabel(pht('Members')) ->setKey('memberPHIDs') ->setAliases(array('member', 'members')), diff --git a/src/applications/search/field/PhabricatorSearchProjectsField.php b/src/applications/project/searchfield/PhabricatorProjectSearchField.php similarity index 96% rename from src/applications/search/field/PhabricatorSearchProjectsField.php rename to src/applications/project/searchfield/PhabricatorProjectSearchField.php index cf26e5354c..c3d230653c 100644 --- a/src/applications/search/field/PhabricatorSearchProjectsField.php +++ b/src/applications/project/searchfield/PhabricatorProjectSearchField.php @@ -1,6 +1,6 @@ setKey('projectPHIDs') ->setAliases(array('project', 'projects')) ->setLabel(pht('Projects')); @@ -253,7 +253,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { if ($object instanceof PhabricatorSpacesInterface) { if (PhabricatorSpacesNamespaceQuery::getSpacesExist()) { - $fields[] = id(new PhabricatorSearchSpacesField()) + $fields[] = id(new PhabricatorSpacesSearchField()) ->setKey('spacePHIDs') ->setAliases(array('space', 'spaces')) ->setLabel(pht('Spaces')); diff --git a/src/applications/search/field/PhabricatorSearchSpacesField.php b/src/applications/spaces/searchfield/PhabricatorSpacesSearchField.php similarity index 95% rename from src/applications/search/field/PhabricatorSearchSpacesField.php rename to src/applications/spaces/searchfield/PhabricatorSpacesSearchField.php index 670e47db11..751178d498 100644 --- a/src/applications/search/field/PhabricatorSearchSpacesField.php +++ b/src/applications/spaces/searchfield/PhabricatorSpacesSearchField.php @@ -1,6 +1,6 @@ setLabel(pht('Authors')) ->setKey('authorPHIDs') ->setAliases(array('author', 'authors')),