Skip to content

Refactor: Move courseTeam from redux store to react query#2888

Merged
ChrisChV merged 6 commits intoopenedx:masterfrom
open-craft:chris/redux-migration/course-team
Feb 24, 2026
Merged

Refactor: Move courseTeam from redux store to react query#2888
ChrisChV merged 6 commits intoopenedx:masterfrom
open-craft:chris/redux-migration/course-team

Conversation

@ChrisChV
Copy link
Copy Markdown
Contributor

Description

  • Move courseTeam from the redux store to React Query.
  • Which user roles will this change impact? "Course Author",
    "Developer".

Supporting information

Testing instructions

  • Go to a course outline
  • In the header, go to Settings > Course Team.
  • Add a new user in the team.
  • Add admin access to the new user.
  • Delete the new user from the team.

Other information

N/A

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Avoid propTypes and defaultProps in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Avoid using ../ in import paths. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 18, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @bradenmacdonald.

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.

@ChrisChV ChrisChV force-pushed the chris/redux-migration/course-team branch from 1569649 to 2aebc9c Compare February 18, 2026 19:09
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 98.14815% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.37%. Comparing base (c39923f) to head (5054492).
⚠️ Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
src/course-team/hooks.tsx 96.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2888      +/-   ##
==========================================
+ Coverage   95.22%   95.37%   +0.14%     
==========================================
  Files        1332     1332              
  Lines       30551    30594      +43     
  Branches     6678     6919     +241     
==========================================
+ Hits        29093    29178      +85     
+ Misses       1401     1347      -54     
- Partials       57       69      +12     

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

Copy link
Copy Markdown
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisChV Mostly looks good, but the error messages from the API aren't showing properly:

Before:
Image

After:

Image

@ChrisChV
Copy link
Copy Markdown
Contributor Author

@bradenmacdonald Thanks! I fixed that in 51a07ef

Copy link
Copy Markdown
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! One last request:

Comment thread src/course-team/hooks.tsx Outdated
const getErrorMessage = () => {
const errorObject = addUserMutation.error ?? editUserRoleMutation.error ?? deleteUserMutation.error;
// @ts-ignore
return errorObject?.response?.data?.error;
Copy link
Copy Markdown
Contributor

@bradenmacdonald bradenmacdonald Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have a default error message. Especially since other parts of the code have isFailed={errorMessage !== undefined}. So if the API returns an error in a different way than you're expecting, we need to still display a generic error instead of undefined.

Suggested change
return errorObject?.response?.data?.error;
return errorObject?.response?.data?.error ?? intl.formatMessage(messages.unknownError);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated: 5054492

@ChrisChV ChrisChV merged commit 5672644 into openedx:master Feb 24, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Feb 24, 2026
@ChrisChV ChrisChV deleted the chris/redux-migration/course-team branch February 24, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants