Skip to content

Commit a2168c1

Browse files
committed
BSR
1 parent 698cf66 commit a2168c1

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

client/src/locale/en.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ const en = {
113113
joins: "Join Requests",
114114
invitations: "Invitations",
115115
home: "Home",
116-
feedback: "Feedback"
116+
feedback: "Feedback",
117+
profile: "Profile"
117118
},
118119
welcome: {
119120
greeting: "Welcome {{name}}",

client/src/pages/Profile.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Profile = ({setIsAuthenticated}) => {
2424
useAppStore.setState({
2525
breadcrumbPaths: [
2626
{path: "/home", value: I18n.t("profile.title"), menuItemName: mainMenuItems.home},
27-
{value: I18n.t("breadCrumb.applications")}
27+
{value: I18n.t("breadCrumb.profile")}
2828
]
2929
});
3030
}, []);

client/src/utils/MenuItems.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,13 @@ export const allMenuGroups = [
116116
]
117117

118118
export const activeMenuItem = currentLocation => {
119-
let path = currentLocation.pathname;
120-
if (path === "/") {
121-
path = "/home"
122-
} else if (path.startsWith("/users/")) {
123-
path = path.substring(0, 7)
124-
} else if (path.startsWith("/organization/")) {
125-
path = path.substring(0, 13)
126-
} else if (path.startsWith("/idp/")) {
127-
path = path.substring(0, 5)
128-
}
119+
const path = currentLocation.pathname;
120+
const secondSlash = path.indexOf('/', 1);
121+
const strippedPath = secondSlash === -1 ? path : path.substring(0, secondSlash);
129122
const activeItem = allMenuGroups
130123
.map(group => group.items)
131124
.flat()
132-
.find(item => item.path.startsWith(path));
125+
.find(item => item.path.startsWith(strippedPath));
133126
return activeItem?.name || mainMenuItems.home;
134127
}
135128

0 commit comments

Comments
 (0)