openedx / openedx/frontend-app-authoring

Use React Query for editor data loading

Open
#2,542 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code health help wanted
Dominant language
TypeScript
Stars
17
Forks
218
Avg merge
9d 20h
Merged PRs (30d)
20

Description

Anytime the editors in src/editors need to load data, or interact with a REST API in any way, they should do so using React Query.

Move the various GET/POST requests out of the Redux state and into React Query apiHooks.ts files, following the same patterns used elsewhere in the Authoring MFE codebase.

A list of all the loaders/mutations is here:

  • fetchUnit
  • fetchBlock
  • fetchStudioView
  • createBlock
  • saveBlock
  • uploadAsset
  • allowThumbnailUpload
  • uploadThumbnail
  • uploadTranscript
  • deleteTranscript
  • fetchCourseDetails
  • fetchImages
  • fetchVideos
  • uploadVideo
  • checkTranscriptsForImport
  • importTranscript
  • fetchVideoFeatures
  • fetchAdvancedSettings

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/editors/data/redux/requests/reducer.js and review the listed loaders and mutations. Compare the existing apiHooks.ts patterns elsewhere in the Authoring MFE before tracing each editor request. Done means all listed REST interactions use React Query instead of Redux state.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
api, frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.