Commit 9460063a by Alexander Zobnin

show import menu in sidenav, dashboard search and manage dashboards page

if user has editor permissions for at least one folder
parent 4ff4ac1d
...@@ -95,6 +95,7 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) { ...@@ -95,6 +95,7 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
if hasEditPermissionInFoldersQuery.Result { if hasEditPermissionInFoldersQuery.Result {
children := []*dtos.NavLink{ children := []*dtos.NavLink{
{Text: "Dashboard", Icon: "gicon gicon-dashboard-new", Url: setting.AppSubUrl + "/dashboard/new"}, {Text: "Dashboard", Icon: "gicon gicon-dashboard-new", Url: setting.AppSubUrl + "/dashboard/new"},
{Text: "Import", SubTitle: "Import dashboard from file or Grafana.com", Id: "import", Icon: "gicon gicon-dashboard-import", Url: setting.AppSubUrl + "/dashboard/import"},
} }
if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR { if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR {
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<a href="dashboards/folder/new" class="search-filter-box-link" ng-if="ctrl.isEditor"> <a href="dashboards/folder/new" class="search-filter-box-link" ng-if="ctrl.isEditor">
<i class="gicon gicon-folder-new"></i> New folder <i class="gicon gicon-folder-new"></i> New folder
</a> </a>
<a href="dashboard/import" class="search-filter-box-link" ng-if="ctrl.isEditor"> <a href="dashboard/import" class="search-filter-box-link" ng-if="ctrl.isEditor || ctrl.hasEditPermissionInFolders">
<i class="gicon gicon-dashboard-import"></i> Import dashboard <i class="gicon gicon-dashboard-import"></i> Import dashboard
</a> </a>
<a class="search-filter-box-link" target="_blank" href="https://grafana.com/dashboards?utm_source=grafana_search"> <a class="search-filter-box-link" target="_blank" href="https://grafana.com/dashboards?utm_source=grafana_search">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment