Skip to content

Conversation

@gumaerc
Copy link
Contributor

@gumaerc gumaerc commented Oct 21, 2025

What are the relevant tickets?

Related to https://github.com/mitodl/hq/issues/8818

Description (What does it do?)

This PR updates the code in InfoItems, adjusting the start dates row. If the given resource has the next_start_date property populated, that date is used in place of the first chronological course run based on start_date.

How can this be tested?

  • Spin up mit-learn on main
  • Make sure you are configured properly to backpopulate xPRO courses
  • Run docker compose exec web ./manage.py backpopulate_xpro_data
  • After courses are backpopulated, visit search and look up "Principles of Biomanufacturing: Using Biotechnology to Manufacture Medicines"
  • Once you see the course in the search results, click it to bring up the learning resource drawer
  • Verify that the first start date shown under "Starts:" is different from the one on the card
  • Switch to this branch (cg/drawer-start-date)
  • Verify that the date in the drawer now matches the date on the card

@gumaerc gumaerc added the Needs Review An open Pull Request that is ready for review label Oct 21, 2025
@gumaerc gumaerc changed the title Cg/drawer start date use next_start_date when available in learning resource drawer Oct 21, 2025
Copy link
Contributor

@jonkafton jonkafton left a comment

Choose a reason for hiding this comment

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

I left a question, otherwise looks good 👍

.map((run) => formatRunDate(run, showStartAnytime(resource)))
.filter((date) => date !== null)
if (!sortedDates || sortedDates.length === 0) {
return null
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we definitely want to return here if we have no run dates, but potentially have a resource.next_start_date to show?

@gumaerc gumaerc force-pushed the cg/drawer-start-date branch from bb1e30b to b6e0067 Compare October 27, 2025 20:15
@gumaerc gumaerc force-pushed the cg/drawer-start-date branch from b6e0067 to 688be44 Compare October 28, 2025 16:13
@gumaerc gumaerc merged commit a304bcf into main Oct 28, 2025
13 checks passed
@gumaerc gumaerc deleted the cg/drawer-start-date branch October 28, 2025 18:40
@odlbot odlbot mentioned this pull request Oct 28, 2025
5 tasks
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.

3 participants