When using the button on the main course search results to add a course to a personal schedule, the button allows the user to add courses to a schedule for a different quarter than the course. This should not be allowed. Instead, the modal that shows a list of personal schedules to choose from should only show personal schedules for the quarter that matches the course being added. If no such personal schedules exist, the model should say, for example (if the quarter is F24):
No personal schedules exist for quarter F24.
[Create One]
Where [Create One] is a button that navigates to the create page for personal schedules.
Expected Behavior
When adding a course from a given quarter to a personal schedule, only schedules that match the quarter of the course should be presented as options.
Current / Observed Behavior
When adding a course from a given quarter to a personal schedule, all personal schedules are presented as options. This results in incorrect behavior, where one of two things happens:
Either there is a POST error when the enrollment code doesn't exist in the target quarter
A course with the target enrollment code (e.g. 23456) is added, but it could be an entirely different course from the one intended.
Create at least one personal schedule for a given quarter (e.g. W22 as shown below)
Search for a course from a different quarter (e.g. S24)
Find a course you can add with the Green Add button. Click the button to add that course to a personal schedule.
The modal pops up as shown below. Select a schedule for the wrong quarter.
Observe that you get either an error or you get a course other than the one you intended showing up on your schedule.
Here's what the error looks like:
Here's what a wrong course looks like. This happens when by coincidence, there is a course with the same enrollment
code in the target quarter (but it could be an entirely different course! In this case, we tried to add ANTH 3 from F24 but ended up with ANTH 5 from W22.)
Acceptance Criteria
[x] #24
[x] #25
[ ] Nice to have, but not essential: add an optional parameter to the https://courses-qa.dokku-00.cs.ucsb.edu/personalschedules/create url e.g. https://courses-qa.dokku-00.cs.ucsb.edu/personalschedules/create?qtr=f24 so that the quarter is preset to the selected one, and use this on the modal. (This should definitely be factored out into a separate issue and PR.)
Summary
When using the button on the main course search results to add a course to a personal schedule, the button allows the user to add courses to a schedule for a different quarter than the course. This should not be allowed. Instead, the modal that shows a list of personal schedules to choose from should only show personal schedules for the quarter that matches the course being added. If no such personal schedules exist, the model should say, for example (if the quarter is F24):
Where
[Create One]
is a button that navigates to the create page for personal schedules.Expected Behavior
When adding a course from a given quarter to a personal schedule, only schedules that match the quarter of the course should be presented as options.
Current / Observed Behavior
When adding a course from a given quarter to a personal schedule, all personal schedules are presented as options. This results in incorrect behavior, where one of two things happens:
Steps to Reproduce
Login to the https://courses.dokku-00.cs.ucsb.edu website
Create at least one personal schedule for a given quarter (e.g. W22 as shown below)
Search for a course from a different quarter (e.g. S24)
Find a course you can add with the Green Add button. Click the button to add that course to a personal schedule.
The modal pops up as shown below. Select a schedule for the wrong quarter.
Observe that you get either an error or you get a course other than the one you intended showing up on your schedule.
Here's what the error looks like:
Here's what a wrong course looks like. This happens when by coincidence, there is a course with the same enrollment code in the target quarter (but it could be an entirely different course! In this case, we tried to add ANTH 3 from F24 but ended up with ANTH 5 from W22.)
Acceptance Criteria
https://courses-qa.dokku-00.cs.ucsb.edu/personalschedules/create?qtr=f24
so that the quarter is preset to the selected one, and use this on the modal. (This should definitely be factored out into a separate issue and PR.)