mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Admin: Remove navigation subheaders (#61344)
* Admin: Remove navigation subheaders * Admin: Fix tests
This commit is contained in:
parent
8e4922f02f
commit
078f2d4481
@ -41,9 +41,6 @@ const (
|
||||
NavIDDashboardsBrowse = "dashboards/browse"
|
||||
NavIDCfg = "cfg" // NavIDCfg is the id for org configuration navigation node
|
||||
NavIDAdmin = "admin"
|
||||
NavIDAdminGeneral = "admin/general"
|
||||
NavIDAdminPlugins = "admin/plugins"
|
||||
NavIDAdminAccess = "admin/access"
|
||||
NavIDAlertsAndIncidents = "alerts-and-incidents"
|
||||
NavIDAlerting = "alerting"
|
||||
NavIDMonitoring = "monitoring"
|
||||
@ -180,73 +177,32 @@ func ApplyAdminIA(root *NavTreeRoot) {
|
||||
orgAdminNode.Url = "/admin"
|
||||
orgAdminNode.Text = "Administration"
|
||||
|
||||
generalNodeLinks := []*NavLink{}
|
||||
pluginsNodeLinks := []*NavLink{}
|
||||
accessNodeLinks := []*NavLink{}
|
||||
adminNodeLinks := []*NavLink{}
|
||||
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("upgrading"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("licensing"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("upgrading"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("licensing"))
|
||||
if orgSettings := root.FindById("org-settings"); orgSettings != nil {
|
||||
orgSettings.Text = "Default preferences"
|
||||
generalNodeLinks = append(generalNodeLinks, orgSettings)
|
||||
adminNodeLinks = append(adminNodeLinks, orgSettings)
|
||||
}
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("global-orgs"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("server-settings"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("global-orgs"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("server-settings"))
|
||||
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("plugins"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("datasources"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("correlations"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("plugin-page-grafana-cloud-link-app"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("recordedQueries")) // enterprise only
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("plugins"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("datasources"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("correlations"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("plugin-page-grafana-cloud-link-app"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("recordedQueries")) // enterprise only
|
||||
|
||||
if globalUsers := root.FindById("global-users"); globalUsers != nil {
|
||||
globalUsers.Text = "Users"
|
||||
accessNodeLinks = append(accessNodeLinks, globalUsers)
|
||||
adminNodeLinks = append(adminNodeLinks, globalUsers)
|
||||
}
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("teams"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("serviceaccounts"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("apikeys"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("ldap"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("standalone-plugin-page-/a/grafana-auth-app")) // Cloud Access Policies
|
||||
|
||||
generalNode := &NavLink{
|
||||
Text: "General",
|
||||
Id: NavIDAdminGeneral,
|
||||
Url: "/admin/general",
|
||||
Icon: "shield",
|
||||
Children: generalNodeLinks,
|
||||
}
|
||||
|
||||
pluginsNode := &NavLink{
|
||||
Text: "Plugins and data",
|
||||
Id: NavIDAdminPlugins,
|
||||
Url: "/admin/plugins",
|
||||
Icon: "shield",
|
||||
Children: pluginsNodeLinks,
|
||||
}
|
||||
|
||||
accessNode := &NavLink{
|
||||
Text: "Users and access",
|
||||
Id: NavIDAdminAccess,
|
||||
Url: "/admin/access",
|
||||
Icon: "shield",
|
||||
Children: accessNodeLinks,
|
||||
}
|
||||
|
||||
adminNodeLinks := []*NavLink{}
|
||||
|
||||
if len(generalNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, generalNode)
|
||||
}
|
||||
|
||||
if len(pluginsNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, pluginsNode)
|
||||
}
|
||||
|
||||
if len(accessNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, accessNode)
|
||||
}
|
||||
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("teams"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("serviceaccounts"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("apikeys"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("ldap"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("standalone-plugin-page-/a/grafana-auth-app")) // Cloud Access Policies
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("storage"))
|
||||
|
||||
if len(adminNodeLinks) > 0 {
|
||||
|
@ -44,9 +44,6 @@ func TestNavTreeRoot(t *testing.T) {
|
||||
treeRoot.RemoveEmptySectionsAndApplyNewInformationArchitecture(true)
|
||||
|
||||
require.Equal(t, "Administration", treeRoot.Children[0].Text)
|
||||
require.Equal(t, NavIDAdminGeneral, treeRoot.Children[0].Children[0].Id)
|
||||
require.Equal(t, NavIDAdminPlugins, treeRoot.Children[0].Children[1].Id)
|
||||
require.Equal(t, NavIDAdminAccess, treeRoot.Children[0].Children[2].Id)
|
||||
})
|
||||
|
||||
t.Run("Should move reports into Dashboards", func(t *testing.T) {
|
||||
|
@ -71,12 +71,6 @@ export function getNavTitle(navId: string | undefined) {
|
||||
return config.featureToggles.topnav
|
||||
? t('nav.config.title', 'Administration')
|
||||
: t('nav.config.titleBeforeTopnav', 'Configuration');
|
||||
case 'admin/general':
|
||||
return t('nav.admin-general.title', 'General');
|
||||
case 'admin/plugins':
|
||||
return t('nav.admin-plugins.title', 'Plugins and data');
|
||||
case 'admin/access':
|
||||
return t('nav.admin-access.title', 'Users and access');
|
||||
case 'datasources':
|
||||
return t('nav.datasources.title', 'Data sources');
|
||||
case 'correlations':
|
||||
|
@ -128,15 +128,6 @@
|
||||
"subtitle": "Serverweite Einstellungen und Zugriff auf Ressourcen wie Organisationen, Benutzer und Lizenzen verwalten",
|
||||
"title": "Server-Administrator"
|
||||
},
|
||||
"admin-access": {
|
||||
"title": "Benutzer und Zugriff"
|
||||
},
|
||||
"admin-general": {
|
||||
"title": "Allgemein"
|
||||
},
|
||||
"admin-plugins": {
|
||||
"title": "Plugins und Daten"
|
||||
},
|
||||
"alerting": {
|
||||
"subtitle": "Informiere dich über Probleme in deinen Systemen kurz nach deren Auftreten",
|
||||
"title": "Meldungen"
|
||||
|
@ -128,15 +128,6 @@
|
||||
"subtitle": "Manage server-wide settings and access to resources such as organizations, users, and licenses",
|
||||
"title": "Server admin"
|
||||
},
|
||||
"admin-access": {
|
||||
"title": "Users and access"
|
||||
},
|
||||
"admin-general": {
|
||||
"title": "General"
|
||||
},
|
||||
"admin-plugins": {
|
||||
"title": "Plugins and data"
|
||||
},
|
||||
"alerting": {
|
||||
"subtitle": "Learn about problems in your systems moments after they occur",
|
||||
"title": "Alerting"
|
||||
|
@ -128,15 +128,6 @@
|
||||
"subtitle": "Administrar la configuración de todo el servidor y el acceso a recursos como organizaciones, usuarios y licencias",
|
||||
"title": "Administrador del servidor"
|
||||
},
|
||||
"admin-access": {
|
||||
"title": "Usuarios y acceso"
|
||||
},
|
||||
"admin-general": {
|
||||
"title": "General"
|
||||
},
|
||||
"admin-plugins": {
|
||||
"title": "Complementos y datos"
|
||||
},
|
||||
"alerting": {
|
||||
"subtitle": "Conozca los problemas de sus sistemas justo después de que se produzcan",
|
||||
"title": "Alertas"
|
||||
|
@ -128,15 +128,6 @@
|
||||
"subtitle": "Gérer les paramètres à l'échelle du serveur et l'accès aux ressources telles que les organisations, les utilisateurs et les licences",
|
||||
"title": "Administrateur de serveur"
|
||||
},
|
||||
"admin-access": {
|
||||
"title": "Utilisateurs et droits d'accès"
|
||||
},
|
||||
"admin-general": {
|
||||
"title": "Général"
|
||||
},
|
||||
"admin-plugins": {
|
||||
"title": "Modules complémentaires et données"
|
||||
},
|
||||
"alerting": {
|
||||
"subtitle": "En savoir plus sur les problèmes dans vos systèmes quelques instants après qu'ils se produisent",
|
||||
"title": "Alertes"
|
||||
|
@ -128,15 +128,6 @@
|
||||
"subtitle": "Mäʼnäģę şęřvęř-ŵįđę şęŧŧįʼnģş äʼnđ äččęşş ŧő řęşőūřčęş şūčĥ äş őřģäʼnįžäŧįőʼnş, ūşęřş, äʼnđ ľįčęʼnşęş",
|
||||
"title": "Ŝęřvęř äđmįʼn"
|
||||
},
|
||||
"admin-access": {
|
||||
"title": "Ůşęřş äʼnđ äččęşş"
|
||||
},
|
||||
"admin-general": {
|
||||
"title": "Ğęʼnęřäľ"
|
||||
},
|
||||
"admin-plugins": {
|
||||
"title": "Pľūģįʼnş äʼnđ đäŧä"
|
||||
},
|
||||
"alerting": {
|
||||
"subtitle": "Ŀęäřʼn äþőūŧ přőþľęmş įʼn yőūř şyşŧęmş mőmęʼnŧş äƒŧęř ŧĥęy őččūř",
|
||||
"title": "Åľęřŧįʼnģ"
|
||||
|
@ -128,15 +128,6 @@
|
||||
"subtitle": "管理整个服务器范围的设置,以及对组织、用户和许可证等资源的访问权限",
|
||||
"title": "服务器管理员"
|
||||
},
|
||||
"admin-access": {
|
||||
"title": ""
|
||||
},
|
||||
"admin-general": {
|
||||
"title": ""
|
||||
},
|
||||
"admin-plugins": {
|
||||
"title": ""
|
||||
},
|
||||
"alerting": {
|
||||
"subtitle": "在系统发生问题后立即获悉",
|
||||
"title": "警报"
|
||||
|
Loading…
Reference in New Issue
Block a user