[v9.4.x] Navigation: Correctly create Alerts and incidents section when using legacy alerting (#64926)

Navigation: Correctly create `Alerts and incidents` section when using legacy alerting (#64924)

check for legacy alerting node as well

(cherry picked from commit 54dd8943ca)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2023-03-16 20:17:48 +02:00
committed by GitHub
co-authored by Ashley Harrison
parent 46030b3b69
commit b5c092f03e
3 changed files with 6 additions and 1 deletions
+1
View File
@@ -43,6 +43,7 @@ const (
NavIDAdmin = "admin"
NavIDAlertsAndIncidents = "alerts-and-incidents"
NavIDAlerting = "alerting"
NavIDAlertingLegacy = "alerting-legacy"
NavIDMonitoring = "monitoring"
NavIDReporting = "reports"
NavIDApps = "apps"
@@ -179,6 +179,10 @@ func (s *ServiceImpl) processAppPlugin(plugin plugins.PluginDTO, c *contextmodel
func (s *ServiceImpl) addPluginToSection(c *contextmodel.ReqContext, treeRoot *navtree.NavTreeRoot, plugin plugins.PluginDTO, appLink *navtree.NavLink) {
// Handle moving apps into specific navtree sections
alertingNode := treeRoot.FindById(navtree.NavIDAlerting)
if alertingNode == nil {
// Search for legacy alerting node just in case
alertingNode = treeRoot.FindById(navtree.NavIDAlertingLegacy)
}
sectionID := navtree.NavIDApps
if navConfig, hasOverride := s.navigationAppConfig[plugin.ID]; hasOverride {
+1 -1
View File
@@ -18,7 +18,7 @@ const legacyRoutes: RouteDescriptor[] = [
{
path: '/alerting',
component: () =>
config.featureToggles.topnav ? <NavLandingPage navId="alerting" /> : <Redirect to="/alerting/list" />,
config.featureToggles.topnav ? <NavLandingPage navId="alerting-legacy" /> : <Redirect to="/alerting/list" />,
},
{
path: '/alerting/list',