display "module" on b2b cards and module rows#3578
Conversation
There was a problem hiding this comment.
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.
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
There was a problem hiding this comment.
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
isModuleflag that propagates throughCoursewareCardinto enrolled/unenrolled card variants. - Update
EnrolledCourseCardandUnenrolledCourseCardto 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
isModulescenarios (including module rows inProgramAsCourseCard).
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. |
aa702f1 to
24705bf
Compare
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
Courseor aProgrambehind 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 aProgramwithdisplay_modeset to "course." This is accomplished by passing anisModuleflag through the cards into the card type indicator.Screenshots (if appropriate):
How can this be tested?