Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14412807
D20793.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D20793.diff
View Options
diff --git a/src/applications/settings/setting/PhabricatorSearchScopeSetting.php b/src/applications/settings/setting/PhabricatorSearchScopeSetting.php
--- a/src/applications/settings/setting/PhabricatorSearchScopeSetting.php
+++ b/src/applications/settings/setting/PhabricatorSearchScopeSetting.php
@@ -25,7 +25,8 @@
protected function getSelectOptions() {
$scopes = PhabricatorMainMenuSearchView::getGlobalSearchScopeItems(
$this->getViewer(),
- new PhabricatorSettingsApplication());
+ new PhabricatorSettingsApplication(),
+ $only_global = true);
$scope_map = array();
foreach ($scopes as $scope) {
diff --git a/src/view/page/menu/PhabricatorMainMenuSearchView.php b/src/view/page/menu/PhabricatorMainMenuSearchView.php
--- a/src/view/page/menu/PhabricatorMainMenuSearchView.php
+++ b/src/view/page/menu/PhabricatorMainMenuSearchView.php
@@ -118,7 +118,8 @@
public static function getGlobalSearchScopeItems(
PhabricatorUser $viewer,
- PhabricatorApplication $application = null) {
+ PhabricatorApplication $application = null,
+ $global_only = false) {
$items = array();
$items[] = array(
@@ -154,14 +155,24 @@
$engine = id(new PhabricatorSearchApplicationSearchEngine())
->setViewer($viewer);
$engine_queries = $engine->loadEnabledNamedQueries();
- $query_map = mpull($engine_queries, 'getQueryName', 'getQueryKey');
- foreach ($query_map as $query_key => $query_name) {
+ foreach ($engine_queries as $query) {
+ $query_key = $query->getQueryKey();
if ($query_key == 'all') {
// Skip the builtin "All" query since it's redundant with the default
// setting.
continue;
}
+ // In the global "Settings" panel, we don't want to offer personal
+ // queries the viewer may have saved.
+ if ($global_only) {
+ if (!$query->isGlobal()) {
+ continue;
+ }
+ }
+
+ $query_name = $query->getQueryName();
+
$items[] = array(
'icon' => 'fa-certificate',
'name' => $query_name,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 1:25 PM (10 h, 47 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6926457
Default Alt Text
D20793.diff (2 KB)
Attached To
Mode
D20793: Don't offer personal saved queries in global "Search Scope" settings dropdown
Attached
Detach File
Event Timeline
Log In to Comment