Skip to content

Commit 3c61123

Browse files
committed
Add all menu items based on permissions.
1 parent 4f35e49 commit 3c61123

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

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

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

@@ -136,7 +141,9 @@ function Menu({ children }) {
136141
links.push(['/birthday-reports', 'Birthdays']);
137142
}
138143

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

141148
if (selectHasCheckinsReportPermission(state)) {
142149
links.push(['/checkins-reports', 'Check-ins']);
@@ -154,8 +161,14 @@ function Menu({ children }) {
154161
links.push(['/team-skills-reports', 'Team Skills']);
155162
}
156163

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

160173
return links;
161174
};

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)