diff --git a/public/app/features/dashboard/dashboard_list_ctrl.ts b/public/app/features/dashboard/dashboard_list_ctrl.ts index 57b692833d8..8127edf841c 100644 --- a/public/app/features/dashboard/dashboard_list_ctrl.ts +++ b/public/app/features/dashboard/dashboard_list_ctrl.ts @@ -39,6 +39,9 @@ export class DashboardListCtrl { } initDashboardList(result: any) { + this.canMove = false; + this.canDelete = false; + if (!result) { this.sections = []; return; @@ -159,6 +162,10 @@ export class DashboardListCtrl { return this.getDashboards(); } + onQueryChange() { + return this.getDashboards(); + } + onTagFilterChange() { this.query.tag.push(this.selectedTagFilter.term); this.selectedTagFilter = this.tagFilterOptions[0]; diff --git a/public/app/features/dashboard/partials/dashboardList.html b/public/app/features/dashboard/partials/dashboardList.html index d0f2b6a411c..ac1477bd2d3 100644 --- a/public/app/features/dashboard/partials/dashboardList.html +++ b/public/app/features/dashboard/partials/dashboardList.html @@ -17,7 +17,7 @@
+ ng-model="ctrl.query.query" ng-model-options="{ debounce: 500 }" spellcheck='false' ng-change="ctrl.onQueryChange()" />
diff --git a/public/app/features/dashboard/specs/dashboard_list_ctrl.jest.ts b/public/app/features/dashboard/specs/dashboard_list_ctrl.jest.ts index 63c72fce547..e39bdfdb67a 100644 --- a/public/app/features/dashboard/specs/dashboard_list_ctrl.jest.ts +++ b/public/app/features/dashboard/specs/dashboard_list_ctrl.jest.ts @@ -110,6 +110,8 @@ describe('DashboardListCtrl', () => { describe('with no filter', () => { beforeEach(() => { ctrl.query.query = 'd'; + ctrl.canMove = true; + ctrl.canDelete = true; return ctrl.getDashboards(); }); @@ -120,6 +122,14 @@ describe('DashboardListCtrl', () => { expect(ctrl.sections[1].checked).toEqual(false); expect(ctrl.sections[1].items[0].checked).toEqual(false); }); + + it('should disable Move To button', () => { + expect(ctrl.canMove).toBeFalsy(); + }); + + it('should disable delete button', () => { + expect(ctrl.canDelete).toBeFalsy(); + }); }); describe('with tag filter', () => { diff --git a/public/sass/components/_search.scss b/public/sass/components/_search.scss index 74d7023d6ac..5fded2dbbf0 100644 --- a/public/sass/components/_search.scss +++ b/public/sass/components/_search.scss @@ -126,6 +126,10 @@ .search-item__with-checkbox { display: flex; + + .search-item { + margin: 1px 3px; + } } .search-item {