Open
Conversation
…#3066) * Changing API from the regular enrollment one to the verified program-specific one when the card displays an course in a program * formatting * update isPending, remove stale references to createEnrollment * fixes for other things copilot noted * forgot to fix the call itself * fixing a different test
* feat: display child programs in program requirement sections
Program pages now render child programs alongside courses in the
requirements section, preserving tree order. Child programs with
display_mode="course" show as course cards linking to /courses/p/,
while others show as program cards linking to /programs/. Completion
text uses "courses/programs" when items are mixed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: extract getIdsFromReqTree, remove duplicated helpers, fix typos
Resurrect the req_tree ID extraction as getIdsFromReqTree in mitxonline.ts,
returning { courseIds, programIds } from a single traversal. Remove duplicated
getCourseIdsFromReqTree/getProgramIdsFromReqTree from both test files. Fix
typos ("Collasping", "noFound") and remove dead assertion code.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add price and certificate display to MitxOnlineProgramCard
Show certificate price or course price on program cards, mirroring
the MitxOnlineCourseCard pattern. Uses min_price/max_price for price
display and certificate_type to determine which price slot to use.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use correct price sources for course and program cards
Course cards now prioritize page.current_price over min/max price
range. Program cards use products[0].price instead of min/max price,
matching how ProductSummary displays program pricing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: get course price from next run's product directly
Use bestRun.products[0].price instead of page.current_price, which
is the same value (the price of the run matching next_run_id).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use enrollment type to determine price display on cards
Price display now follows enrollment mode rules:
- free-only: show "Free" as course price, no certificate price
- paid-only: show product price as course price
- both: show "Free" as course price, product price as certificate price
- neither: show nothing
Course cards get price from the next run's product. Program cards
get price from program.products[0].price.
Also documents coursePrice/certificatePrice props on
BaseLearningResourceCard.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: unify MitxOnlineCourseCard and MitxOnlineProgramCard
Replace separate course and program card components with a single
MitxOnlineResourceCard that accepts a discriminated union prop
(resourceType: "course" | "program"). Eliminates duplicated
enrollment type, pricing, and rendering logic.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address code review feedback
- Use coursePageView() helper instead of raw template string for
course hrefs, and handle undefined course gracefully
- Rename misleading totalCourses to totalRequired in ProgramBundleUpsell
- Tighten formatPrice type from unknown to string | number | null
- Remove redundant factory overrides in tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: pluralization bug with mixed course/program nouns
getItemNoun now returns { singular, plural } so that
"course/program" correctly pluralizes to "courses/programs"
instead of the broken "course/programs".
Also adds a test for mixed completion text and wraps async
assertions in waitFor to prevent flaky timing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: use renderWithProviders in MitxOnlineResourceCard tests
Switch from raw render + ThemeProvider to the standard
renderWithProviders helper for consistency with project conventions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: rename getItemNoun to getRequirementItemNoun, use in ProductSummary
Rename for clarity. ProductSummary RequirementsRow now uses
getRequirementItemNoun so the label says "Courses/Programs" when
a program has mixed requirement types.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: always use "courses" in completion/summary text
Remove getRequirementItemNoun — correctly classifying child programs
by display_mode requires data that isn't always available (child
program details must be fetched). Since child programs with
display_mode="course" should count as courses anyway, always saying
"courses" is the simplest correct approach. Added comments explaining
this limitation in both ProgramPage and ProductSummary.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: improve comments explaining "courses" text limitation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: use min/max price for course and program cards
Use min_price/max_price from the resource (course or program) as the
price source, showing a range when they differ. This replaces the
previous approach of reading from bestRun.products[0].price for
courses and program.products[0].price for programs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address review feedback — use shared formatPrice, improve tests
- Use formatPrice from mitxonline.ts instead of local formatCurrency
- Assert child program hrefs in mixed requirements test
- Add course-specific pricing test for MitxOnlineResourceCard
- Scope ProgramAsCoursePage mixed test assertions to Modules region
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: pass certificate_type to card as certificateTypeName
Display the actual certificate type (e.g., "program_certificate")
instead of the generic "Certificate" label. Also removes a stray
console.log.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: replace waitFor+getBy with findBy in new tests
Use findByRole instead of waitFor + getByRole for async assertions,
per project testing conventions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: prefer product price over min/max when min equals max
When min_price and max_price are equal, use the product price
(bestRun.products[0].price for courses, program.products[0].price
for programs) as a more precise value. When they differ, show the
range. This mirrors the original formatCoursePrice logic (which
used page.current_price as the product-based fallback).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add start date display to program cards in MitxOnlineResourceCard
- Programs now show start date (or "Anytime") like courses do
- "Starts:" label shown for anytime or medium-sized cards; suppressed on small cards with a real date
- Fix startLabel logic: show label when date exists, not when it doesn't
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: extract CardData type and improve async test assertions
- Extract inline return type of extractCardData into a named CardData type
- Replace waitFor+multiple-getBy blocks with findBy+synchronous-getBy pattern
to satisfy testing-library/no-wait-for-multiple-assertions lint rule
- Assert interleaved module order (c1, p1, c2) via listitem positions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: unify getBestRunForCourse and getBestRun into common/mitxonline
The dashboard helper and the product-page card had duplicate logic for
selecting the best run from a course. Unified into getBestRun in
common/mitxonline with an opts.enrollableOnly flag (default false) so
the dashboard can opt into enrollable-only filtering and the card gets
all runs. Dashboard callsite updated to { enrollableOnly: true, contractId }.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: move price derivation into extractCardData
Render function is now purely structural: loading skeleton or card.
All business logic (enrollment type → coursePrice/certificatePrice)
lives in extractCardData alongside the rest of the data extraction.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* rename coursePrice->resourcePrice
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chris Chudzicki
James Kachel