Skip to content
Merged

Beta #449

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/sections/Profile/Admin/View/ViewMember/ViewMember.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,16 @@ function ViewMember() {
.replace(/_/g, " ") // Replace all underscores with spaces
.toLowerCase();

// Compare with memberActivePage in lowercase
return accessCategory === memberActivePage.toLowerCase();
// Convert department name to match format (e.g., "operations" -> "operations")
const activeDepartment = memberActivePage.toLowerCase();

// Check for exact match (e.g., "operations" === "operations")
// OR match senior executive (e.g., "senior executive operations" ends with "operations")
const seniorExecutivePrefix = "senior executive ";
const isSeniorExecutive = accessCategory.startsWith(seniorExecutivePrefix) &&
accessCategory.substring(seniorExecutivePrefix.length) === activeDepartment;

return accessCategory === activeDepartment || isSeniorExecutive;
});
}

Expand Down