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
[ ] When you click the add button for a course in a given quarter, say F24, in the modal that pops up, all of the personal schedules for that quarter are shown, and ONLY the personal schedules for that quarter are shown. (NOTE: This could be factored out into it's own issue an PR).
[ ] When you click the add button for a course in a given quarter, say F24, if there are no personal schedules for that quarter that already exist, the model says: "There are no personal schedules for F24" (or whatever the quarter is), and there is a button [Create Personal Schedule] that when you click it, navigates to the https://courses-qa.dokku-00.cs.ucsb.edu/personalschedules/create page. (NOTE: This could be factored out into its own issue and PR)
[ ] 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.)
Factored out from Issue #1
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
page. (NOTE: This could be factored out into its own issue and PR)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.)