mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove navAdminSubsections
toggle (#78179)
* remove navAdminSubsections toggle * missed one!
This commit is contained in:
@@ -143,7 +143,6 @@ Experimental features might be changed or removed without prior notice.
|
||||
| `formatString` | Enable format string transformer |
|
||||
| `transformationsVariableSupport` | Allows using variables in transformations |
|
||||
| `kubernetesPlaylists` | Use the kubernetes API in the frontend for playlists, and route /api/playlist requests to k8s |
|
||||
| `navAdminSubsections` | Splits the administration section of the nav tree into subsections |
|
||||
| `recoveryThreshold` | Enables feature recovery threshold (aka hysteresis) for threshold server-side expression |
|
||||
| `lokiStructuredMetadata` | Enables the loki data source to request structured metadata from the Loki server |
|
||||
| `teamHttpHeaders` | Enables datasources to apply team headers to the client requests |
|
||||
|
@@ -136,7 +136,6 @@ export interface FeatureToggles {
|
||||
transformationsVariableSupport?: boolean;
|
||||
kubernetesPlaylists?: boolean;
|
||||
cloudWatchBatchQueries?: boolean;
|
||||
navAdminSubsections?: boolean;
|
||||
recoveryThreshold?: boolean;
|
||||
lokiStructuredMetadata?: boolean;
|
||||
teamHttpHeaders?: boolean;
|
||||
|
@@ -166,7 +166,7 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
|
||||
|
||||
hs.HooksService.RunIndexDataHooks(&data, c)
|
||||
|
||||
data.NavTree.ApplyAdminIA(hs.Features.IsEnabled(c.Req.Context(), featuremgmt.FlagNavAdminSubsections))
|
||||
data.NavTree.ApplyAdminIA()
|
||||
data.NavTree.Sort()
|
||||
|
||||
return &data, nil
|
||||
|
@@ -878,13 +878,6 @@ var (
|
||||
Stage: FeatureStagePublicPreview,
|
||||
Owner: awsDatasourcesSquad,
|
||||
},
|
||||
{
|
||||
Name: "navAdminSubsections",
|
||||
Description: "Splits the administration section of the nav tree into subsections",
|
||||
Stage: FeatureStageExperimental,
|
||||
FrontendOnly: false,
|
||||
Owner: grafanaFrontendPlatformSquad,
|
||||
},
|
||||
{
|
||||
Name: "recoveryThreshold",
|
||||
Description: "Enables feature recovery threshold (aka hysteresis) for threshold server-side expression",
|
||||
|
@@ -117,7 +117,6 @@ formatString,experimental,@grafana/grafana-bi-squad,false,false,false,true
|
||||
transformationsVariableSupport,experimental,@grafana/grafana-bi-squad,false,false,false,true
|
||||
kubernetesPlaylists,experimental,@grafana/grafana-app-platform-squad,false,false,true,false
|
||||
cloudWatchBatchQueries,preview,@grafana/aws-datasources,false,false,false,false
|
||||
navAdminSubsections,experimental,@grafana/grafana-frontend-platform,false,false,false,false
|
||||
recoveryThreshold,experimental,@grafana/alerting-squad,false,false,true,false
|
||||
lokiStructuredMetadata,experimental,@grafana/observability-logs,false,false,false,false
|
||||
teamHttpHeaders,experimental,@grafana/identity-access-team,false,false,false,false
|
||||
|
|
@@ -479,10 +479,6 @@ const (
|
||||
// Runs CloudWatch metrics queries as separate batches
|
||||
FlagCloudWatchBatchQueries = "cloudWatchBatchQueries"
|
||||
|
||||
// FlagNavAdminSubsections
|
||||
// Splits the administration section of the nav tree into subsections
|
||||
FlagNavAdminSubsections = "navAdminSubsections"
|
||||
|
||||
// FlagRecoveryThreshold
|
||||
// Enables feature recovery threshold (aka hysteresis) for threshold server-side expression
|
||||
FlagRecoveryThreshold = "recoveryThreshold"
|
||||
|
@@ -120,122 +120,98 @@ func Sort(nodes []*NavLink) {
|
||||
}
|
||||
}
|
||||
|
||||
func (root *NavTreeRoot) ApplyAdminIA(navAdminSubsectionsEnabled bool) {
|
||||
func (root *NavTreeRoot) ApplyAdminIA() {
|
||||
orgAdminNode := root.FindById(NavIDCfg)
|
||||
|
||||
if orgAdminNode != nil {
|
||||
adminNodeLinks := []*NavLink{}
|
||||
|
||||
if navAdminSubsectionsEnabled {
|
||||
generalNodeLinks := []*NavLink{}
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("upgrading")) // TODO does this even exist
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("licensing"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("org-settings"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("server-settings"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("global-orgs"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("feature-toggles"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("storage"))
|
||||
generalNodeLinks := []*NavLink{}
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("upgrading")) // TODO does this even exist
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("licensing"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("org-settings"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("server-settings"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("global-orgs"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("feature-toggles"))
|
||||
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("storage"))
|
||||
|
||||
generalNode := &NavLink{
|
||||
Text: "General",
|
||||
SubTitle: "Manage default preferences and settings across Grafana",
|
||||
Id: NavIDCfgGeneral,
|
||||
Url: "/admin/general",
|
||||
Icon: "shield",
|
||||
Children: generalNodeLinks,
|
||||
}
|
||||
generalNode := &NavLink{
|
||||
Text: "General",
|
||||
SubTitle: "Manage default preferences and settings across Grafana",
|
||||
Id: NavIDCfgGeneral,
|
||||
Url: "/admin/general",
|
||||
Icon: "shield",
|
||||
Children: generalNodeLinks,
|
||||
}
|
||||
|
||||
pluginsNodeLinks := []*NavLink{}
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("plugins"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("datasources"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("recordedQueries"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("correlations"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("plugin-page-grafana-cloud-link-app"))
|
||||
pluginsNodeLinks := []*NavLink{}
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("plugins"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("datasources"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("recordedQueries"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("correlations"))
|
||||
pluginsNodeLinks = AppendIfNotNil(pluginsNodeLinks, root.FindById("plugin-page-grafana-cloud-link-app"))
|
||||
|
||||
pluginsNode := &NavLink{
|
||||
Text: "Plugins and data",
|
||||
SubTitle: "Install plugins and define the relationships between data",
|
||||
Id: NavIDCfgPlugins,
|
||||
Url: "/admin/plugins",
|
||||
Icon: "shield",
|
||||
Children: pluginsNodeLinks,
|
||||
}
|
||||
pluginsNode := &NavLink{
|
||||
Text: "Plugins and data",
|
||||
SubTitle: "Install plugins and define the relationships between data",
|
||||
Id: NavIDCfgPlugins,
|
||||
Url: "/admin/plugins",
|
||||
Icon: "shield",
|
||||
Children: pluginsNodeLinks,
|
||||
}
|
||||
|
||||
accessNodeLinks := []*NavLink{}
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("global-users"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("teams"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("standalone-plugin-page-/a/grafana-auth-app"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("serviceaccounts"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("apikeys"))
|
||||
accessNodeLinks := []*NavLink{}
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("global-users"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("teams"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("standalone-plugin-page-/a/grafana-auth-app"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("serviceaccounts"))
|
||||
accessNodeLinks = AppendIfNotNil(accessNodeLinks, root.FindById("apikeys"))
|
||||
|
||||
usersNode := &NavLink{
|
||||
Text: "Users and access",
|
||||
SubTitle: "Configure access for individual users, teams, and service accounts",
|
||||
Id: NavIDCfgAccess,
|
||||
Url: "/admin/access",
|
||||
Icon: "shield",
|
||||
Children: accessNodeLinks,
|
||||
}
|
||||
usersNode := &NavLink{
|
||||
Text: "Users and access",
|
||||
SubTitle: "Configure access for individual users, teams, and service accounts",
|
||||
Id: NavIDCfgAccess,
|
||||
Url: "/admin/access",
|
||||
Icon: "shield",
|
||||
Children: accessNodeLinks,
|
||||
}
|
||||
|
||||
if len(generalNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, generalNode)
|
||||
}
|
||||
if len(generalNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, generalNode)
|
||||
}
|
||||
|
||||
if len(pluginsNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, pluginsNode)
|
||||
}
|
||||
if len(pluginsNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, pluginsNode)
|
||||
}
|
||||
|
||||
if len(usersNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, usersNode)
|
||||
}
|
||||
if len(usersNode.Children) > 0 {
|
||||
adminNodeLinks = append(adminNodeLinks, usersNode)
|
||||
}
|
||||
|
||||
authenticationNode := root.FindById("authentication")
|
||||
if authenticationNode != nil {
|
||||
authenticationNode.IsSection = true
|
||||
adminNodeLinks = append(adminNodeLinks, authenticationNode)
|
||||
}
|
||||
authenticationNode := root.FindById("authentication")
|
||||
if authenticationNode != nil {
|
||||
authenticationNode.IsSection = true
|
||||
adminNodeLinks = append(adminNodeLinks, authenticationNode)
|
||||
}
|
||||
|
||||
costManagementNode := root.FindById("plugin-page-grafana-costmanagementui-app")
|
||||
costManagementNode := root.FindById("plugin-page-grafana-costmanagementui-app")
|
||||
|
||||
if costManagementNode != nil {
|
||||
adminNodeLinks = append(adminNodeLinks, costManagementNode)
|
||||
}
|
||||
if costManagementNode != nil {
|
||||
adminNodeLinks = append(adminNodeLinks, costManagementNode)
|
||||
}
|
||||
|
||||
costManagementMetricsNode := root.FindByURL("/a/grafana-costmanagementui-app/metrics")
|
||||
adaptiveMetricsNode := root.FindById("plugin-page-grafana-adaptive-metrics-app")
|
||||
costManagementMetricsNode := root.FindByURL("/a/grafana-costmanagementui-app/metrics")
|
||||
adaptiveMetricsNode := root.FindById("plugin-page-grafana-adaptive-metrics-app")
|
||||
|
||||
if costManagementMetricsNode != nil && adaptiveMetricsNode != nil {
|
||||
costManagementMetricsNode.Children = append(costManagementMetricsNode.Children, adaptiveMetricsNode)
|
||||
}
|
||||
if costManagementMetricsNode != nil && adaptiveMetricsNode != nil {
|
||||
costManagementMetricsNode.Children = append(costManagementMetricsNode.Children, adaptiveMetricsNode)
|
||||
}
|
||||
|
||||
costManagementLogsNode := root.FindByURL("/a/grafana-costmanagementui-app/logs")
|
||||
logVolumeExplorerNode := root.FindById("plugin-page-grafana-logvolumeexplorer-app")
|
||||
costManagementLogsNode := root.FindByURL("/a/grafana-costmanagementui-app/logs")
|
||||
logVolumeExplorerNode := root.FindById("plugin-page-grafana-logvolumeexplorer-app")
|
||||
|
||||
if costManagementLogsNode != nil && logVolumeExplorerNode != nil {
|
||||
costManagementLogsNode.Children = append(costManagementLogsNode.Children, logVolumeExplorerNode)
|
||||
}
|
||||
} else {
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("datasources"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("plugins"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("global-users"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("teams"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("serviceaccounts"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("apikeys"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("org-settings"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("authentication"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("server-settings"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("global-orgs"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("feature-toggles"))
|
||||
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("upgrading"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("licensing"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("recordedQueries")) // enterprise only
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("correlations"))
|
||||
adminNodeLinks = AppendIfNotNil(adminNodeLinks, root.FindById("plugin-page-grafana-cloud-link-app"))
|
||||
|
||||
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 costManagementLogsNode != nil && logVolumeExplorerNode != nil {
|
||||
costManagementLogsNode.Children = append(costManagementLogsNode.Children, logVolumeExplorerNode)
|
||||
}
|
||||
|
||||
if len(adminNodeLinks) > 0 {
|
||||
|
@@ -267,7 +267,7 @@ func (s *ServiceImpl) readNavigationSettings() {
|
||||
"k6-app": {SectionID: navtree.NavIDRoot, SortWeight: navtree.WeightAlertsAndIncidents + 1, Text: "Performance testing", Icon: "k6"},
|
||||
}
|
||||
|
||||
if s.features.IsEnabledGlobally(featuremgmt.FlagNavAdminSubsections) && s.features.IsEnabledGlobally(featuremgmt.FlagCostManagementUi) {
|
||||
if s.features.IsEnabledGlobally(featuremgmt.FlagCostManagementUi) {
|
||||
// if cost management is enabled we want to nest adaptive metrics and log volume explorer under that plugin
|
||||
// in the admin section
|
||||
s.navigationAppConfig["grafana-adaptive-metrics-app"] = NavigationAppConfig{SectionID: navtree.NavIDCfg}
|
||||
|
Reference in New Issue
Block a user