diff --git a/public/app/core/services/search_srv.ts b/public/app/core/services/search_srv.ts index 4b32c2735bf..3d85cb20005 100644 --- a/public/app/core/services/search_srv.ts +++ b/public/app/core/services/search_srv.ts @@ -52,7 +52,7 @@ export class SearchSrv { } search(options) { - if (!options.query) { + if (!options.query && !options.tag) { return this.browse(); } diff --git a/public/app/features/dashboard/dashboard_list_ctrl.ts b/public/app/features/dashboard/dashboard_list_ctrl.ts index 032e8d7ffa0..8f6820498b7 100644 --- a/public/app/features/dashboard/dashboard_list_ctrl.ts +++ b/public/app/features/dashboard/dashboard_list_ctrl.ts @@ -22,20 +22,29 @@ export class DashboardListCtrl { } getDashboards() { - return this.searchSrv.browse().then((result) => { + if (this.query.query.length === 0 && this.query.tag.length === 0) { + return this.searchSrv.browse().then((result) => { + return this.initDashboardList(result); + }); + } - this.sections = result; - - for (let section of this.sections) { - section.checked = false; - - for (let dashboard of section.items) { - dashboard.checked = false; - } - } + return this.searchSrv.search(this.query).then((result) => { + return this.initDashboardList(result); }); } + initDashboardList(result: any) { + this.sections = result; + + for (let section of this.sections) { + section.checked = false; + + for (let dashboard of section.items) { + dashboard.checked = false; + } + } + } + selectionChanged() { let selectedDashboards = 0; diff --git a/public/app/features/dashboard/partials/dashboardList.html b/public/app/features/dashboard/partials/dashboardList.html index 104861af637..ffd7faa6db5 100644 --- a/public/app/features/dashboard/partials/dashboardList.html +++ b/public/app/features/dashboard/partials/dashboardList.html @@ -58,19 +58,22 @@