-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
feat: Add admin manual CheckInReady toggle #1448
feat: Add admin manual CheckInReady toggle #1448
Conversation
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes.
|
@@ -36,7 +36,7 @@ const EditProject = ({ | |||
recurringEvents | |||
// eslint-disable-next-line no-underscore-dangle | |||
.filter((e) => e?.project?._id === projectToEdit._id) | |||
.map((item) => readableEvent(item)) | |||
.map((item) => ({...item, ...readableEvent(item)})) |
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.
This change is allows checkInReady
to be passed via props
|
||
return ( | ||
<li key={`${event.event_id}`}> | ||
<button type="button" onClick={() => {console.log(event);setSelectedEvent(event)}}> |
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.
setSelectedEvent
designates which event should be editable in the modal rendered by <EditMeetingTimes />
and passes on all the event
values.
@@ -15,6 +15,7 @@ const EditableMeeting = ({ | |||
handleEventDelete, | |||
formErrors, | |||
videoConferenceLink = '', | |||
checkInReady, |
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.
Ensures checkInReady
is destructed off of props
onClick={handleEventUpdate(eventId, {checkInReady: !checkInReady})} | ||
> | ||
ToggleCheckIn({!checkInReady ? "Yes" : "No"}) | ||
</button> |
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.
handleEventUpdate()
takes an evendId
, a values
object, and two other props unused here.
The values
object is passed an obj with the opposite of checkInReady
, and sent to the db updater fuction.
checkInReady: values.checkInReady, | ||
}; | ||
} | ||
|
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.
This section updates handleEventUpdate()
in the same style as the original function, allowing minimal change for us to update checkInReady
in the db.
@spiteless your changes do successfully update the associated I refactored the home page a few months ago and left it hitting One thing to keep in mind is that if you manually flip it to Line 21 in 224433a
|
This might not be a good idea since the workers only automate the open and close of |
@@ -207,4 +198,21 @@ const EditProject = ({ | |||
); | |||
}; | |||
|
|||
function RecurringEvent({event, setSelectedEvent}) { | |||
|
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.
Small nit: remove empty line
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.
LGTM! Other perspectives welcome
@evanyang1 how did you test that users would be able to check into meetings that are manually flipped? am i misunderstanding the goal for this PR? |
{`${event.dayOfTheWeek}, ${event.startTime} - ${event.endTime}; ${event.eventType}`} | ||
<div className="edit-icon"><EditIcon /></div> | ||
</div> | ||
<div className="event-list-description">{`Can uses check into this event now?: ${event.checkInReady ? "Yes" : "No"}`}</div> |
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.
check spelling
565ef6e
to
ab50a6e
Compare
Updated this commit |
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.
@spiteless hey man well done figuring this one out! 🍻
The feature works as expected, but in the process of testing I discovered that duplicate events are sneaking into the test db
Luckily, it doesn't appear as though there are duplicate events in the prod db
Therefore, I believe your PR will successfully provide PMs with the ability to manually flip the event to checkInReady: true
Fixes #1447
What changes did you make and why did you make them ?
Screenshots of Proposed Changes Of The Website
Visuals before changes side by side