Просмотр исходного кода

Search: removed old not working search shortcuts (#17226)

Torkel Ödegaard 6 лет назад
Родитель
Сommit
e421723992

+ 0 - 2
public/app/core/components/help/help.ts

@@ -13,8 +13,6 @@ export class HelpCtrl {
         { keys: ['g', 'h'], description: 'Go to Home Dashboard' },
         { keys: ['g', 'h'], description: 'Go to Home Dashboard' },
         { keys: ['g', 'p'], description: 'Go to Profile' },
         { keys: ['g', 'p'], description: 'Go to Profile' },
         { keys: ['s', 'o'], description: 'Open search' },
         { keys: ['s', 'o'], description: 'Open search' },
-        { keys: ['s', 's'], description: 'Open search with starred filter' },
-        { keys: ['s', 't'], description: 'Open search in tags view' },
         { keys: ['esc'], description: 'Exit edit/setting views' },
         { keys: ['esc'], description: 'Exit edit/setting views' },
       ],
       ],
       Dashboard: [
       Dashboard: [

+ 8 - 7
public/app/core/components/search/search.ts

@@ -38,6 +38,10 @@ interface SelectedIndicies {
   folderIndex?: number;
   folderIndex?: number;
 }
 }
 
 
+interface OpenSearchParams {
+  query?: string;
+}
+
 export class SearchCtrl {
 export class SearchCtrl {
   isOpen: boolean;
   isOpen: boolean;
   query: SearchQuery;
   query: SearchQuery;
@@ -94,7 +98,7 @@ export class SearchCtrl {
     appEvents.emit('search-query');
     appEvents.emit('search-query');
   }
   }
 
 
-  openSearch(evt: any, payload: any) {
+  openSearch(payload: OpenSearchParams = {}) {
     if (this.isOpen) {
     if (this.isOpen) {
       this.closeSearch();
       this.closeSearch();
       return;
       return;
@@ -105,19 +109,16 @@ export class SearchCtrl {
     this.selectedIndex = -1;
     this.selectedIndex = -1;
     this.results = [];
     this.results = [];
     this.query = {
     this.query = {
-      query: evt ? `${evt.query} ` : '',
-      parsedQuery: this.queryParser.parse(evt && evt.query),
+      query: payload.query ? `${payload.query} ` : '',
+      parsedQuery: this.queryParser.parse(payload.query),
       tags: [],
       tags: [],
       starred: false,
       starred: false,
     };
     };
+
     this.currentSearchId = 0;
     this.currentSearchId = 0;
     this.ignoreClose = true;
     this.ignoreClose = true;
     this.isLoading = true;
     this.isLoading = true;
 
 
-    if (payload && payload.starred) {
-      this.query.starred = true;
-    }
-
     this.$timeout(() => {
     this.$timeout(() => {
       this.ignoreClose = false;
       this.ignoreClose = false;
       this.giveSearchFocus = true;
       this.giveSearchFocus = true;

+ 0 - 10
public/app/core/services/keybindingSrv.ts

@@ -43,21 +43,11 @@ export class KeybindingSrv {
     this.bind('g h', this.goToHome);
     this.bind('g h', this.goToHome);
     this.bind('g a', this.openAlerting);
     this.bind('g a', this.openAlerting);
     this.bind('g p', this.goToProfile);
     this.bind('g p', this.goToProfile);
-    this.bind('s s', this.openSearchStarred);
     this.bind('s o', this.openSearch);
     this.bind('s o', this.openSearch);
-    this.bind('s t', this.openSearchTags);
     this.bind('f', this.openSearch);
     this.bind('f', this.openSearch);
     this.bindGlobal('esc', this.exit);
     this.bindGlobal('esc', this.exit);
   }
   }
 
 
-  openSearchStarred() {
-    appEvents.emit('show-dash-search', { starred: true });
-  }
-
-  openSearchTags() {
-    appEvents.emit('show-dash-search', { tagsMode: true });
-  }
-
   openSearch() {
   openSearch() {
     appEvents.emit('show-dash-search');
     appEvents.emit('show-dash-search');
   }
   }