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