iOlivers / BrockTimeTable

2 stars 0 forks source link

[TASK/BUG FIX] Add courses only if the course is available in the given term. #4

Closed condyl closed 8 hours ago

condyl commented 1 week ago

Currently, you can add a course with a specified term even if it doesn't exist as a course in the timetable. For example: If you try to add "COSC 1P02 D1" (which is currently the example course given), it will 'add' the course, despite a full year intro to CS course not existing.

This shouldn't happen. You should only be able to add a course if it is available for the specified course.

iOlivers commented 3 days ago

Because this would just generate 0 valid timetables, the user can likely figure out that the course they just added does not exist in that duration and would likely go back to try another duration.

Since this doesn't break functionality I dropped it to Low Priority for now, we should still deal with this in the future. At the very least we should display some warning modal to inform the user that the course they just added has no valid offerings in that duration.

iOlivers commented 8 hours ago

This issue has now been resolved by latest commit. (https://github.com/iOlivers/BrockTimeTable/commit/4787350a95d2177fe2027498b1a5ef4c47804918)

https://github.com/iOlivers/BrockTimeTable/blob/4787350a95d2177fe2027498b1a5ef4c47804918/src/components/CalendarComponent.js#L39-L43

Default browser alert has now been added when no valid timetables can be generated this includes the case mentioned above where a course is not offered in the duration.

The new basic alert can be later replaced as addressed in #5