Skip to content

Conversation

jkachel
Copy link
Contributor

@jkachel jkachel commented Sep 5, 2025

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/8312

Description (What does it do?)

The courses API in MITx Online is paginated. So, if a program is displayed on a learner's organization tab that happens to contain more than a single page of courses (so, 10), the learner will only see the first page of courses in the list.

This PR adds some code to switch over the loading to use an infinite query, which is aware of paginated result sets, and then to eagerly load the remaining pages of results for the program's courses if it happens to have more than 10 in it.

How can this be tested?

You will need Learn set up as well as MITx Online and ideally edX.

Set up a program that has more than 10 courses in it. (For testing, I set up a program with 14 courses to match the "all UAI courses" program in production.) Then, add the program to a contract, and add your test user to the contract.

Load the organization tab. You should see the program in it. You should see all of the courses within the program. (On the main branch, you should only see the first 10 courses.)

Additional Context

The component pulls a specific list of courses based on what's in the program. So, eager loading the courses shouldn't be a problem, but if we end up with a bunch of programs that have lots of courses in them, we may want to revisit how we display programs and courses in the org tab.

@jkachel jkachel force-pushed the jkachel/8312-load-all-pages-of-courses branch from 317cfa5 to 1877e1c Compare September 5, 2025 13:34
@jkachel jkachel force-pushed the jkachel/8312-load-all-pages-of-courses branch from 1877e1c to 54141f5 Compare September 5, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant