From bf44210dc8f1e2bd437976161990721e91c4a6e8 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 22 Feb 2017 09:25:36 -0800 Subject: [PATCH] Reduce application search engine results list for Dashboards Summary: Ref T10390. Simplifies dropdown by rolling out canUseInPanel in useless panels Test Plan: Add a query panel, see less options. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T10390 Differential Revision: https://secure.phabricator.com/D17341 --- .../audit/query/PhabricatorCommitSearchEngine.php | 2 +- .../auth/query/PhabricatorAuthInviteSearchEngine.php | 6 +++++- .../badges/query/PhabricatorBadgesSearchEngine.php | 2 +- .../query/PhabricatorCalendarExportSearchEngine.php | 4 ++++ .../query/PhabricatorCalendarImportLogSearchEngine.php | 4 ++++ .../query/PhabricatorCalendarImportSearchEngine.php | 4 ++++ .../conduit/query/PhabricatorConduitLogSearchEngine.php | 4 ++++ .../conduit/query/PhabricatorConduitSearchEngine.php | 4 ++++ .../conpherence/query/ConpherenceThreadSearchEngine.php | 2 +- .../query/PhabricatorDashboardPanelSearchEngine.php | 4 ++++ .../dashboard/query/PhabricatorDashboardSearchEngine.php | 4 ++++ src/applications/diviner/query/DivinerAtomSearchEngine.php | 4 ++++ .../files/query/PhabricatorFileSearchEngine.php | 4 ++++ .../herald/query/HeraldTranscriptSearchEngine.php | 4 ++++ .../maniphest/query/ManiphestTaskSearchEngine.php | 2 +- .../metamta/query/PhabricatorMetaMTAMailSearchEngine.php | 4 ++++ .../query/PhabricatorOAuthServerClientSearchEngine.php | 4 ++++ .../owners/query/PhabricatorOwnersPackageSearchEngine.php | 4 ++++ .../query/PhabricatorPackagesPackageSearchEngine.php | 4 ++++ .../query/PhabricatorPackagesPublisherSearchEngine.php | 4 ++++ .../query/PhabricatorPackagesVersionSearchEngine.php | 4 ++++ src/applications/phrequent/query/PhrequentSearchEngine.php | 5 +++++ .../phurl/query/PhabricatorPhurlURLSearchEngine.php | 2 +- .../project/query/PhabricatorProjectColumnSearchEngine.php | 5 ++++- .../releeph/query/ReleephBranchSearchEngine.php | 4 ++++ .../releeph/query/ReleephProductSearchEngine.php | 4 ++++ .../releeph/query/ReleephRequestSearchEngine.php | 4 ++++ .../query/PhabricatorSearchApplicationSearchEngine.php | 4 ++++ .../query/PhabricatorEditEngineSearchEngine.php | 4 ++++ .../workers/query/PhabricatorWorkerBulkJobSearchEngine.php | 6 +++++- 30 files changed, 108 insertions(+), 8 deletions(-) diff --git a/src/applications/audit/query/PhabricatorCommitSearchEngine.php b/src/applications/audit/query/PhabricatorCommitSearchEngine.php index 7f429dd596..e1c1120608 100644 --- a/src/applications/audit/query/PhabricatorCommitSearchEngine.php +++ b/src/applications/audit/query/PhabricatorCommitSearchEngine.php @@ -4,7 +4,7 @@ final class PhabricatorCommitSearchEngine extends PhabricatorApplicationSearchEngine { public function getResultTypeDescription() { - return pht('Commits'); + return pht('Diffusion Commits'); } public function getApplicationClassName() { diff --git a/src/applications/auth/query/PhabricatorAuthInviteSearchEngine.php b/src/applications/auth/query/PhabricatorAuthInviteSearchEngine.php index d07ed15d41..e439dd9fb8 100644 --- a/src/applications/auth/query/PhabricatorAuthInviteSearchEngine.php +++ b/src/applications/auth/query/PhabricatorAuthInviteSearchEngine.php @@ -4,13 +4,17 @@ final class PhabricatorAuthInviteSearchEngine extends PhabricatorApplicationSearchEngine { public function getResultTypeDescription() { - return pht('Email Invites'); + return pht('Auth Email Invites'); } public function getApplicationClassName() { return 'PhabricatorAuthApplication'; } + public function canUseInPanelContext() { + return false; + } + public function buildSavedQueryFromRequest(AphrontRequest $request) { $saved = new PhabricatorSavedQuery(); diff --git a/src/applications/badges/query/PhabricatorBadgesSearchEngine.php b/src/applications/badges/query/PhabricatorBadgesSearchEngine.php index fc2bf7ef1e..b57eae5910 100644 --- a/src/applications/badges/query/PhabricatorBadgesSearchEngine.php +++ b/src/applications/badges/query/PhabricatorBadgesSearchEngine.php @@ -4,7 +4,7 @@ final class PhabricatorBadgesSearchEngine extends PhabricatorApplicationSearchEngine { public function getResultTypeDescription() { - return pht('Badge'); + return pht('Badges'); } public function getApplicationClassName() { diff --git a/src/applications/calendar/query/PhabricatorCalendarExportSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarExportSearchEngine.php index 4a65bfd099..032cab0c02 100644 --- a/src/applications/calendar/query/PhabricatorCalendarExportSearchEngine.php +++ b/src/applications/calendar/query/PhabricatorCalendarExportSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorCalendarExportSearchEngine return 'PhabricatorCalendarApplication'; } + public function canUseInPanelContext() { + return false; + } + public function newQuery() { $viewer = $this->requireViewer(); diff --git a/src/applications/calendar/query/PhabricatorCalendarImportLogSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarImportLogSearchEngine.php index 81a1256fca..99f292f9a8 100644 --- a/src/applications/calendar/query/PhabricatorCalendarImportLogSearchEngine.php +++ b/src/applications/calendar/query/PhabricatorCalendarImportLogSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorCalendarImportLogSearchEngine return 'PhabricatorCalendarApplication'; } + public function canUseInPanelContext() { + return false; + } + public function newQuery() { return new PhabricatorCalendarImportLogQuery(); } diff --git a/src/applications/calendar/query/PhabricatorCalendarImportSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarImportSearchEngine.php index 75252b6dac..a5e44812ea 100644 --- a/src/applications/calendar/query/PhabricatorCalendarImportSearchEngine.php +++ b/src/applications/calendar/query/PhabricatorCalendarImportSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorCalendarImportSearchEngine return 'PhabricatorCalendarApplication'; } + public function canUseInPanelContext() { + return false; + } + public function newQuery() { return new PhabricatorCalendarImportQuery(); } diff --git a/src/applications/conduit/query/PhabricatorConduitLogSearchEngine.php b/src/applications/conduit/query/PhabricatorConduitLogSearchEngine.php index 68f7060507..20d034168d 100644 --- a/src/applications/conduit/query/PhabricatorConduitLogSearchEngine.php +++ b/src/applications/conduit/query/PhabricatorConduitLogSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorConduitLogSearchEngine return 'PhabricatorConduitApplication'; } + public function canUseInPanelContext() { + return false; + } + public function newQuery() { return new PhabricatorConduitLogQuery(); } diff --git a/src/applications/conduit/query/PhabricatorConduitSearchEngine.php b/src/applications/conduit/query/PhabricatorConduitSearchEngine.php index 787c2154d5..9d244401e6 100644 --- a/src/applications/conduit/query/PhabricatorConduitSearchEngine.php +++ b/src/applications/conduit/query/PhabricatorConduitSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorConduitSearchEngine return 'PhabricatorConduitApplication'; } + public function canUseInPanelContext() { + return false; + } + public function getPageSize(PhabricatorSavedQuery $saved) { return PHP_INT_MAX - 1; } diff --git a/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php b/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php index 3129028c2e..4e0a89d266 100644 --- a/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php +++ b/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php @@ -4,7 +4,7 @@ final class ConpherenceThreadSearchEngine extends PhabricatorApplicationSearchEngine { public function getResultTypeDescription() { - return pht('Rooms'); + return pht('Conpherence Rooms'); } public function getApplicationClassName() { diff --git a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php index 89e77997d8..87e908b9c2 100644 --- a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php +++ b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php @@ -15,6 +15,10 @@ final class PhabricatorDashboardPanelSearchEngine return new PhabricatorDashboardPanelQuery(); } + public function canUseInPanelContext() { + return false; + } + protected function buildQueryFromParameters(array $map) { $query = $this->newQuery(); if ($map['status']) { diff --git a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php index 6061a0ab8a..a854b066f8 100644 --- a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php +++ b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php @@ -16,6 +16,10 @@ final class PhabricatorDashboardSearchEngine ->needPanels(true); } + public function canUseInPanelContext() { + return false; + } + protected function buildCustomSearchFields() { return array( id(new PhabricatorSearchTextField()) diff --git a/src/applications/diviner/query/DivinerAtomSearchEngine.php b/src/applications/diviner/query/DivinerAtomSearchEngine.php index cffdd3592d..35caf20a63 100644 --- a/src/applications/diviner/query/DivinerAtomSearchEngine.php +++ b/src/applications/diviner/query/DivinerAtomSearchEngine.php @@ -10,6 +10,10 @@ final class DivinerAtomSearchEngine extends PhabricatorApplicationSearchEngine { return 'PhabricatorDivinerApplication'; } + public function canUseInPanelContext() { + return false; + } + public function buildSavedQueryFromRequest(AphrontRequest $request) { $saved = new PhabricatorSavedQuery(); diff --git a/src/applications/files/query/PhabricatorFileSearchEngine.php b/src/applications/files/query/PhabricatorFileSearchEngine.php index f2193d3beb..1f2f2de4b3 100644 --- a/src/applications/files/query/PhabricatorFileSearchEngine.php +++ b/src/applications/files/query/PhabricatorFileSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorFileSearchEngine return 'PhabricatorFilesApplication'; } + public function canUseInPanelContext() { + return false; + } + public function newQuery() { return new PhabricatorFileQuery(); } diff --git a/src/applications/herald/query/HeraldTranscriptSearchEngine.php b/src/applications/herald/query/HeraldTranscriptSearchEngine.php index cc0d620394..e35620f0da 100644 --- a/src/applications/herald/query/HeraldTranscriptSearchEngine.php +++ b/src/applications/herald/query/HeraldTranscriptSearchEngine.php @@ -11,6 +11,10 @@ final class HeraldTranscriptSearchEngine return 'PhabricatorHeraldApplication'; } + public function canUseInPanelContext() { + return false; + } + public function buildSavedQueryFromRequest(AphrontRequest $request) { $saved = new PhabricatorSavedQuery(); diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php index 5246f32a0e..d8f5ab493a 100644 --- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php +++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php @@ -31,7 +31,7 @@ final class ManiphestTaskSearchEngine } public function getResultTypeDescription() { - return pht('Tasks'); + return pht('Maniphest Tasks'); } public function getApplicationClassName() { diff --git a/src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php b/src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php index 11ca1116ea..df7774aae2 100644 --- a/src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php +++ b/src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorMetaMTAMailSearchEngine return 'PhabricatorMetaMTAApplication'; } + public function canUseInPanelContext() { + return false; + } + public function newQuery() { return new PhabricatorMetaMTAMailQuery(); } diff --git a/src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php b/src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php index 3cb027fe4f..e07b1ea2c2 100644 --- a/src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php +++ b/src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorOAuthServerClientSearchEngine return 'PhabricatorOAuthServerApplication'; } + public function canUseInPanelContext() { + return false; + } + public function newQuery() { return id(new PhabricatorOAuthServerClientQuery()); } diff --git a/src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php b/src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php index 728c3f42a8..d6001419b4 100644 --- a/src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php +++ b/src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php @@ -15,6 +15,10 @@ final class PhabricatorOwnersPackageSearchEngine return new PhabricatorOwnersPackageQuery(); } + public function canUseInPanelContext() { + return false; + } + protected function buildCustomSearchFields() { return array( id(new PhabricatorSearchDatasourceField()) diff --git a/src/applications/packages/query/PhabricatorPackagesPackageSearchEngine.php b/src/applications/packages/query/PhabricatorPackagesPackageSearchEngine.php index e01c8db503..817321dec1 100644 --- a/src/applications/packages/query/PhabricatorPackagesPackageSearchEngine.php +++ b/src/applications/packages/query/PhabricatorPackagesPackageSearchEngine.php @@ -15,6 +15,10 @@ final class PhabricatorPackagesPackageSearchEngine return id(new PhabricatorPackagesPackageQuery()); } + public function canUseInPanelContext() { + return false; + } + protected function buildQueryFromParameters(array $map) { $query = $this->newQuery(); diff --git a/src/applications/packages/query/PhabricatorPackagesPublisherSearchEngine.php b/src/applications/packages/query/PhabricatorPackagesPublisherSearchEngine.php index f11738f730..be7b83f5fc 100644 --- a/src/applications/packages/query/PhabricatorPackagesPublisherSearchEngine.php +++ b/src/applications/packages/query/PhabricatorPackagesPublisherSearchEngine.php @@ -15,6 +15,10 @@ final class PhabricatorPackagesPublisherSearchEngine return id(new PhabricatorPackagesPublisherQuery()); } + public function canUseInPanelContext() { + return false; + } + protected function buildQueryFromParameters(array $map) { $query = $this->newQuery(); diff --git a/src/applications/packages/query/PhabricatorPackagesVersionSearchEngine.php b/src/applications/packages/query/PhabricatorPackagesVersionSearchEngine.php index da1581bf80..b3592ffd70 100644 --- a/src/applications/packages/query/PhabricatorPackagesVersionSearchEngine.php +++ b/src/applications/packages/query/PhabricatorPackagesVersionSearchEngine.php @@ -15,6 +15,10 @@ final class PhabricatorPackagesVersionSearchEngine return id(new PhabricatorPackagesVersionQuery()); } + public function canUseInPanelContext() { + return false; + } + protected function buildQueryFromParameters(array $map) { $query = $this->newQuery(); diff --git a/src/applications/phrequent/query/PhrequentSearchEngine.php b/src/applications/phrequent/query/PhrequentSearchEngine.php index d137c40b64..46f7ae769c 100644 --- a/src/applications/phrequent/query/PhrequentSearchEngine.php +++ b/src/applications/phrequent/query/PhrequentSearchEngine.php @@ -10,6 +10,11 @@ final class PhrequentSearchEngine extends PhabricatorApplicationSearchEngine { return 'PhabricatorPhrequentApplication'; } + public function canUseInPanelContext() { + return false; + } + + public function getPageSize(PhabricatorSavedQuery $saved) { return $saved->getParameter('limit', 1000); } diff --git a/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php b/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php index f2e2c99399..8814b25b9c 100644 --- a/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php +++ b/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php @@ -4,7 +4,7 @@ final class PhabricatorPhurlURLSearchEngine extends PhabricatorApplicationSearchEngine { public function getResultTypeDescription() { - return pht('Shortened URLs'); + return pht('Phurl URLs'); } public function getApplicationClassName() { diff --git a/src/applications/project/query/PhabricatorProjectColumnSearchEngine.php b/src/applications/project/query/PhabricatorProjectColumnSearchEngine.php index 0658ec75b0..68fe1e7eb0 100644 --- a/src/applications/project/query/PhabricatorProjectColumnSearchEngine.php +++ b/src/applications/project/query/PhabricatorProjectColumnSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorProjectColumnSearchEngine return 'PhabricatorProjectApplication'; } + public function canUseInPanelContext() { + return false; + } + public function newQuery() { return new PhabricatorProjectColumnQuery(); } @@ -25,7 +29,6 @@ final class PhabricatorProjectColumnSearchEngine ); } - protected function buildQueryFromParameters(array $map) { $query = $this->newQuery(); diff --git a/src/applications/releeph/query/ReleephBranchSearchEngine.php b/src/applications/releeph/query/ReleephBranchSearchEngine.php index 68ec126eb5..441f70e992 100644 --- a/src/applications/releeph/query/ReleephBranchSearchEngine.php +++ b/src/applications/releeph/query/ReleephBranchSearchEngine.php @@ -9,6 +9,10 @@ final class ReleephBranchSearchEngine return pht('Releeph Branches'); } + public function canUseInPanelContext() { + return false; + } + public function getApplicationClassName() { return 'PhabricatorReleephApplication'; } diff --git a/src/applications/releeph/query/ReleephProductSearchEngine.php b/src/applications/releeph/query/ReleephProductSearchEngine.php index f56125a687..d58ee735f1 100644 --- a/src/applications/releeph/query/ReleephProductSearchEngine.php +++ b/src/applications/releeph/query/ReleephProductSearchEngine.php @@ -11,6 +11,10 @@ final class ReleephProductSearchEngine return 'PhabricatorReleephApplication'; } + public function canUseInPanelContext() { + return false; + } + public function buildSavedQueryFromRequest(AphrontRequest $request) { $saved = new PhabricatorSavedQuery(); diff --git a/src/applications/releeph/query/ReleephRequestSearchEngine.php b/src/applications/releeph/query/ReleephRequestSearchEngine.php index 20aaa38ed9..7f866405c1 100644 --- a/src/applications/releeph/query/ReleephRequestSearchEngine.php +++ b/src/applications/releeph/query/ReleephRequestSearchEngine.php @@ -14,6 +14,10 @@ final class ReleephRequestSearchEngine return 'PhabricatorReleephApplication'; } + public function canUseInPanelContext() { + return false; + } + public function setBranch(ReleephBranch $branch) { $this->branch = $branch; return $this; diff --git a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php index 835e483cff..cf7dc0f6ba 100644 --- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php +++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php @@ -11,6 +11,10 @@ final class PhabricatorSearchApplicationSearchEngine return 'PhabricatorSearchApplication'; } + public function canUseInPanelContext() { + return false; + } + public function buildSavedQueryFromRequest(AphrontRequest $request) { $saved = new PhabricatorSavedQuery(); diff --git a/src/applications/transactions/query/PhabricatorEditEngineSearchEngine.php b/src/applications/transactions/query/PhabricatorEditEngineSearchEngine.php index 70cd4cd1a3..4ba1a0e879 100644 --- a/src/applications/transactions/query/PhabricatorEditEngineSearchEngine.php +++ b/src/applications/transactions/query/PhabricatorEditEngineSearchEngine.php @@ -15,6 +15,10 @@ final class PhabricatorEditEngineSearchEngine return id(new PhabricatorEditEngineQuery()); } + public function canUseInPanelContext() { + return false; + } + protected function buildQueryFromParameters(array $map) { $query = $this->newQuery(); return $query; diff --git a/src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobSearchEngine.php b/src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobSearchEngine.php index 223db0e95a..3b9d6c9d48 100644 --- a/src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobSearchEngine.php +++ b/src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobSearchEngine.php @@ -4,7 +4,7 @@ final class PhabricatorWorkerBulkJobSearchEngine extends PhabricatorApplicationSearchEngine { public function getResultTypeDescription() { - return pht('Bulk Jobs'); + return pht('Daemon Bulk Jobs'); } public function getApplicationClassName() { @@ -15,6 +15,10 @@ final class PhabricatorWorkerBulkJobSearchEngine return id(new PhabricatorWorkerBulkJobQuery()); } + public function canUseInPanelContext() { + return false; + } + protected function buildQueryFromParameters(array $map) { $query = $this->newQuery();