Skip to content

Commit c07574a

Browse files
authored
Merge pull request #2655 from objectcomputing/bugfix-2652/menu-items
Add all menu items based on permissions.
2 parents 9c4a821 + ce26396 commit c07574a

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

web-ui/src/components/menu/Menu.jsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import {
1313
selectHasSkillsReportPermission,
1414
selectHasTeamSkillsReportPermission,
1515
selectHasViewPulseReportPermission,
16-
selectIsAdmin
16+
selectIsAdmin,
17+
selectHasEarnedCertificationsPermission,
18+
selectHasMeritReportPermission,
19+
selectHasVolunteeringEventsPermission,
20+
selectHasVolunteeringRelationshipsPermission,
1721
} from '../../context/selectors';
1822
import { UPDATE_TOAST } from '../../context/actions';
1923

@@ -136,7 +140,9 @@ function Menu({ children }) {
136140
links.push(['/birthday-reports', 'Birthdays']);
137141
}
138142

139-
links.push(['/certification-reports', 'Certifications']);
143+
if (selectHasEarnedCertificationsPermission(state)) {
144+
links.push(['/certification-reports', 'Certifications']);
145+
}
140146

141147
if (selectHasCheckinsReportPermission(state)) {
142148
links.push(['/checkins-reports', 'Check-ins']);
@@ -154,8 +160,14 @@ function Menu({ children }) {
154160
links.push(['/team-skills-reports', 'Team Skills']);
155161
}
156162

157-
links.push(['/merit-reports', 'Merit Report']);
158-
links.push(['/volunteer-reports', 'Volunteering']);
163+
if (selectHasMeritReportPermission(state)) {
164+
links.push(['/merit-reports', 'Merit Report']);
165+
}
166+
167+
if (selectHasVolunteeringEventsPermission(state) ||
168+
selectHasVolunteeringRelationshipsPermission(state)) {
169+
links.push(['/volunteer-reports', 'Volunteering']);
170+
}
159171

160172
return links;
161173
};

web-ui/src/components/volunteer/VolunteerTables.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Box, Tab, Tabs, Typography, Card, CardHeader, CardContent, Avatar } fro
44

55
import {
66
selectHasVolunteeringEventsPermission,
7-
selectHasVolunteeringOrganizationsPermission,
87
selectHasVolunteeringRelationshipsPermission,
98
noPermission,
109
} from '../../context/selectors';
@@ -58,7 +57,6 @@ const VolunteerReportPage = ({ onlyMe = false }) => {
5857
let tabContent = 0;
5958

6059
return (selectHasVolunteeringEventsPermission(state) ||
61-
selectHasVolunteeringOrganizationsPermission(state) ||
6260
selectHasVolunteeringRelationshipsPermission(state)) ? (
6361
<Card className="volunteer-activities-card">
6462
<CardContent className="volunteer-tables">

0 commit comments

Comments
 (0)