Skip to content

Conversation

@jacobo-dominguez-wgu
Copy link

@jacobo-dominguez-wgu jacobo-dominguez-wgu commented Jan 30, 2026

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).

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Jan 30, 2026
@openedx-webhooks
Copy link

openedx-webhooks commented Jan 30, 2026

Thanks for the pull request, @jacobo-dominguez-wgu!

This repository is currently maintained by @2U-aperture.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 97.94872% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.23%. Comparing base (cfc8297) to head (8c9b3a3).

Files with missing lines Patch % Lines
...components/CourseCardBanners/CertificateBanner.jsx 81.25% 3 Missing ⚠️
...Card/components/CourseCardBanners/CourseBanner.jsx 71.42% 2 Missing ⚠️
...ents/CourseCardBanners/CreditBanner/views/hooks.js 75.00% 2 Missing ⚠️
...components/CourseCardBanners/CreditBanner/hooks.js 90.00% 1 Missing ⚠️
...s/CourseCard/components/CourseCardDetails/hooks.js 88.88% 1 Missing ⚠️
...ners/CourseCard/components/CourseCardMenu/hooks.js 94.11% 1 Missing ⚠️
src/data/react-query/apiHooks.ts 98.70% 1 Missing ⚠️
src/data/react-query/queryKeys.ts 90.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jacobo-dominguez-wgu jacobo-dominguez-wgu marked this pull request as ready for review January 30, 2026 22:51
@jacobo-dominguez-wgu jacobo-dominguez-wgu marked this pull request as draft January 30, 2026 22:53
@jacobo-dominguez-wgu jacobo-dominguez-wgu force-pushed the react-query-migration branch 2 times, most recently from 25d3bf6 to 983f04e Compare February 3, 2026 23:37
@jacobo-dominguez-wgu jacobo-dominguez-wgu marked this pull request as ready for review February 3, 2026 23:40
@jacobo-dominguez-wgu jacobo-dominguez-wgu moved this from Needs Triage to Ready for Review in Contributions Feb 3, 2026
@jacobo-dominguez-wgu jacobo-dominguez-wgu added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Feb 3, 2026
@jacobo-dominguez-wgu jacobo-dominguez-wgu moved this to In Review in frontend-base Feb 3, 2026
@itsjeyd itsjeyd added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U waiting for eng review PR is ready for review. Review and merge it, or suggest changes.

Projects

Status: No status
Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

[react-query, learner-dashboard] Phase2: Redux → React Query

3 participants