feat(admin-semesters): implement add and update schedule and update semester actions#968
feat(admin-semesters): implement add and update schedule and update semester actions#968
Conversation
- Also removed usage of deprecated `leftIcon` prop. - Added component test+stories for `CreateGameSchedulePopUp` - Added date util functions and tests relevant to this component.
…leting game session schedules
Preview Deployment Status✅ Storybook Preview: https://c7be8e43.uabc-storybook.pages.dev ✅ Frontend Preview: https://170a3347.uabc.pages.dev |
- Also updated tests
- I've used template `templateAreas` to improve input placing so that similar inputs are grouped together. - Also improve spacing for `location` so that there is more room to see what is typed. - I've also added labels so that start and end time aren't up to the user to guess.
There was a problem hiding this comment.
Pull request overview
This PR implements missing admin semester page actions: create/edit game session schedules and edit semester. It also fixes a UTC date bug in DateUtils where setDate was used instead of setUTCDate, causing day-offset issues.
Changes:
- New
CreateGameSchedulePopUpcomponent with form validation, edit support, and time conversion utilities (isoToTimeInput/timeInputToIso) - Extended
CreateSemesterPopUpFlowto support editing (initial values, custom titles) and changed semester update API from PUT to PATCH - Fixed UTC date handling in
DateUtils.ts(setUTCDate/getUTCFullYear) to prevent day-offset bugs
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/shared/src/utils/date.ts |
Added isoToTimeInput and timeInputToIso utility functions |
packages/shared/src/schemas/game-session-schedule.ts |
Added form validation schema for game schedule popup |
packages/shared/src/enums/popup.ts |
Added new popup enum values |
packages/ui/.../CreateGameSchedulePopUp/ |
New popup component for creating/editing game schedules |
packages/ui/.../CreateSemesterPopUpFlow/ |
Added initialValues, confirmationTitle, nameStepTitle props for edit support |
packages/ui/.../SemesterNamePopUp/ |
Added customizable title prop |
packages/ui/.../SemesterDatePopUp/ |
Simplified state init, removed useEffect |
packages/ui/.../CreateSessionPopUp/ & CreateMemberPopUp/ |
leftIcon → startIcon migration |
packages/ui/.../AdminSemestersAccordionItem/ |
Changed onEditSemester to pass full Semester object |
apps/frontend/.../AdminSemesters.tsx |
Wired up edit semester, create/edit schedule flows |
apps/frontend/.../AdminSemesterService.ts |
Changed update from PUT to PATCH |
apps/frontend/.../AdminGameSessionScheduleMutations.ts |
Updated cache invalidation |
apps/frontend/.../ProfileSection.tsx |
isOpen → open migration |
apps/backend/.../DateUtils.ts |
Fixed UTC date methods |
apps/backend/.../DateUtils.test.ts |
Added UTC weekday and interval tests |
apps/backend/src/utils/date.test.ts |
Tests for isoToTimeInput/timeInputToIso |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| queryClient.invalidateQueries({ | ||
| // TODO: when get by id is implemented, only invalidate the updated id for get by id | ||
| queryKey: [QueryKeys.GAME_SESSION_SCHEDULE_QUERY_KEY], | ||
| queryKey: [QueryKeys.GAME_SESSION_SCHEDULE_QUERY_KEY, QueryKeys.GAME_SESSION_QUERY_KEY], |
|
note that the coverage report system is just broken too 💀 will fix that later as it is lower priorities, there should be no coverage drop down |
Description
General summary
I've implemented create and update game session schedules, as well as updating semester which was a very important flow for onboarding admins.
Creating game session schedules
Updating game session schedules
Updating semester
Additiona bug fixes
I've also found an odd UTC bug that wasn't discovered before.
Recreation on prod:
This was because we weren't using the UTC date methods which resulted in local time issues during dev server running on dev computers (timezone difference).
BEFORE:
AFTER:
Type of change
How Has This Been Tested?
Checklist before requesting a review