mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search: removed old not working search shortcuts (#17226)
This commit is contained in:
parent
577beebcca
commit
e421723992
@ -13,8 +13,6 @@ export class HelpCtrl {
|
||||
{ keys: ['g', 'h'], description: 'Go to Home Dashboard' },
|
||||
{ keys: ['g', 'p'], description: 'Go to Profile' },
|
||||
{ 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' },
|
||||
],
|
||||
Dashboard: [
|
||||
|
@ -38,6 +38,10 @@ interface SelectedIndicies {
|
||||
folderIndex?: number;
|
||||
}
|
||||
|
||||
interface OpenSearchParams {
|
||||
query?: string;
|
||||
}
|
||||
|
||||
export class SearchCtrl {
|
||||
isOpen: boolean;
|
||||
query: SearchQuery;
|
||||
@ -94,7 +98,7 @@ export class SearchCtrl {
|
||||
appEvents.emit('search-query');
|
||||
}
|
||||
|
||||
openSearch(evt: any, payload: any) {
|
||||
openSearch(payload: OpenSearchParams = {}) {
|
||||
if (this.isOpen) {
|
||||
this.closeSearch();
|
||||
return;
|
||||
@ -105,19 +109,16 @@ export class SearchCtrl {
|
||||
this.selectedIndex = -1;
|
||||
this.results = [];
|
||||
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: [],
|
||||
starred: false,
|
||||
};
|
||||
|
||||
this.currentSearchId = 0;
|
||||
this.ignoreClose = true;
|
||||
this.isLoading = true;
|
||||
|
||||
if (payload && payload.starred) {
|
||||
this.query.starred = true;
|
||||
}
|
||||
|
||||
this.$timeout(() => {
|
||||
this.ignoreClose = false;
|
||||
this.giveSearchFocus = true;
|
||||
|
@ -43,21 +43,11 @@ export class KeybindingSrv {
|
||||
this.bind('g h', this.goToHome);
|
||||
this.bind('g a', this.openAlerting);
|
||||
this.bind('g p', this.goToProfile);
|
||||
this.bind('s s', this.openSearchStarred);
|
||||
this.bind('s o', this.openSearch);
|
||||
this.bind('s t', this.openSearchTags);
|
||||
this.bind('f', this.openSearch);
|
||||
this.bindGlobal('esc', this.exit);
|
||||
}
|
||||
|
||||
openSearchStarred() {
|
||||
appEvents.emit('show-dash-search', { starred: true });
|
||||
}
|
||||
|
||||
openSearchTags() {
|
||||
appEvents.emit('show-dash-search', { tagsMode: true });
|
||||
}
|
||||
|
||||
openSearch() {
|
||||
appEvents.emit('show-dash-search');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user