Repository navigation
Fix duplicate rendering of Y courses in the timetable grid - #1836
Conversation
… into typescript-calendar
… into typescript-calendar
Coverage Report for CI Build 45231144418Coverage increased (+0.05%) to 61.694%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
| courseCode: lectureSection.courseCode, | ||
| session: lectureSection.session, | ||
| timeSession: time.timeSession, | ||
| timeSession: time.timeSession!, |
There was a problem hiding this comment.
In general ! should be avoided. We made this field optional in the backend, but to keep the type stricter here we could use time.timeSession || "", causing the session data to be ignored. (I'm not sure if this is the best approach, or whether the check you modified should check session as a fallback if timeSession isn't specified.)
There was a problem hiding this comment.
I feel like this would apply for timeSession, startHour, and endHour in the same way. These come from the same place in the original ttb JSON, and from my current understanding, LectureTimeframe objects in general wouldn't have a purpose if any of those values are undefined.
How about this approach of explicitly filtering out any times where any of these values are undefined before creating the LectureTimeframe objects?
There was a problem hiding this comment.
Okay, this approach looks good to me 👍
fe8140a to
50effb3
Compare
david-yz-liu
left a comment
There was a problem hiding this comment.
Nice work, @Purplegaze!
| courseCode: lectureSection.courseCode, | ||
| session: lectureSection.session, | ||
| timeSession: time.timeSession, | ||
| timeSession: time.timeSession!, |
There was a problem hiding this comment.
Okay, this approach looks good to me 👍
Proposed Changes
Depends on #1831
Updates grid rendering to sort lecture timeframes by
timeSessioninstead ofsession. This fixes an issue where Y courses were appearing duplicated on the timetable.Screenshots
Before
After
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)