-
Notifications
You must be signed in to change notification settings - Fork 0
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
Schedule Page Logic #57
Conversation
…er user's own shifts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great Josh! Covered all the button cases and works really smoothly. Left two notes.
frontend/src/utils/buttonConfig.js
Outdated
|
||
const currentDate = dayjs(); | ||
const pastShift = currentDate.isAfter(shiftEnd); | ||
const currentShift = currentDate.isBetween(shiftStart, shiftEnd, 'minute', '[]'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's allow volunteer's to check in during a wider time frame, maybe 30 minutes before and after the shift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I've only made the change here, so the request coverage button will still disappear when the shift ends.
commit 3766612 Author: theosiemensrhodes <[email protected]> Date: Wed Feb 12 10:50:06 2025 -0800 update frontend to match sql commit 06ac697 Author: Theo Siemens-Rhodes <[email protected]> Date: Wed Feb 12 10:34:43 2025 -0800 Volunteer Profile Imgs in Side Panel & Ensure admin users have login (#58) * add f_name, l_name to user, ensure admin login is successful * ensure f_name, l_name inserted, ensure inactive volunteers cannot login commit 9a24013 Merge: 3a37582 9f8fce7 Author: Josh Fung <[email protected]> Date: Tue Feb 11 23:29:28 2025 -0800 Merge pull request #57 from ubclaunchpad/schedule-button-status-logic Schedule Page Logic commit 9f8fce7 Author: Josh Fung <[email protected]> Date: Tue Feb 11 23:08:13 2025 -0800 Added thirty minute window to check-in before and after the shift commit bfce70e Merge: 74daca8 3a37582 Author: Josh Fung <[email protected]> Date: Sun Feb 9 16:44:11 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 74daca8 Author: Josh Fung <[email protected]> Date: Sat Feb 8 22:41:58 2025 -0800 Fixed shift cards on volunteer dashboard commit 7e0721c Author: Josh Fung <[email protected]> Date: Thu Feb 6 19:00:12 2025 -0800 Made panel more similar to designs and buttons more reusable commit 600e13b Author: Josh Fung <[email protected]> Date: Thu Feb 6 17:44:51 2025 -0800 Past and fulfilled coverage requests are no longer shown commit ef3f8f5 Merge: 01008da 6842393 Author: Josh Fung <[email protected]> Date: Thu Feb 6 16:57:21 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 01008da Author: Josh Fung <[email protected]> Date: Thu Feb 6 16:23:22 2025 -0800 Added a different status for your fulfilled coverage requests commit 584d609 Author: Josh Fung <[email protected]> Date: Thu Feb 6 12:25:38 2025 -0800 Refactor and cleanup commit 5d3403a Author: Josh Fung <[email protected]> Date: Tue Feb 4 15:36:08 2025 -0800 Added logic for cancelling shift coverage request commit fd5ca84 Author: Josh Fung <[email protected]> Date: Tue Feb 4 00:57:05 2025 -0800 Added canceling on covering someone else's shift commit fb625b2 Merge: 3b9120c 9afcfc8 Author: Josh Fung <[email protected]> Date: Tue Feb 4 00:14:45 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 3b9120c Author: Josh Fung <[email protected]> Date: Fri Jan 31 12:42:24 2025 -0800 Implemented basic cover shift logic and re-rendering side panel commit 2a56827 Author: Josh Fung <[email protected]> Date: Tue Jan 28 20:24:07 2025 -0800 Implemented check in from frontend and refactored so details panel is re-rendered commit e9ff8bd Author: Josh Fung <[email protected]> Date: Sun Jan 26 19:21:24 2025 -0800 Created API endpoint and routes for shift check-in commit 4a03f0b Author: Josh Fung <[email protected]> Date: Sun Jan 26 17:29:46 2025 -0800 Corrected prioritization of user's coverage requests over user's shifts commit 822cf24 Author: Josh Fung <[email protected]> Date: Sun Jan 26 17:25:21 2025 -0800 Refactored to reuse fetchShifts() commit fe30e39 Author: Josh Fung <[email protected]> Date: Sun Jan 26 16:46:27 2025 -0800 Filter out duplicate shifts and prioritize showing coverage shifts over user's own shifts
commit 37305b8 Author: theosiemensrhodes <[email protected]> Date: Fri Feb 14 13:05:12 2025 -0800 updateUser error change commit 2c5f402 Author: theosiemensrhodes <[email protected]> Date: Fri Feb 14 12:53:46 2025 -0800 fix main merge commit 02cdb72 Author: theosiemensrhodes <[email protected]> Date: Wed Feb 12 11:29:10 2025 -0800 Merge main into branch commit a1afe16 Author: theosiemensrhodes <[email protected]> Date: Wed Feb 12 11:29:06 2025 -0800 Squashed commit of the following: commit 3766612 Author: theosiemensrhodes <[email protected]> Date: Wed Feb 12 10:50:06 2025 -0800 update frontend to match sql commit 06ac697 Author: Theo Siemens-Rhodes <[email protected]> Date: Wed Feb 12 10:34:43 2025 -0800 Volunteer Profile Imgs in Side Panel & Ensure admin users have login (#58) * add f_name, l_name to user, ensure admin login is successful * ensure f_name, l_name inserted, ensure inactive volunteers cannot login commit 9a24013 Merge: 3a37582 9f8fce7 Author: Josh Fung <[email protected]> Date: Tue Feb 11 23:29:28 2025 -0800 Merge pull request #57 from ubclaunchpad/schedule-button-status-logic Schedule Page Logic commit 9f8fce7 Author: Josh Fung <[email protected]> Date: Tue Feb 11 23:08:13 2025 -0800 Added thirty minute window to check-in before and after the shift commit bfce70e Merge: 74daca8 3a37582 Author: Josh Fung <[email protected]> Date: Sun Feb 9 16:44:11 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 74daca8 Author: Josh Fung <[email protected]> Date: Sat Feb 8 22:41:58 2025 -0800 Fixed shift cards on volunteer dashboard commit 7e0721c Author: Josh Fung <[email protected]> Date: Thu Feb 6 19:00:12 2025 -0800 Made panel more similar to designs and buttons more reusable commit 600e13b Author: Josh Fung <[email protected]> Date: Thu Feb 6 17:44:51 2025 -0800 Past and fulfilled coverage requests are no longer shown commit ef3f8f5 Merge: 01008da 6842393 Author: Josh Fung <[email protected]> Date: Thu Feb 6 16:57:21 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 01008da Author: Josh Fung <[email protected]> Date: Thu Feb 6 16:23:22 2025 -0800 Added a different status for your fulfilled coverage requests commit 584d609 Author: Josh Fung <[email protected]> Date: Thu Feb 6 12:25:38 2025 -0800 Refactor and cleanup commit 5d3403a Author: Josh Fung <[email protected]> Date: Tue Feb 4 15:36:08 2025 -0800 Added logic for cancelling shift coverage request commit fd5ca84 Author: Josh Fung <[email protected]> Date: Tue Feb 4 00:57:05 2025 -0800 Added canceling on covering someone else's shift commit fb625b2 Merge: 3b9120c 9afcfc8 Author: Josh Fung <[email protected]> Date: Tue Feb 4 00:14:45 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 3b9120c Author: Josh Fung <[email protected]> Date: Fri Jan 31 12:42:24 2025 -0800 Implemented basic cover shift logic and re-rendering side panel commit 2a56827 Author: Josh Fung <[email protected]> Date: Tue Jan 28 20:24:07 2025 -0800 Implemented check in from frontend and refactored so details panel is re-rendered commit e9ff8bd Author: Josh Fung <[email protected]> Date: Sun Jan 26 19:21:24 2025 -0800 Created API endpoint and routes for shift check-in commit 4a03f0b Author: Josh Fung <[email protected]> Date: Sun Jan 26 17:29:46 2025 -0800 Corrected prioritization of user's coverage requests over user's shifts commit 822cf24 Author: Josh Fung <[email protected]> Date: Sun Jan 26 17:25:21 2025 -0800 Refactored to reuse fetchShifts() commit fe30e39 Author: Josh Fung <[email protected]> Date: Sun Jan 26 16:46:27 2025 -0800 Filter out duplicate shifts and prioritize showing coverage shifts over user's own shifts commit 8b412cb Author: theosiemensrhodes <[email protected]> Date: Mon Feb 10 21:59:59 2025 -0800 remove logs, and excess auth token sending commit 4561526 Author: theosiemensrhodes <[email protected]> Date: Mon Feb 10 21:50:14 2025 -0800 add auth for every route commit 4b9d0bf Author: theosiemensrhodes <[email protected]> Date: Mon Feb 10 20:39:55 2025 -0800 change password, 1 call, prevent req mocking
* change password, 1 call, prevent req mocking * add auth for every route * remove logs, and excess auth token sending * Squashed commit of the following: commit 3766612 Author: theosiemensrhodes <[email protected]> Date: Wed Feb 12 10:50:06 2025 -0800 update frontend to match sql commit 06ac697 Author: Theo Siemens-Rhodes <[email protected]> Date: Wed Feb 12 10:34:43 2025 -0800 Volunteer Profile Imgs in Side Panel & Ensure admin users have login (#58) * add f_name, l_name to user, ensure admin login is successful * ensure f_name, l_name inserted, ensure inactive volunteers cannot login commit 9a24013 Merge: 3a37582 9f8fce7 Author: Josh Fung <[email protected]> Date: Tue Feb 11 23:29:28 2025 -0800 Merge pull request #57 from ubclaunchpad/schedule-button-status-logic Schedule Page Logic commit 9f8fce7 Author: Josh Fung <[email protected]> Date: Tue Feb 11 23:08:13 2025 -0800 Added thirty minute window to check-in before and after the shift commit bfce70e Merge: 74daca8 3a37582 Author: Josh Fung <[email protected]> Date: Sun Feb 9 16:44:11 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 74daca8 Author: Josh Fung <[email protected]> Date: Sat Feb 8 22:41:58 2025 -0800 Fixed shift cards on volunteer dashboard commit 7e0721c Author: Josh Fung <[email protected]> Date: Thu Feb 6 19:00:12 2025 -0800 Made panel more similar to designs and buttons more reusable commit 600e13b Author: Josh Fung <[email protected]> Date: Thu Feb 6 17:44:51 2025 -0800 Past and fulfilled coverage requests are no longer shown commit ef3f8f5 Merge: 01008da 6842393 Author: Josh Fung <[email protected]> Date: Thu Feb 6 16:57:21 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 01008da Author: Josh Fung <[email protected]> Date: Thu Feb 6 16:23:22 2025 -0800 Added a different status for your fulfilled coverage requests commit 584d609 Author: Josh Fung <[email protected]> Date: Thu Feb 6 12:25:38 2025 -0800 Refactor and cleanup commit 5d3403a Author: Josh Fung <[email protected]> Date: Tue Feb 4 15:36:08 2025 -0800 Added logic for cancelling shift coverage request commit fd5ca84 Author: Josh Fung <[email protected]> Date: Tue Feb 4 00:57:05 2025 -0800 Added canceling on covering someone else's shift commit fb625b2 Merge: 3b9120c 9afcfc8 Author: Josh Fung <[email protected]> Date: Tue Feb 4 00:14:45 2025 -0800 Merge branch 'main' into schedule-button-status-logic commit 3b9120c Author: Josh Fung <[email protected]> Date: Fri Jan 31 12:42:24 2025 -0800 Implemented basic cover shift logic and re-rendering side panel commit 2a56827 Author: Josh Fung <[email protected]> Date: Tue Jan 28 20:24:07 2025 -0800 Implemented check in from frontend and refactored so details panel is re-rendered commit e9ff8bd Author: Josh Fung <[email protected]> Date: Sun Jan 26 19:21:24 2025 -0800 Created API endpoint and routes for shift check-in commit 4a03f0b Author: Josh Fung <[email protected]> Date: Sun Jan 26 17:29:46 2025 -0800 Corrected prioritization of user's coverage requests over user's shifts commit 822cf24 Author: Josh Fung <[email protected]> Date: Sun Jan 26 17:25:21 2025 -0800 Refactored to reuse fetchShifts() commit fe30e39 Author: Josh Fung <[email protected]> Date: Sun Jan 26 16:46:27 2025 -0800 Filter out duplicate shifts and prioritize showing coverage shifts over user's own shifts * Merge main into branch * fix main merge * updateUser error change
Overview
ShiftCards
are used in the volunteer dashboard. The buttons to check-in and cover are functional but clicking the card does not currently redirect the user to the Schedule pageI was manually testing it out to iron out bugs, but, please let me know if there are any issues that have slipped by!
Details About Different Cases
There a variety of cases based on the shift type and status. I'll try to be as verbose as possible to explain the different cases, but please let me know if there is anything missing!
Primary button refers to the button appearing on the shift card, which also appears as the first button in the details panel. Certain cases will result in additional buttons within the details panel.
Shift types are split into:
Volunteer's Own Shift
These shifts have the
SHIFT_TYPE
ofMY_SHIFTS
as defined inconstants.js
. The different cases are dependent on whether it's a past shift, a current shift, or a future shift.These shift cards will have a green bar. On the details panel, the status will say "My Shift."
If there is an associated shift coverage request, only the coverage request will be visible.
For past shifts:
For current shifts:
For future shifts:
Volunteer's Own Shift Coverage Requests
They have the
SHIFT_TYPE
ofMY_COVERAGE_REQUESTS
. They revolve aroundCOVERAGE_STATUSES
ofOPEN
ORRESOLVED
.These shift cards have a yellow bar. On the details panel, the status will say "Requested Coverage" or "Shift Filled."
For
OPEN
status:For
RESOLVED
status:Other Volunteer's Shift Coverage Requests
They have the
SHIFT_TYPE
ofCOVERAGE
. They revolve around theCOVERAGE_STATUSES
ofOPEN
,PENDING
, orRESOLVED
These shift cards have a red bar. The status in the details panel will either say "Needs Coverage" or "Requested to Cover".
For
OPEN
status:PENDING
For
PENDING
status:OPEN
status if pressedPENDING
status until an admin approves this shift coverage or the volunteer presses "Cancel"For
RESOLVED
status: