PR-Grading-Screen Frontend#5414
Open
bfire9989 wants to merge 2 commits into
Open
Conversation
❌ Deploy Preview for highestgoodnetwork-dev failed.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Implements the
/pr-grading-screenroute as a fully functional admin-only weekly PR grading interface. The route previously did not exist — navigating to it returned a 404. This PR registers the route, wires it to live backend data, and implements the full grading workflow including team switching, week navigation, saving, reviewer management, and automatic reviewer syncing from live user data.Implements: PR Grading Screen feature
Related backend PR: #2286 (required — this frontend PR depends on the backend changes in #2286 to function)
Related PRs
This frontend PR is related to backend PR #2286.
To test this frontend PR you must first check out backend PR #2286.
Main Changes Explained
Create
src/components/PRGradingScreen/index.jsx— full container rewrite: role gate (Owner/Administrator only), sync → config → grading load sequence, week selector (PST timezone), team dropdown, save/delete handlers, bootstrap logic for fresh weeksUpdate
src/components/PRGradingScreen/PRGradingScreen.jsx— replaced non-functional Done button with Save button wired to the API, added week and team dropdowns, add/remove reviewer UI, remove PR button, editable prsNeeded field, confirmation dialogs for save and delete, save status banner with dark mode support, dark mode fix for PR number inputUpdate
src/components/PRGradingScreen/PRGradingScreen.module.css— added team selector, week selector, and save banner styles with full dark mode variantsUpdate
src/actions/prGradingActions.js— addedfetchWeeklyGrading(withweekStartparam),saveWeeklyGrading,fetchPRGradingConfig,deleteWeeklyGradingReviewer,syncPRGradingReviewersUpdate
src/utils/URL.js— addedPR_GRADING_SYNC_REVIEWERSandWEEKLY_GRADING_DELETE_REVIEWERendpoint constantsUpdate
src/routes.jsx— registered/pr-grading-screenas aProtectedRoutepointing toPRGradingScreenContainerUpdate
src/components/PRGradingDashboard/PRGradingDashboard.jsx— removed hardcodedTEAM_CODE = 'TeamA', wired to config API for dynamic team selection, save payload now usesteamNameinstead ofteamCodeUpdate
src/components/PRGradingScreen/mockData.js— added comment marking file as dev/testing only, not for production useCreate
src/actions/__tests__/prGradingActions.test.js— 25 tests covering all five actionsCreate
src/components/PRGradingScreen/__tests__/PRGradingScreenContainer.test.jsx— container tests covering rendering paths, role gate, team switching, empty and error statesCreate
docs/pr-grading-screen.md— developer handoff documentation covering all changes, API reference, and outstanding itemsHow to Test
Check out this branch and check out backend PR #2286 in the backend repo
Install dependencies and start both servers:
Clear site data and cache in your browser (DevTools → Application → Clear Site Data)
Log in as a user with Owner or Administrator role
Navigate to
/pr-grading-screenVerify the page loads without errors and shows:
GET /api/pr-grading-configGET /api/weekly-grading(if data exists for this week) or bootstrapped fromreviewerNamesin the config (fresh week)Verify team switching: select a different team from the dropdown and confirm the reviewer rows update
Verify week switching: select a prior week and confirm the data changes (or shows "No grading data for this team yet." if no records exist for that week)
Verify Save:
Verify Remove reviewer:
Verify Add reviewer:
Verify role gate: log in as a non-admin user (Volunteer or Manager) and navigate to
/pr-grading-screen— confirm you see "You do not have permission to access this page." and the table is not shownVerify dark mode: toggle dark mode and check:
Verify error state: disconnect your backend and navigate to the page — confirm the error message "Failed to load grading data. Please try again." is shown, not a blank screen or mock data
Screenshots or Videos of Changes
Note