Navigation: Update synthetics placement in IA (#79302)

* update synthetics placement in IA

* lowercase s in synthetics
This commit is contained in:
Ashley Harrison
2023-12-12 10:57:52 +00:00
committed by GitHub
parent 3647ba7360
commit 7c2b3ee1af
10 changed files with 90 additions and 20 deletions
+17 -15
View File
@@ -17,6 +17,7 @@ const (
WeightExplore
WeightAlerting
WeightAlertsAndIncidents
WeightTestingAndSynthetics
WeightMonitoring
WeightInfrastructure
WeightApplication
@@ -30,21 +31,22 @@ const (
)
const (
NavIDRoot = "root"
NavIDDashboards = "dashboards/browse"
NavIDExplore = "explore"
NavIDCfg = "cfg" // NavIDCfg is the id for org configuration navigation node
NavIDAlertsAndIncidents = "alerts-and-incidents"
NavIDAlerting = "alerting"
NavIDAlertingLegacy = "alerting-legacy"
NavIDMonitoring = "monitoring"
NavIDInfrastructure = "infrastructure"
NavIDFrontend = "frontend"
NavIDReporting = "reports"
NavIDApps = "apps"
NavIDCfgGeneral = "cfg/general"
NavIDCfgPlugins = "cfg/plugins"
NavIDCfgAccess = "cfg/access"
NavIDRoot = "root"
NavIDDashboards = "dashboards/browse"
NavIDExplore = "explore"
NavIDCfg = "cfg" // NavIDCfg is the id for org configuration navigation node
NavIDAlertsAndIncidents = "alerts-and-incidents"
NavIDTestingAndSynthetics = "testing-and-synthetics"
NavIDAlerting = "alerting"
NavIDAlertingLegacy = "alerting-legacy"
NavIDMonitoring = "monitoring"
NavIDInfrastructure = "infrastructure"
NavIDFrontend = "frontend"
NavIDReporting = "reports"
NavIDApps = "apps"
NavIDCfgGeneral = "cfg/general"
NavIDCfgPlugins = "cfg/plugins"
NavIDCfgAccess = "cfg/access"
)
type NavLink struct {
+19 -4
View File
@@ -249,6 +249,16 @@ func (s *ServiceImpl) addPluginToSection(c *contextmodel.ReqContext, treeRoot *n
Children: alertsAndIncidentsChildren,
Url: s.cfg.AppSubURL + "/alerts-and-incidents",
})
case navtree.NavIDTestingAndSynthetics:
treeRoot.AddSection(&navtree.NavLink{
Text: "Testing & synthetics",
Id: navtree.NavIDTestingAndSynthetics,
SubTitle: "Optimize performance with k6 and Synthetic Monitoring insights",
Icon: "k6",
SortWeight: navtree.WeightTestingAndSynthetics,
Children: []*navtree.NavLink{appLink},
Url: s.cfg.AppSubURL + "/testing-and-synthetics",
})
default:
s.log.Error("Plugin app nav id not found", "pluginId", plugin.ID, "navId", sectionID)
}
@@ -276,6 +286,7 @@ func (s *ServiceImpl) readNavigationSettings() {
appO11yCfg := NavigationAppConfig{SectionID: navtree.NavIDMonitoring, SortWeight: 2, Text: "Application"}
profilesCfg := NavigationAppConfig{SectionID: navtree.NavIDMonitoring, SortWeight: 3, Text: "Profiles"}
frontendCfg := NavigationAppConfig{SectionID: navtree.NavIDMonitoring, SortWeight: 4, Text: "Frontend"}
k6Cfg := NavigationAppConfig{SectionID: navtree.NavIDRoot, SortWeight: navtree.WeightAlertsAndIncidents + 1, Text: "Performance testing", Icon: "k6"}
syntheticsCfg := NavigationAppConfig{SectionID: navtree.NavIDMonitoring, SortWeight: 5, Text: "Synthetics"}
if s.features.IsEnabledGlobally(featuremgmt.FlagDockedMegaMenu) {
@@ -288,10 +299,14 @@ func (s *ServiceImpl) readNavigationSettings() {
profilesCfg.SectionID = navtree.NavIDExplore
profilesCfg.SortWeight = 1
frontendCfg.SectionID = navtree.NavIDFrontend
frontendCfg.SortWeight = 1
frontendCfg.SectionID = navtree.NavIDRoot
frontendCfg.SortWeight = navtree.WeightFrontend
syntheticsCfg.SectionID = navtree.NavIDFrontend
k6Cfg.SectionID = navtree.NavIDTestingAndSynthetics
k6Cfg.SortWeight = 1
k6Cfg.Text = "Performance"
syntheticsCfg.SectionID = navtree.NavIDTestingAndSynthetics
syntheticsCfg.SortWeight = 2
}
@@ -307,7 +322,7 @@ func (s *ServiceImpl) readNavigationSettings() {
"grafana-cloud-link-app": {SectionID: navtree.NavIDCfg},
"grafana-costmanagementui-app": {SectionID: navtree.NavIDCfg, Text: "Cost management"},
"grafana-easystart-app": {SectionID: navtree.NavIDRoot, SortWeight: navtree.WeightApps + 1, Text: "Connections", Icon: "adjust-circle"},
"k6-app": {SectionID: navtree.NavIDRoot, SortWeight: navtree.WeightAlertsAndIncidents + 1, Text: "Performance testing", Icon: "k6"},
"k6-app": k6Cfg,
}
if s.features.IsEnabledGlobally(featuremgmt.FlagCostManagementUi) {