From ae716112dc996c91b9de42005f02997ea8a58986 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Fri, 21 Apr 2023 10:40:15 +0100 Subject: [PATCH] Navigation IA: Update `Monitoring` to `Observability` (#66963) (#67023) * update monitoring -> observability * update backend test (cherry picked from commit 1f193f1badcf098783541e1077867bd575f47910) --- pkg/services/navtree/navtreeimpl/applinks.go | 16 +++++++++++++--- .../navtree/navtreeimpl/applinks_test.go | 4 ++-- .../components/NavBar/navBarItem-translations.ts | 2 +- .../connections/__mocks__/store.navIndex.mock.ts | 2 +- public/locales/en-US/grafana.json | 2 +- public/locales/pseudo-LOCALE/grafana.json | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/pkg/services/navtree/navtreeimpl/applinks.go b/pkg/services/navtree/navtreeimpl/applinks.go index d147cf2ace9..43dca66846f 100644 --- a/pkg/services/navtree/navtreeimpl/applinks.go +++ b/pkg/services/navtree/navtreeimpl/applinks.go @@ -217,9 +217,9 @@ func (s *ServiceImpl) addPluginToSection(c *contextmodel.ReqContext, treeRoot *n }) case navtree.NavIDMonitoring: treeRoot.AddSection(&navtree.NavLink{ - Text: "Monitoring", + Text: "Observability", Id: navtree.NavIDMonitoring, - SubTitle: "Monitoring and infrastructure apps", + SubTitle: "Observability and infrastructure apps", Icon: "heart-rate", Section: navtree.NavSectionCore, SortWeight: navtree.WeightMonitoring, @@ -270,6 +270,7 @@ func (s *ServiceImpl) readNavigationSettings() { s.navigationAppConfig = map[string]NavigationAppConfig{ "grafana-k8s-app": {SectionID: navtree.NavIDMonitoring, SortWeight: 1, Text: "Kubernetes"}, "grafana-synthetic-monitoring-app": {SectionID: navtree.NavIDMonitoring, SortWeight: 2, Text: "Synthetics"}, + "grafana-kowalski-app": {SectionID: navtree.NavIDMonitoring, SortWeight: 3, Text: "Frontend"}, "grafana-oncall-app": {SectionID: navtree.NavIDAlertsAndIncidents, SortWeight: 1, Text: "OnCall"}, "grafana-incident-app": {SectionID: navtree.NavIDAlertsAndIncidents, SortWeight: 2, Text: "Incident"}, "grafana-ml-app": {SectionID: navtree.NavIDAlertsAndIncidents, SortWeight: 3, Text: "Machine Learning"}, @@ -297,7 +298,16 @@ func (s *ServiceImpl) readNavigationSettings() { } } - s.navigationAppConfig[pluginId] = *appCfg + // Only apply the new values, don't completely overwrite the entry if it exists + if entry, ok := s.navigationAppConfig[pluginId]; ok { + entry.SectionID = appCfg.SectionID + if appCfg.SortWeight != 0 { + entry.SortWeight = appCfg.SortWeight + } + s.navigationAppConfig[pluginId] = entry + } else { + s.navigationAppConfig[pluginId] = *appCfg + } } for _, key := range appStandalonePages.Keys() { diff --git a/pkg/services/navtree/navtreeimpl/applinks_test.go b/pkg/services/navtree/navtreeimpl/applinks_test.go index ac937d601e3..be719627412 100644 --- a/pkg/services/navtree/navtreeimpl/applinks_test.go +++ b/pkg/services/navtree/navtreeimpl/applinks_test.go @@ -206,7 +206,7 @@ func TestAddAppLinks(t *testing.T) { require.Equal(t, "plugin-page-test-app3", appsNode.Children[1].Id) }) - t.Run("Should only add a 'Monitoring' section if a plugin exists that wants to live there", func(t *testing.T) { + t.Run("Should only add an 'Observability' section if a plugin exists that wants to live there", func(t *testing.T) { service.features = featuremgmt.WithFeatures(featuremgmt.FlagTopnav) service.navigationAppConfig = map[string]NavigationAppConfig{} @@ -393,7 +393,7 @@ func TestReadingNavigationSettings(t *testing.T) { require.Equal(t, "dashboards", service.navigationAppConfig["grafana-k8s-app"].SectionID) require.Equal(t, "admin", service.navigationAppConfig["other-app"].SectionID) - require.Equal(t, int64(0), service.navigationAppConfig["grafana-k8s-app"].SortWeight) + require.Equal(t, int64(1), service.navigationAppConfig["grafana-k8s-app"].SortWeight) require.Equal(t, int64(12), service.navigationAppConfig["other-app"].SortWeight) require.Equal(t, "admin", service.navigationAppPathConfig["/a/grafana-k8s-app/foo"].SectionID) diff --git a/public/app/core/components/NavBar/navBarItem-translations.ts b/public/app/core/components/NavBar/navBarItem-translations.ts index fa61f68e466..e8779b2e96a 100644 --- a/public/app/core/components/NavBar/navBarItem-translations.ts +++ b/public/app/core/components/NavBar/navBarItem-translations.ts @@ -110,7 +110,7 @@ export function getNavTitle(navId: string | undefined) { case 'upgrading': return t('nav.upgrading.title', 'Stats and license'); case 'monitoring': - return t('nav.monitoring.title', 'Monitoring'); + return t('nav.monitoring.title', 'Observability'); case 'apps': return t('nav.apps.title', 'Apps'); case 'alerts-and-incidents': diff --git a/public/app/features/connections/__mocks__/store.navIndex.mock.ts b/public/app/features/connections/__mocks__/store.navIndex.mock.ts index 4ff680ab811..aba3149da06 100644 --- a/public/app/features/connections/__mocks__/store.navIndex.mock.ts +++ b/public/app/features/connections/__mocks__/store.navIndex.mock.ts @@ -540,7 +540,7 @@ export const navIndex: NavIndex = { }, monitoring: { id: 'monitoring', - text: 'Monitoring', + text: 'Observability', section: NavSection.Core, subTitle: 'Monitoring and infrastructure apps', icon: 'heart-rate', diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index a545f7f697a..5254a16696c 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -249,7 +249,7 @@ }, "monitoring": { "subtitle": "Monitoring and infrastructure apps", - "title": "Monitoring" + "title": "Observability" }, "new": { "title": "New" diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index 76e3fd328fd..9c6a98ab20e 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -249,7 +249,7 @@ }, "monitoring": { "subtitle": "Mőʼnįŧőřįʼnģ äʼnđ įʼnƒřäşŧřūčŧūřę äppş", - "title": "Mőʼnįŧőřįʼnģ" + "title": "Øþşęřväþįľįŧy" }, "new": { "title": "Ńęŵ"