Skip to content

If getStartDateText gets a course with no runs, output empty string #2703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

jkachel
Copy link
Contributor

@jkachel jkachel commented Jun 3, 2025

What are the relevant tickets?

Closes mitodl/hq#7473

Description (What does it do?)

As noted in the issue, when the frontend hit a course that had no course runs in it, it called getStartDateText, which then dutifully sorted nothing and moment was left to operate on an undefined. Now, if there's no course runs, this should just return an empty string.

How can this be tested?

Create a course with a live page and everything, but no course runs. The catalog Courses tab should work as you would expect. The course should show up but it should not say anything for start date.

Additional Context

Not sure if we want something else here besides empty string. I think generally we were expecting there to always be at least one course run in the list. (The course that tripped this up had a B2B run, and we don't want users getting into those, so we filter those out..)

@cp-at-mit cp-at-mit self-assigned this Jun 4, 2025
Copy link
Contributor

@cp-at-mit cp-at-mit left a comment

Choose a reason for hiding this comment

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

There are a lot of code changes in this PR that I didn't expect to see as they don't seem to relate to the issue or PR description. Is that expected?

@jkachel
Copy link
Contributor Author

jkachel commented Jun 4, 2025

There are a lot of code changes in this PR that I didn't expect to see as they don't seem to relate to the issue or PR description. Is that expected?

Hm... No, this seems to have picked up the stuff for edX course creation too. I'ok fix that and will ping when it's ready.

@jkachel jkachel force-pushed the jkachel/fix-getstartdatetext branch from 5c93477 to dcd3a3c Compare June 4, 2025 14:15
@jkachel jkachel merged commit 95d100e into main Jun 4, 2025
8 checks passed
This was referenced Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants