Skip to content

feat(admin-semesters): implement add and update schedule and update semester actions#968

Merged
jji05 merged 14 commits intomasterfrom
feat/admin-semesters-page-actions
Mar 14, 2026
Merged

feat(admin-semesters): implement add and update schedule and update semester actions#968
jji05 merged 14 commits intomasterfrom
feat/admin-semesters-page-actions

Conversation

@jji05
Copy link
Member

@jji05 jji05 commented Mar 11, 2026

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

Screenshot 2026-03-13 at 11 37 49 PM

Updating game session schedules

Screenshot 2026-03-13 at 11 37 58 PM

Updating semester

Screenshot 2026-03-13 at 11 38 15 PM

Additiona bug fixes

I've also found an odd UTC bug that wasn't discovered before.

Recreation on prod:

  1. Create a game session schedule
  2. Check admin sessions to see that each game session is offset by 1 day, i.e. week 1 is Monday, week 2 is Tuesday, etc.

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:

Screenshot 2026-03-11 at 11 55 35 PM

AFTER:

Screenshot 2026-03-11 at 11 50 20 PM

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds/modifies functionality)

How Has This Been Tested?

  • Manual testing (requires screenshots or videos)
  • Integration tests written (requires checks to pass)
  • This does not require tests (please leave a note as to why)

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added thorough tests that prove my fix is effective and that my feature works
  • Additional issues have been created for any tech debt left in this PR
  • I've requested a review from another user

@jji05 jji05 linked an issue Mar 11, 2026 that may be closed by this pull request
6 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

Preview Deployment Status

✅ Storybook Preview: https://c7be8e43.uabc-storybook.pages.dev

✅ Frontend Preview: https://170a3347.uabc.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 82.66% (🎯 70%)
⬇️ -1.18%
2689 / 3253
🔵 Statements 82.58% (🎯 70%)
⬇️ -1.14%
2755 / 3336
🔵 Functions 76.93% (🎯 80%)
⬇️ -1.29%
647 / 841
🔵 Branches 78.13% (🎯 60%)
⬇️ -0.23%
1547 / 1980
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/frontend/src/components/client/admin/tabs/admin-semesters/AdminSemesters.tsx 0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
23-341
apps/frontend/src/components/client/admin/tabs/admin-semesters/SemesterScheduleAccordionItem.tsx 0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
45-55
apps/frontend/src/components/client/user/ProfileSection.tsx 61.53%
🟰 ±0%
38.46%
🟰 ±0%
50%
🟰 ±0%
64%
🟰 ±0%
35-36, 40-55, 60
apps/backend/src/data-layer/utils/DateUtils.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ui/src/components/Composite/AdminSemestersAccordionItem/AdminSemestersAccordionItem.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ui/src/components/Generic/CreateGameSchedulePopUp/CreateGameSchedulePopUp.tsx 100% 100% 100% 100%
packages/ui/src/components/Generic/CreateMemberPopUp/CreateMemberPopUp.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ui/src/components/Generic/CreateSemesterPopUpFlow/CreateSemesterPopUpFlow.tsx 97.77%
⬆️ +0.21%
85%
⬆️ +1.08%
100%
🟰 ±0%
97.72%
⬆️ +0.22%
94
packages/ui/src/components/Generic/CreateSemesterPopUpFlow/SemesterDatePopUp/SemesterDatePopUp.tsx 100%
🟰 ±0%
95.23%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ui/src/components/Generic/CreateSemesterPopUpFlow/SemesterNamePopUp/SemesterNamePopUp.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ui/src/components/Generic/CreateSessionPopUp/CreateSessionPopUp.tsx 33.33%
🟰 ±0%
33.33%
🟰 ±0%
25%
🟰 ±0%
33.33%
🟰 ±0%
134-135, 139-269
Generated in workflow #3975 for commit fdde509 by the Vitest Coverage Report Action

@jji05 jji05 marked this pull request as draft March 11, 2026 11:37
@jji05 jji05 marked this pull request as draft March 11, 2026 11:37
jji05 added 2 commits March 13, 2026 23:40
- 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.
@jji05 jji05 marked this pull request as ready for review March 13, 2026 10:46
@jji05 jji05 requested a review from Copilot March 13, 2026 11:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 CreateGameSchedulePopUp component with form validation, edit support, and time conversion utilities (isoToTimeInput/timeInputToIso)
  • Extended CreateSemesterPopUpFlow to 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/ leftIconstartIcon 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 isOpenopen 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],
@jji05 jji05 requested a review from choden-dev March 13, 2026 11:06
@jji05
Copy link
Member Author

jji05 commented Mar 13, 2026

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

@jji05 jji05 changed the title feat(admin-semesters-tab): implement missing actions feat(admin-semesters-tab): implement add and update schedules and update semester actions Mar 14, 2026
@jji05 jji05 changed the title feat(admin-semesters-tab): implement add and update schedules and update semester actions feat(admin-semesters): implement add and update schedule and update semester actions Mar 14, 2026
@jji05 jji05 merged commit a6f8dd5 into master Mar 14, 2026
23 checks passed
@jji05 jji05 deleted the feat/admin-semesters-page-actions branch March 14, 2026 02:30
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.

[FRONTEND] Implement schedule actions on admin semesters page

3 participants