Skip to content

refactor: read group configurations from authoring v2 (FC-0118) - #3371

Draft
taimoor-ahmed-1 wants to merge 2 commits into
openedx:masterfrom
taimoor-ahmed-1:taimoor-ahmed/fc0118-group-configurations
Draft

taimoor-ahmed-1 wants to merge 2 commits into
openedx:masterfrom
taimoor-ahmed-1:taimoor-ahmed/fc0118-group-configurations

Conversation

@taimoor-ahmed-1

Copy link
Copy Markdown
Contributor

Stacked on #3362 (textbooks), which adds getAllPages for paginated lists. Until #3362 merges, this PR also shows its commit; only the last commit belongs here.

Description

Part of #3361 (FC-0118 Phase 3, parent openedx/openedx-platform#39349).

Draft until openedx/openedx-platform#39308 and openedx/openedx-platform#39307 merges: it adds the endpoint this PR calls. The old address stays live until it is removed through the DEPR process (openedx/openedx-platform#39128).

GET /api/contentstore/v1/group_configurations/{course_id} → two requests, sent in parallel:

  • GET /api/authoring/v2/courses/{course_key}/group_configurations/?view=full, every page via getAllPages. view=full is needed because the cards and their badges show usage.
  • GET /api/authoring/v2/courses/{course_key}/settings/ (#39307), for the two fields that moved there.

The response is rebuilt into the same GroupConfigurationResponse:

Field Built from
experimentGroupConfigurations list items with scheme === 'random' (the legacy view built this list from exactly those)
allGroupConfigurations the other items
shouldShowEnrollmentTrack whether an enrollment_track item is listed
shouldShowExperimentGroups settings content_experiments_enabled
mfeProctoredExamSettingsUrl settings mfe_proctored_exam_settings_url

Each item's new can_manage is dropped; the page gets permissions from useCourseUserPermissions. Writes stay on the Studio /group_configurations/… routes.

User roles impacted: Course Author (Settings → Group Configurations). No visible change expected.

Supporting information

Testing instructions

  1. Studio → Settings → Group Configurations on a course with content groups, an enrollment-track group and experiment groups: all three sections render, with usage.
  2. On a course with experiments turned off, the experiment section is hidden.
  3. npm test -- src/group-configurations

Other information

  • Needs both #39308 and #39307 on the server.
  • When experiments are off, experimentGroupConfigurations is [] instead of null; nothing renders it in that case.
  • getContentStoreApiUrl is replaced by getGroupConfigurationsApiUrl and a local getCourseSettingsApiUrl. Once the course settings PR lands, the latter can use src/data/api.ts's helper.
  • Tested against mocks shaped from the platform PR's serializers; the platform PR is not merged yet.
  • No migrations, no accessibility impact.

Best Practices Checklist

  • 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. (None added.)
  • Avoid using ../ in import paths. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

Taimoor Ahmed added 2 commits November 16, 2026 18:56
The textbooks page read GET /api/contentstore/v1/textbooks/{course_id},
which openedx-platform#39157 superseded with the paginated
GET /api/authoring/v2/courses/{course_key}/textbooks/.

getTextbooks now reads every page of the v2 list and returns the same
{ textbooks } shape as before, so the page and hooks are unchanged.
Creating, editing and deleting a textbook stay on the Studio route.

Adds getAllPages, which requests the largest page size and then any
remaining pages by number, for the other Studio lists that are moving
to paginated endpoints.
The group configurations page read
GET /api/contentstore/v1/group_configurations/{course_id}, which
openedx-platform#39308 superseded with the paginated
GET /api/authoring/v2/courses/{course_key}/group_configurations/.
That list no longer carries the course-level flags; the experiments flag
(content_experiments_enabled) and mfe_proctored_exam_settings_url are
served by GET /api/authoring/v2/courses/{course_key}/settings/, which
openedx-platform#39307 adds. This change needs both PRs.

getGroupConfigurations now reads every page of the list with view=full,
because the page shows where each configuration and group is used, and
the course settings alongside it. It returns the same
GroupConfigurationResponse as before: experiment configurations are the
items with the 'random' scheme, the rest are allGroupConfigurations, in
the server's order; shouldShowEnrollmentTrack is whether an
enrollment_track item is listed. The per-item can_manage is dropped, as
the page already asks the permissions API. When content experiments are
off, experimentGroupConfigurations is now an empty list rather than null.

getContentStoreApiUrl is replaced by getGroupConfigurationsApiUrl and
getCourseSettingsApiUrl; only this area's tests imported it. Creating,
editing and deleting configurations stay on the Studio routes.
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @taimoor-ahmed-1!

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.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


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

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.39%. Comparing base (f2dab4e) to head (bcc0012).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3371      +/-   ##
==========================================
+ Coverage   96.36%   96.39%   +0.02%     
==========================================
  Files        1467     1473       +6     
  Lines       36182    36494     +312     
  Branches     8692     8818     +126     
==========================================
+ Hits        34867    35177     +310     
+ Misses       1272     1261      -11     
- Partials       43       56      +13     

☔ View full report in Codecov by Harness.
📢 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.

@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Nov 24, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

3 participants