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

This commit is contained in:
Torkel Ödegaard 2019-05-22 12:23:30 +02:00 committed by GitHub
parent 577beebcca
commit e421723992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 19 deletions

View File

@ -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: [

View File

@ -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;

View File

@ -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');
}