ucsb-cs156-s24 / proj-courses-s24-4pm-3

https://ucsb-cs156-s24.github.io/proj-courses-s24-4pm-3/
0 stars 0 forks source link

KevinC - Fix Add to Schedule Button to only include schedules with corresponding quarter. #48

Closed KevinChen0527 closed 4 months ago

KevinChen0527 commented 4 months ago

Closes #21 and Closes #24

Dokku link: https://courses-qa.dokku-03.cs.ucsb.edu/

This PR was originally split into two different bugs, however, after working on the first issue, I felt that it was easier to remerge the first 2 issues (Original bug was split into 3 different issues) since both changes were very similar and testing became easier when both issues were completed.

This PR makes it so that 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.

Additionally, 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.

Screenshot 2024-05-28 at 5 54 43 PM

In the above image, even if we are adding a course with a differing quarter than the existing schedules, both the schedules still appear and there is no option to create a new schedule for the corresponding quarter.

Screenshot 2024-05-28 at 6 03 20 PM

After the changes, only the schedules with the same corresponding quarter appear.

Screenshot 2024-05-28 at 3 16 44 PM

If no schedules exist for that quarter, then the Create a new schedule option will appear as a button which leads to the create personal schedule page below.

Screenshot 2024-05-28 at 3 16 51 PM