-
Notifications
You must be signed in to change notification settings - Fork 90
feat: Missing Sections Warning #1376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
KevinWu098
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some misc. comments — I'll take another look once they're addressed and once the merge conflicts with main are resolved
|
|
||
| type AACourseExtendedProperties = { | ||
| sections: AASection[]; | ||
| sectionTypes?: Set<WebsocSectionType>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why is this field optional now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some AACourses that have not been enriched yet don't have the section types property if the user added/saved them to their schedule before this feature is merged. I made it optional to handle errors so the missing sections check doesn't try to check and access an attribute that doesn't exist
apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx
Outdated
Show resolved
Hide resolved
| const sectionTypes = new Set<WebsocSectionType>(); | ||
| course.sections.forEach((section) => { | ||
| sectionTypes.add(section.sectionType); | ||
| }); | ||
|
|
||
| (course as AACourse).sectionTypes = sectionTypes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: I see we have this bit of code in websoc.ts and here. why are there two instances of the same code snippet? what do they do / why do we need them both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snippet of code is in the getCourseInfo endpoint which is called when a user adds courses via import. I couldn't figure out a way to use this code snippet only once - I had to use it again in the flattenSocObject func in the CourseRenderPane. The websoc query from the regular course search calls the getOne endpoint which just returns the raw websoc query data. The query from the imports calls the getCourseInfo endpoint, and I couldn't find an overlap to avoid this redundant code
Would love to hear if you have any alternate ideas on this implementation :D
apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx
Outdated
Show resolved
Hide resolved
|
Is this ready for review? @calebwongg |
This reverts commit ebdcf92.
… deployment test works
Summary
Added a warning displaying the missing sections for a course on the added courses page.
When a user selects classes for a course, the required sections for a course are checked (e.g., lecture, lab, discussion) have been added. If any required section type is missing, the UI displays a warning so the user can correct their schedule.
Test Plan
Issues
Closes #1330
Before
After
Future Followup
Notes