Skip to content

display "module" on b2b cards and module rows#3578

Open
gumaerc wants to merge 1 commit into
mainfrom
cg/restore-module-label
Open

display "module" on b2b cards and module rows#3578
gumaerc wants to merge 1 commit into
mainfrom
cg/restore-module-label

Conversation

@gumaerc

@gumaerc gumaerc commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

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

Description (What does it do?)

This PR restores language surrounding "Modules" that are actually either a Course or a Program behind the scenes, but need to be displayed differently depending on the context. This includes any course card displayed on a B2B contract and any module row card in a "program as course" aka a Program with display_mode set to "course." This is accomplished by passing an isModule flag through the cards into the card type indicator.

Screenshots (if appropriate):

image image

How can this be tested?

  • Make sure you have an instance of MITx Online started and connected to Learn as described in the readme
  • Your test user should have at least one B2B contract assigned to them as well as a B2C enrollment that contains a "program as course"
  • View the B2B contract in the dashboard, and the "program as course" in the My Learning section of the dashboard home page
  • Ensure that "Module" is displayed in the upper left where applicable

Copilot AI review requested due to automatic review settings July 6, 2026 22:21

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, push a new commit or reopen this pull request to trigger a review.

@gumaerc gumaerc added the Needs Review An open Pull Request that is ready for review label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates dashboard course card rendering to show “Module” instead of “Course” in contexts where the underlying resource is a Course/Program but should be presented as a module (B2B contract cards and “program-as-course” module rows).

Changes:

  • Add an isModule flag that propagates through CoursewareCard into enrolled/unenrolled card variants.
  • Update EnrolledCourseCard and UnenrolledCourseCard to render a dynamic card type label ("Module" vs "Course"), including automatic "Module" labeling for B2B enrollments/contract-page resources.
  • Add/extend frontend tests to verify the label behavior for non-B2B, B2B, and isModule scenarios (including module rows in ProgramAsCourseCard).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/UnenrolledCourseCard.tsx Adds isModule prop and dynamic "Module"/"Course" label logic for unenrolled cards (B2B-aware).
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/UnenrolledCourseCard.test.tsx Adds tests covering label behavior for unenrolled cards (non-B2B, B2B, and isModule).
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/ProgramAsCourseCard.tsx Passes isModule to module-row CoursewareCard instances.
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/ProgramAsCourseCard.test.tsx Adds test ensuring module rows display "Module" (covers both enrolled and unenrolled module rows).
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/EnrolledCourseCard.tsx Adds isModule prop and dynamic "Module"/"Course" label logic for enrolled cards (B2B-aware).
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/EnrolledCourseCard.test.tsx Adds tests covering label behavior for enrolled cards (non-B2B, B2B, and isModule).
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/CoursewareCard.tsx Adds isModule to shared display props and passes it through to enrolled/unenrolled card implementations.

@gumaerc gumaerc force-pushed the cg/restore-module-label branch from aa702f1 to 24705bf Compare July 7, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants