PHEE-400: add token refresh, G2P mock, dual dev modes and extensibility docs - #13
Merged
DavidH-1 merged 2 commits intoAug 13, 2026
Merged
Conversation
…ity and maintainability docs
There was a problem hiding this comment.
Pull request overview
This PR adds cross-cutting session/UX infrastructure (token-expiry handling + app-wide toasts), introduces an MSW-backed G2P Config mock mode (including a dedicated G2P API client), and documents the project’s extensibility/maintainability conventions and dev-mode workflows.
Changes:
- Added JWT expiry polling + warning toast + 401 interceptor redirect, and centralized toast notifications via a shared
ToastProvider. - Added MSW worker + handlers and new Vite modes/scripts to support a dedicated G2P mock development workflow.
- Wired G2P Config UI to fetch dropdown/table data from the G2P service client (with mock fallback in the table) and added documentation/README updates.
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/rbac/UserManagementTab.tsx | Migrates RBAC UI to shared toast context instead of local toast stack. |
| src/modules/g2p-config/types.ts | Extends G2P types with IDs and lookup entity types used by API-driven dropdowns. |
| src/modules/g2p-config/G2PPaymentTab.tsx | Fetches configs via React Query with skeleton loading and error→mock fallback. |
| src/modules/g2p-config/CreateG2PTab.tsx | Replaces hardcoded dropdown options with API-driven lists via React Query. |
| src/mocks/handlers/g2p.handlers.ts | Adds MSW handlers for G2P Config endpoints. |
| src/mocks/browser.ts | Registers the MSW worker with G2P handlers. |
| src/main.tsx | Adds dev-only MSW bootstrapping and wraps the app in ToastProvider. |
| src/lib/keycloak/KeycloakProvider.tsx | Adds token-expiry polling + warning toast and auto-redirect behavior. |
| src/lib/api/g2pConfig.ts | Introduces a dedicated Axios client for the G2P service + fetch helpers. |
| src/lib/api/client.ts | Adds a 401 response interceptor that clears auth and redirects to /login. |
| src/components/shared/ToastProvider.tsx | Introduces a shared toast context + UI renderer. |
| README.md | Documents dual dev modes, env file usage, and G2P/MSW configuration. |
| public/mockServiceWorker.js | Adds the MSW service worker asset under public/. |
| package.json | Adds msw, plus dev:g2p/build:g2p scripts and MSW config. |
| package-lock.json | Locks new MSW-related dependencies. |
| docs/MAINTAINABILITY.md | Adds maintainability guide (conventions, process, testing realities). |
| docs/EXTENSIBILITY.md | Adds extensibility guide and established API integration patterns. |
| .gitignore | Ignores .env.development and .env.g2p. |
| .env.example | Updates env template with G2P/MSW variables and defaults for local dev. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… toast a11y, form validation
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.
Related
Epic: PHEE-363
Closes: PHEE-400
Summary
Adds token refresh handling, G2P Config MSW mock with dual dev
modes, and extensibility/maintainability documentation.
Changes
Token Refresh & Session Management
KeycloakProvider.tsx/loginon token expiry/loginToastProvidercontext for app-wide notificationsG2P Config Mock (MSW)
/g2pPaymentConfig,/governmentEntity,/program,/dfspendpointshttp://localhost:8084viadedicated Axios client
Dual Development Modes
npm run dev→ real Gazelle APIs (VITE_ENABLE_MSW=false)npm run dev:g2p→ G2P mock testing (VITE_ENABLE_MSW=true).env.developmentand.env.g2pseparate env files.gitignoreDocumentation
docs/EXTENSIBILITY.md— step-by-step guide for adding new modulesdocs/MAINTAINABILITY.md— code conventions, PR process,testing approach, API integration checklist
Filter Chips Fix
uppercase status strings (COMPLETED, IN_PROGRESS, FAILED)