Navigation: Allow apps to show IsNew badge in the navigation menu (#103608)

This commit is contained in:
Andres Martinez Gotor
2025-04-09 15:32:34 +02:00
committed by GitHub
parent a7197d02ad
commit 890484ff6a
2 changed files with 5 additions and 0 deletions
@@ -188,6 +188,9 @@ func (s *ServiceImpl) addPluginToSection(c *contextmodel.ReqContext, treeRoot *n
if len(navConfig.SubTitle) > 0 {
appLink.SubTitle = navConfig.SubTitle
}
if navConfig.IsNew {
appLink.IsNew = true
}
}
if sectionID == navtree.NavIDRoot {
@@ -323,6 +326,7 @@ func (s *ServiceImpl) readNavigationSettings() {
SectionID: navtree.NavIDCfg,
Text: "Advisor",
SubTitle: "Keep Grafana running smoothly and securely",
IsNew: true,
}
}
@@ -55,6 +55,7 @@ type NavigationAppConfig struct {
Text string
Icon string
SubTitle string
IsNew bool
}
func ProvideService(cfg *setting.Cfg, accessControl ac.AccessControl, pluginStore pluginstore.Store, pluginSettings pluginsettings.Service, starService star.Service,