-
Notifications
You must be signed in to change notification settings - Fork 16
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: track + notify user signups #929
Conversation
part of a feature to keep track of users signing up for a specific launch time and: 1. getting notified via email when the lobby is open + how many signups are there / signed in users (still tbd) 2. visual indicator of number of total signups in that time slot refs virtualcommons/planning#63 Co-authored-by: Scott Foster <[email protected]> Co-authored-by: Sabrina Nelson <[email protected]>
primary key constraints ensure that the same user cannot sign up for the same date multiple times, otherwise we would need to check for this each time
adds a new service method tournament.getTournamentRoundSchedule which includes round date object ids, signup count, and whether the calling user is signed up in addition to just the timestamps when adding/removing a signup, this should be used to respond with the updated schedule to update the client state
* adds endpoints for adding and removing a 'sign up' for a certain round date which return an updated schedule object with the current amount of signups and state for the requesting user * adds a recurring job (at 30 min every hour) that checks for the existence of an upcoming round date and sends a reminder email to any players signed up for it
Co-authored-by: sgfost <[email protected]>
toggling checkbox makes the corresponding call (add/remove) to the server and then updates based on the new schedule state that the server responds with
currently works by showing a progress bar of the signup count over and adjusted average
Added an 'interest level' bar which should roughly show how many people are signed up for any given time-slot. Do you think its clear enough what's going on here @sabrinanel3? |
formalizing an assumption used in the implementation of launch reminders
8c2f5b9
to
4ccc972
Compare
* when retrieving signups for notification or counting for display, users with the "hasParticipated" flag in their invite are filtered out * trying to sign up for an invite when you have already participated throws an error * added signups 'popularity' threshold value to settings to use for diplaying interest level of each time-slot
still using a progress bar for ease of implementation but uses a configurable value for the max in order to (hopefully) more accurately indicate the likelihood that enough players are interested for a game to start color changes from orange to green when half of the threshold is met (5 for a full game if kept at the default 10) * reword signup label and explanation
2583d47
to
f3a15ac
Compare
handle null invite and give toggles a unique id so that clicking on a label toggles the correct one
* use one method with action param instead of two methods for the signup request * move all of the toggle css into a new component - should refactor this a bit if we ever use it again, might make more sense to use <b-form-checkbox switch> but fix the css
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, good work @sgfost! Will do a bit of minor refactoring and then merge.
googleInviteURL, | ||
icsInviteURL, | ||
}); | ||
} | ||
return grouped; | ||
} | ||
|
||
async handleSignupClicked(launchTime: LaunchTime) { |
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.
toggleSignup
might help convey the toggliness of this method more though I like handleSignupClicked
perfectly fine as well.
How about
await this.api.setSignup(..., launchTime.isSignedUp);
This pushes the add|remove
based on the value of the isSignedUp
boolean logic into the API method and better encapsulates API endpoint specific things
return false; | ||
} | ||
const beforeOffset = state.tournamentStatus.lobbyOpenBeforeOffset; | ||
const afterOffset = state.tournamentStatus.lobbyOpenAfterOffset; | ||
const nextLaunchTime = state.tournamentStatus.currentRound.schedule[0]; | ||
const nextLaunchTime = state.tournamentRoundSchedule[0].timestamp; |
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.
could use this.nextLaunchTime(state)
too? duplicates the tournamentRoundSchedule
length check though
</div> | ||
<p> | ||
<small> | ||
* We will send you an email reminder 30 minutes prior to launch. Signing up is not |
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.
How about shortening it to:
`Sign up for automated email reminders 30 minutes prior to launch and to help other players find good times to participate."
- rename to toggleSignup and have it perform toggly logic - change addOrRemoveSignup to setSignup(boolean, ...) with conditional logic dispatching to the appropriate endpoint
resolves virtualcommons/planning#63
resolves virtualcommons/planning#66