Skip to content

Conversation

ChristopherChudzicki
Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki commented Oct 10, 2025

What are the relevant tickets?

Description (What does it do?)

Adds the program summary box to MIT Learn program pages.

Screenshots (if appropriate):

Screenshot 2025-10-14 at 12 32 53 PM Screenshot 2025-10-14 at 12 33 24 PM

How can this be tested?

Prerequisite: A working mitxonline local installation; does not require OpenEdx integration.

Setup: Connect MITxOnline <--> MIT Learn:

# MIT Learn, backend.env
MITX_ONLINE_BASE_URL=http://mitxonline.odl.local:8013/
MITX_ONLINE_COURSES_API_URL=http://host.docker.internal:8013/api/v2/courses/
MITX_ONLINE_PROGRAMS_API_URL=http://host.docker.internal:8013/api/v2/programs/
# MIT Learn, frontend.env
## This is the default; it should not be overridden
NEXT_PUBLIC_MITX_ONLINE_BASE_URL=${MITX_ONLINE_BASE_URL}
# Be sure that COMPOSE_PROFILES is unset; we want the mit-learn apigateway and keycloak containers

# MITxOnline, .env
CSRF_COOKIE_DOMAIN=.odl.local
CORS_ALLOWED_ORIGINS=http://mitxonline.odl.local:8065, http://learn.odl.local:8062
CSRF_TRUSTED_ORIGINS=http://mitxonline.odl.local:8065, http://learn.odl.local:8062

# For mitol-django-apigateway
MITOL_APIGATEWAY_DISABLE_MIDDLEWARE=False
MITOL_APIGATEWAY_USERINFO_CREATE=True
MITOL_APIGATEWAY_USERINFO_UPDATE=True

# Keycloak settings, these should match mit-learn
KEYCLOAK_BASE_URL=http://kc.ol.local:8066
KEYCLOAK_CLIENT_ID=apisix
KEYCLOAK_CLIENT_SECRET=HckCZXToXfaetbBx0Fo3xbjnC468oMi4 # pragma: allowlist-secret
KEYCLOAK_DISCOVERY_URL=http://kc.ol.local:8066/realms/ol-local/.well-known/openid-configuration
KEYCLOAK_REALM_NAME=ol-local

Now:

  1. Create a program with some required and elective courses. Useful things to know:
    • Create courses and programs with ./manage.py create_courseware, ./manage.py create_courseware_page; see --help for details. Note: program readable ids should start with program-v1:.
    • Add instructors/relevant data for your program in Wagtail at http://mitxonline.odl.local:8013/cms
  2. Run MITxOnline ETL against your local MITxOnline; ./manage.py backpopulate_mitxonline_data --delete, and ./manage.py backpopulate_mitxonline_data
    • ⚠️ If you skip this step, everything should work fine, except the "Format" row of summary. The ETL data will be used for other parts of the product page in future, though.
  3. Ensure product-page-course feature flag is on in your personal posthog
  4. View your program at http://learn.odl.local:8062/programs/:program_id
  5. Check that the product summary looks as it does in Figma
  6. Other things to check:
    • no elective courses => elective data doesn't show at all
    • no "What's this?" opens a dialog

@ChristopherChudzicki ChristopherChudzicki added the Needs Review An open Pull Request that is ready for review label Oct 14, 2025
constructor({ id, data }: NodeConstructorOpts = {}) {
this.id = id ?? uniqueNodeId.enforce(faker.number.int)
this.data = {
// @ts-expect-error OpenAPI spec is incorret
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Assuming that improve openapi for req_tree is merged, these @ts-expect-errors will start triggering errors on the corresponding new version of @mitodl/mitxonline-api-axios.

I did try a local copy of the client generated from improve openapi for req_tree and no errors are caused except the @ts-expect-error lines, whose fix is trivial (remove them).

Comment on lines 140 to 141
- MITX_ONLINE_UPSTREAM=${MITX_ONLINE_UPSTREAM:-host.docker.internal:8013}
- MITX_ONLINE_DOMAIN=${MITX_ONLINE_DOMAIN:-host.docker.internal}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This and the related changes should mean we don't need to use local ips (which change when we come into the office...) for MIT Learn <> MITxOnline integration.

@gumaerc gumaerc self-assigned this Oct 15, 2025
Copy link
Contributor

@gumaerc gumaerc left a comment

Choose a reason for hiding this comment

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

The program summary box works for me and looks good vs the Figma design.

I'll leave it up to you as to whether or not to do this, but normally I would separate the local dev Docker hostname changes into a separate PR. Nonetheless, I did notice something that looks to be a typo:

<<: *host-access
environment:
- CSRF_COOKIE_DOMAIN=${CSRF_COOKIE_DOMAIN:-.odl.local}
- CSRF_COOKIE_DOMAIN=${CSRF_COOKGreatIE_DOMAIN:-.odl.local}
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this about?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cookies are the worst so great.

Typo, thanks.

Fixed the typo, but moved all that stuff to #2594

Copy link
Contributor

@gumaerc gumaerc left a comment

Choose a reason for hiding this comment

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

👍 Looks good!

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