-
Notifications
You must be signed in to change notification settings - Fork 2
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
When resolving the current run, make sure it's also enrollable #2046
Conversation
I thought we had a design for when there is no enrollable run. @mbilalmughal do you know? |
If there's really nothing for you to enroll in, you just don't get a button at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After setting up a similar test, I was enrolled in the more current course run despite my old enrollment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think getFirstUnenrolledCourseRun
can be removed from frontend/public/src/components/CourseProductDetailEnroll.js since it's not used anywhere.
saw @collinpreston 's note as I was merging.. I agree with that but in the interest of getting this out sooner I went ahead and merged. I'll throw a separate PR up with that change later. |
What are the relevant tickets?
mitodl/hq#3295
Description (What does it do?)
If the app has to resolve which course run it should be working with, sometimes it will fail back to just the first one in the list that comes back from the API. This can result in a course run that's not enrollable being chosen. This PR adds a check to favor the first enrollable course run over just the first one in the list, and then fall back to the first one in the list if there's not one that's eligible.
How can this be tested?
I tested by copying the courserun info for
course-v1:MITxT+14.100x+3T2023
and1T2024
from production, making sure both had products, and then forcing an audit enrollment in 3T2023. Once done, you should be able to load the course page for 14.100x, and clicking Enroll Now should offer to upgrade you to 1T2024. Clicking upgrade or hitting Enroll for Free should enroll you in the correct (1T2024) run.