unc-csxl / csxl.unc.edu

CS Experience Labs' web application.
https://csxl.unc.edu
MIT License
10 stars 12 forks source link

Add Recurring Office Hours Events #597

Open ajaygandecha opened 2 months ago

ajaygandecha commented 2 months ago

Synopsis

The new office hours feature enables instructors and TAs to create office hours events for their classes! The problem, is, you cannot make recurring events. Dealing with recurring events correctly is a large challenge, since events are linked to each other.

Your mission, should you choose to accept it, is to implement the ability to add recurring office hours events for the XL site.

Acceptance Criteria

First Steps

If your team chooses to accept this, please list yourself as "assignees" to this ticket! Then, begin to work on a backend entity diagram design and a frontend design on Figma. Then, comment them here on this ticket for approval! From there, you can begin creating a branch for this feature.

Work on a branch called reccuring-oh-events.

For approvals, we will work in this order:

  1. Backend Review: Tests to ensure your backend is working properly.
  2. Frontend Review: Ensures your frontend looks good!

For tips on what we will look for, check out the Contributing Guidelines.

jadekeegan commented 2 months ago

Backend Entity Diagram: Image

Changes to Backend:

jadekeegan commented 2 months ago

Frontend Office Hours Event Creator: Image

Frontend Office Hours Event Editor Image

Notes:

jadekeegan commented 2 months ago

@ajaygandecha @KrisJordan Backend entity diagram and frontend editor form Figma commented above! Let me know if there are any changes I should make. I'll get started on code on Tuesday during my OH.

ajaygandecha commented 2 months ago

@jadekeegan wow LGTM, great work!! 🚀

KrisJordan commented 1 month ago

This is looking really great; loving the UX

My initial thinking is to go in one of two ways with the recurrence entity.

  1. Fold it directly into office hours entity (it's already 1-to-1 as designed, correct?). Perhaps make the fields like: recurs (bool), recur_start_date, recur_monday prefixed. I'm not sure I grok the need for the frequency field?
  2. (More complex) Make the relationship 1-many where 1 "office hours" can have many recurrence patterns. Move the start_time and end_time to the recurrence pattern. Default is no recurrence at a specific time. However, this would allow for one event in the same room to have gaps in time rather than creating two separate events.

My inclination is to keep it simple and go with #1. In the context of managing recurring office hours, I think #2 is overkill.

jadekeegan commented 1 month ago

This is looking really great; loving the UX

My initial thinking is to go in one of two ways with the recurrence entity.

  1. Fold it directly into office hours entity (it's already 1-to-1 as designed, correct?). Perhaps make the fields like: recurs (bool), recur_start_date, recur_monday prefixed. I'm not sure I grok the need for the frequency field?
  2. (More complex) Make the relationship 1-many where 1 "office hours" can have many recurrence patterns. Move the start_time and end_time to the recurrence pattern. Default is no recurrence at a specific time. However, this would allow for one event in the same room to have gaps in time rather than creating two separate events.

My inclination is to keep it simple and go with #1. In the context of managing recurring office hours, I think #2 is overkill.

I think it's a events-recurrence is actually a many-to-one, and we might need it separate in order to have every associated recurring event change if you change the pattern. The frequency field doesn't have any utility for us right now if we assume that all recurrences should just be weekly as opposed to daily/monthly/etc.