From 5d16da732faf93cba6322b42bdbdd553445d77b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 22 May 2019 12:23:30 +0200 Subject: [PATCH] Search: removed old not working search shortcuts (#17226) (cherry picked from commit e4217239925fc4a8d7428ceb65235b96bee3c111) --- public/app/core/components/help/help.ts | 2 -- public/app/core/components/search/search.ts | 15 ++++++++------- public/app/core/services/keybindingSrv.ts | 10 ---------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/public/app/core/components/help/help.ts b/public/app/core/components/help/help.ts index 7ef54339f49..63be172a5de 100644 --- a/public/app/core/components/help/help.ts +++ b/public/app/core/components/help/help.ts @@ -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: [ diff --git a/public/app/core/components/search/search.ts b/public/app/core/components/search/search.ts index 9cf8e9cd8c1..b11f1ca2c49 100644 --- a/public/app/core/components/search/search.ts +++ b/public/app/core/components/search/search.ts @@ -32,6 +32,10 @@ class SearchQueryParser { } } +interface OpenSearchParams { + query?: string; +} + export class SearchCtrl { isOpen: boolean; query: SearchQuery; @@ -88,7 +92,7 @@ export class SearchCtrl { appEvents.emit('search-query'); } - openSearch(evt, payload) { + openSearch(payload: OpenSearchParams = {}) { if (this.isOpen) { this.closeSearch(); return; @@ -99,19 +103,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; diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index 6fb50dd4ec2..0a4bd1c028c 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -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'); }