Skip to content

Conversation

@training4usaco
Copy link

@training4usaco training4usaco commented Jan 7, 2026

Context

Summary

  • After this PR, whenever a user creates a custom event, we will automatically assign a term to the custom event
  • The term is determined by the courses in the schedules provided for the custom event as follows:
    • If there are no course events, defaultTerm will be picked
    • Otherwise, the latest term out of the course events will be picked
  • The term is then stored in the database in a column called "term" in the table customEvent
  • Note 1: deleting/adding regular course events will not update custom event terms, unless the custom event is edited and saved (there is also no option to pick the term for the custom event manually)
  • Note 2: I'm not sure if the snapshot should get merged as well, but it accounts for +450, so the PR itself is around +100 -9

Test Plan

  1. Test creation of a custom event with a single term in the schedule. Verify that the custom event is assigned the correct term.
  2. Test creation of a custom event with multiple terms in the schedule. Ensure the latest term is assigned to the custom event.
  3. Test creation of a custom event with no associated terms in the schedule. Verify that the default term is applied.
  4. Ensure that edge cases like missing terms or incorrect term names in the schedule are handled correctly and fall back to the default term.
  5. Verify that custom events are correctly displayed with their respective terms in calendar view - CustomEventDialog.
  6. Test loading and saving to backend. Verify that loaded and saved custom events have the appropriate term.

Issues

Closes #762

@training4usaco training4usaco marked this pull request as ready for review January 8, 2026 00:08
@training4usaco
Copy link
Author

@alexespejo Hey! Could I get a review for this PR. It's pretty similar to the linked PR. I also left a couple notes in the PR comment about things I wasn't particularly sure about.

@training4usaco training4usaco force-pushed the feature/add-term-to-custom-events branch from e06ef2e to 22ef48c Compare January 8, 2026 00:26
<MapLink buildingId={+building} room={buildingCatalogue[+building]?.name ?? ''} />
</Box>
)}
<table style={{ border: 'none', width: '100%', borderCollapse: 'collapse', fontSize: '0.9rem' }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: we use a library called MUI that that provides dedicated components such as <Table>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download ICS: Assign CourseEvent term to CustomEvent

2 participants