From 4d4ab87bb662ad0b0cb0cd5032baaf429b907869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 11 Jul 2022 14:35:30 +0200 Subject: [PATCH] Page: Update profile page components to use new navId (#51664) --- .betterer.results | 2 +- pkg/api/index.go | 6 +++--- .../NavBar/navBarItem-translations.ts | 4 ++-- .../core/components/PageNew/SectionNav.tsx | 6 +++++- .../notifications/NotificationsPage.tsx | 21 +++---------------- .../profile/ChangePasswordPage.test.tsx | 18 ---------------- .../features/profile/ChangePasswordPage.tsx | 11 +++------- .../profile/UserProfileEditPage.test.tsx | 18 ---------------- .../features/profile/UserProfileEditPage.tsx | 10 ++------- public/app/features/profile/routes.tsx | 6 ++++++ 10 files changed, 25 insertions(+), 77 deletions(-) diff --git a/.betterer.results b/.betterer.results index c93e559c2a7..a623348052f 100644 --- a/.betterer.results +++ b/.betterer.results @@ -10436,4 +10436,4 @@ exports[`no undocumented stories`] = { [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ] }` -}; +}; \ No newline at end of file diff --git a/pkg/api/index.go b/pkg/api/index.go index 9ab27c752c5..de644dabb94 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -36,17 +36,17 @@ func (hs *HTTPServer) getProfileNode(c *models.ReqContext) *dtos.NavLink { children := []*dtos.NavLink{ { - Text: "Preferences", Id: "profile-settings", Url: hs.Cfg.AppSubURL + "/profile", Icon: "sliders-v-alt", + Text: "Preferences", Id: "profile/settings", Url: hs.Cfg.AppSubURL + "/profile", Icon: "sliders-v-alt", }, } children = append(children, &dtos.NavLink{ - Text: "Notification history", Id: "notifications", Url: hs.Cfg.AppSubURL + "/notifications", Icon: "bell", + Text: "Notification history", Id: "profile/notifications", Url: hs.Cfg.AppSubURL + "profile/notifications", Icon: "bell", }) if setting.AddChangePasswordLink() { children = append(children, &dtos.NavLink{ - Text: "Change password", Id: "change-password", Url: hs.Cfg.AppSubURL + "/profile/password", + Text: "Change password", Id: "profile/password", Url: hs.Cfg.AppSubURL + "/profile/password", Icon: "lock", }) } diff --git a/public/app/core/components/NavBar/navBarItem-translations.ts b/public/app/core/components/NavBar/navBarItem-translations.ts index 3d3ab5f31e4..7f517bf3f47 100644 --- a/public/app/core/components/NavBar/navBarItem-translations.ts +++ b/public/app/core/components/NavBar/navBarItem-translations.ts @@ -54,8 +54,8 @@ const TRANSLATED_MENU_ITEMS: Record = { help: defineMessage({ id: 'nav.help', message: 'Help' }), - 'profile-settings': defineMessage({ id: 'nav.profile-settings', message: 'Preferences' }), - 'change-password': defineMessage({ id: 'nav.change-password', message: 'Change password' }), + 'profile-settings': defineMessage({ id: 'nav.profile/settings', message: 'Preferences' }), + 'change-password': defineMessage({ id: 'nav.profile/password', message: 'Change password' }), 'sign-out': defineMessage({ id: 'nav.sign-out', message: 'Sign out' }), }; diff --git a/public/app/core/components/PageNew/SectionNav.tsx b/public/app/core/components/PageNew/SectionNav.tsx index 3570de4294f..0172722562d 100644 --- a/public/app/core/components/PageNew/SectionNav.tsx +++ b/public/app/core/components/PageNew/SectionNav.tsx @@ -19,7 +19,7 @@ export function SectionNav(props: Props) {