-
Notifications
You must be signed in to change notification settings - Fork 188
React query and react context conversion #786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
React query and react context conversion #786
Conversation
|
Thanks for the pull request, @jacobo-dominguez-wgu! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #786 +/- ##
==========================================
+ Coverage 97.54% 98.23% +0.69%
==========================================
Files 148 147 -1
Lines 1302 1474 +172
Branches 225 303 +78
==========================================
+ Hits 1270 1448 +178
+ Misses 31 26 -5
+ Partials 1 0 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
25d3bf6 to
983f04e
Compare
983f04e to
edac99f
Compare
Description
This PR implements a migration from Redux to React Query and React Context.
This modernizes state management while maintaining all existing functionality.
It closes #769
Part of react query migration initiative: #768
What Changed
Replaced Redux with React Query for server state management (API calls, caching)
Added React Context for client-side state (Pagination, filters, masquerading, course list back up)
Maintained backward compatibility with existing component interfaces
Created new apiHooks.ts with React Query hooks for all data operations
New Context Providers
FiltersProvider: Course filtering and pagination state
MasqueradeProvider: Admin masquerade functionality
SelectSessionProvider: Entitlement session selection
BackedDataProvider: Backup data for masquerade error handling
Component Updates
Updated all components, containers and hooks to use React Query hooks instead of Redux selectors
All tests were updated to work with the new state management system
Migration Strategy
Phase 1: Update Dependencies (does not apply)Phase 2 (This PR): Add React Query + Context alongside Redux
Phase 3 (#792): Remove all Redux related code and tests and refactor data folder structure
How to test it
Make sure all existing features work as before:
Dashboard Loading: Verify courses load correctly on initial page load and the fallback screen when there are no courses.
Course Filtering: Test search, status filters, and sorting functionality.
Course Card and Actions: Test unenroll, social sharing, email settings, entitlement, banners shows correctly.
Masquerade Feature: Test admin masquerade functionality with valid/invalid users.
Select session modal: I could not test it using the UI, but unit test passes (Manual testing required here).