diff --git a/public/app/core/components/search/search.html b/public/app/core/components/search/search.html index e0106740d3a..acaf0730a6b 100644 --- a/public/app/core/components/search/search.html +++ b/public/app/core/components/search/search.html @@ -43,7 +43,7 @@ -
+
New dashboard diff --git a/public/app/core/components/search/search.ts b/public/app/core/components/search/search.ts index 04b77e7b7fe..25e05c2139d 100644 --- a/public/app/core/components/search/search.ts +++ b/public/app/core/components/search/search.ts @@ -1,6 +1,7 @@ import _ from 'lodash'; import coreModule from '../../core_module'; import { SearchSrv } from 'app/core/services/search_srv'; +import { contextSrv } from 'app/core/services/context_srv'; import appEvents from 'app/core/app_events'; export class SearchCtrl { @@ -15,6 +16,7 @@ export class SearchCtrl { ignoreClose: any; isLoading: boolean; initialFolderFilterTitle: string; + isEditor: string; /** @ngInject */ constructor($scope, private $location, private $timeout, private searchSrv: SearchSrv) { @@ -24,6 +26,7 @@ export class SearchCtrl { this.initialFolderFilterTitle = 'All'; this.getTags = this.getTags.bind(this); this.onTagSelect = this.onTagSelect.bind(this); + this.isEditor = contextSrv.isEditor; } closeSearch() { diff --git a/public/app/core/specs/search.jest.ts b/public/app/core/specs/search.jest.ts index 2c1172bcf55..8aea35af213 100644 --- a/public/app/core/specs/search.jest.ts +++ b/public/app/core/specs/search.jest.ts @@ -1,6 +1,12 @@ import { SearchCtrl } from '../components/search/search'; import { SearchSrv } from '../services/search_srv'; +jest.mock('app/core/services/context_srv', () => ({ + contextSrv: { + user: { orgId: 1 }, + }, +})); + describe('SearchCtrl', () => { const searchSrvStub = { search: (options: any) => {},