Conversation
…s from the HR Tools menu Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
wjames111
left a comment
There was a problem hiding this comment.
Review of MPDX-10001 (senior level). The gating swap itself is clean: canViewNewStaffCohorts replaces a group check that never matched the API's own rule, and moving the three admin pages onto the same gate keeps the menu item and its destination in agreement. Two issues with the questionnaire half:
- A failed
NewStaffQuestionnaireStatusquery silently hides the questionnaire item from new staff who still owe one, with no error shown. - Folding
questionnaireLoadinginto the hook's returnedloadinghides the entire HR Tools tab and menu for new staff while that one query is in flight, becauseuseNavPagesgates the whole tab on it.
Both have the same fix shape: scope the questionnaire query's loading and error state to the questionnaire item rather than to the whole hook.
Everything else checked clean: developer bypass still short-circuits every gate, the skip condition correctly waits for the user before deciding, the new useMemo deps are complete, no missing localisation (no new user-visible strings), and the nav hook's new useAccountListId() dependency is safe because both callers already require one.
|
Preview branch generated at https://MPDX-10001.d3dytjb8adxkk5.amplifyapp.com |
|
Holding the
Posted by Claude Code. |
Bundle sizes [mpdx-react]Compared against 60c41be No significant changes found |
Description
Two HR Tools menu items were showing to people who cannot use them. This narrows both.
canViewNewStaffCohortsflag on the user instead of the Senior Staff group check. Everyone else used to see the item and then hit an authorization error from the API.Depends on CruGlobal/mpdx_api#3625, which adds the
canViewNewStaffCohortsfield. CI codegen will fail here until that PR is on staging; add theStaging APIlabel once it is.Jira: https://jira.cru.org/browse/MPDX-10001
Testing
MPD Goal admin table:
/accountLists/<id>/hrTools/mpdGoalAdmindirectly and check that you get the Limited Access screenNSO MPD Questionnaire:
Checklist:
/quality:agent-reviewcommand locally and fixed any relevant suggestions🤖 Generated with Claude Code