Skip to content
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

Implement monthly view calendar for admin scheduling UI #207

Merged
merged 14 commits into from
Mar 31, 2022

Conversation

7tint
Copy link
Member

@7tint 7tint commented Mar 13, 2022

Ticket link

Closes #177

Implementation description

  • Implemented the monthly view calendar for the admin schedule UI.
  • Used the FullCalendar daygrid library add-on.

Steps to test

  1. Install new dependencies and start frontend
  2. Add the following snippet to Default.tsx, importing components/variables when necessary:
<Container maxW="container.xl">
    <AdminShiftCalendar events={ADMIN_SHIFT_CALENDAR_TEST_EVENTS} />
</Container>
  1. Check that the events are displayed appropriately. Days with no events should be greyed out. "Unsaved" events have red dots and "saved" events have green dots. Should show the following:

Screen Shot 2022-03-13 at 1 26 40 AM
4. Feel free to change the test case, as long as all events of ADMIN_SHIFT_CALENDAR_TEST_EVENTS are in the same month.

What should reviewers focus on?

  • Clean UI, expected behaviour & styling 🖌️ 🌈
  • I have defeated FullCalendar's final boss.

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@github-actions
Copy link

github-actions bot commented Mar 13, 2022

Visit the preview URL for this PR (updated for commit 939d052):

https://sistering-dev--pr207-lambert-shift-calend-jba7ndj6.web.app

(expires Thu, 07 Apr 2022 22:18:20 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Member

@sherryhli sherryhli left a comment

Choose a reason for hiding this comment

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

✨ Looks amazing! ✨

Nothing too big from me, just some questions and suggestions :)

}}
fixedWeekCount={false}
headerToolbar={false}
initialDate={events.length > 0 ? events[0].start : new Date()}
Copy link
Member

Choose a reason for hiding this comment

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

Something I discovered from the shift calendar is that FullCalendar does not re-render when initialDate changes. Can you confirm if the initialDate is updated when a new set of events is passed as props?

#203 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not quite sure how to test this without integrating the calendar into the header. I think maybe we can investigate into this in the calendar header ticket (where the events are being passed in).

What I suspect though, is that FullCalendar is not refreshing when the events props change. We might be able to get around this using a force refetch - https://fullcalendar.io/docs/Calendar-refetchEvents.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good 👍

Was thinking of making wrapper like the one described in fullcalendar/fullcalendar#4684 (comment) for the week view calendar, would be applicable here too.

@7tint 7tint force-pushed the lambert/shift-calendar-month-view branch 2 times, most recently from a0aeaac to fe11518 Compare March 24, 2022 22:26
@7tint
Copy link
Member Author

7tint commented Mar 24, 2022

I left the Calendar component in Default.tsx so that you can take a look again when you review. I'll remove it once this PR is approved!

Copy link
Member

@sherryhli sherryhli left a comment

Choose a reason for hiding this comment

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

LGTM, will approve after addressing tiny lint issue


export type MonthEvent = Event & {
groupId: string;
};
Copy link
Member

Choose a reason for hiding this comment

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

Nit: newline please

Copy link
Member

@sherryhli sherryhli left a comment

Choose a reason for hiding this comment

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

🚢🚢🚢

@7tint 7tint merged commit 3db1450 into main Mar 31, 2022
@7tint 7tint deleted the lambert/shift-calendar-month-view branch March 31, 2022 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shift calendar for scheduling UI
2 participants