-
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
dcc6918
schema(WIP): add many-to-many to track user signups
alee a896321
refactor: create explicit signups join table
sgfost fdf28ff
refactor: include more info in the schedule given to client
sgfost 929454b
feat: send emails to players signed up for launch times
sgfost 3bdd414
FEAT (WIP): Add date toggles for tournament
sabrinanel3 141329a
fix: connect signup toggle to server
sgfost 61a48bb
style: prettier
sgfost 1c32971
test: add coverage for signups/email reminders
sgfost af22f67
feat: add 'interest level' bar to round date listings
sgfost 4ccc972
fix: only allow dates to be scheduled on the hour from cli
sgfost b01fa89
fix: discount/disallow signups after participation
sgfost 8c41e0b
refactor: use a static threshold value for displaying signup counts
sgfost f3a15ac
refactor: clean up signups query
sgfost 89e5051
fix: vue warnings in schedule template
sgfost 98d638d
refactor: clean up client-side schedule component
sgfost 798a986
refactor: minor api refinement + hygiene
alee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<input v-bind="$attrs" v-on="$listeners" type="checkbox" class="toggle-input" /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Vue } from "vue-property-decorator"; | ||
|
||
@Component({ | ||
inheritAttrs: false, | ||
}) | ||
export default class Toggle extends Vue {} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.switch.square label .lever { | ||
width: 54px; | ||
height: 34px; | ||
border-radius: 0px; | ||
} | ||
.switch.square label .lever:after { | ||
width: 26px; | ||
height: 26px; | ||
border-radius: 0px; | ||
left: 4px; | ||
top: 4px; | ||
} | ||
|
||
.toggle-input { | ||
position: relative; | ||
appearance: none; | ||
width: 45px; /* Adjust the width as needed */ | ||
height: 25px; /* Adjust the height as needed */ | ||
background-color: #a49ca6; /* Background color when the toggle is off */ | ||
border-radius: 2px; /* Square corners */ | ||
cursor: pointer; | ||
outline: none; | ||
} | ||
|
||
.toggle-input:checked { | ||
background-color: rgb(95, 141, 75); /* Background color when the toggle is on */ | ||
} | ||
|
||
.toggle-input::before { | ||
content: ""; | ||
position: absolute; | ||
width: 20px; /* Width of the toggle button */ | ||
height: 20px; /* Height of the toggle button */ | ||
background-color: #fff; /* Color of the toggle button */ | ||
border-radius: 5%; /* Make it a rounded square*/ | ||
top: 3px; /* Adjust the vertical position */ | ||
left: 3px; /* Adjust the horizontal position */ | ||
transition: 0.3s; /* Transition for smooth animation */ | ||
} | ||
|
||
.toggle-input:checked::before { | ||
transform: translateX(20px); /* Move the toggle button to the right when checked */ | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,24 +207,26 @@ export default { | |
}, | ||
|
||
tournamentRoundHasUpcomingLaunch(state: State) { | ||
return !!state.tournamentStatus?.currentRound.schedule.length; | ||
return !!state.tournamentRoundSchedule?.length; | ||
}, | ||
|
||
tournamentSchedule(state: State) { | ||
return state.tournamentStatus?.currentRound.schedule; | ||
return state.tournamentRoundSchedule; | ||
}, | ||
|
||
nextLaunchTime(state: State) { | ||
return state.tournamentStatus?.currentRound.schedule[0]; | ||
if (state.tournamentRoundSchedule?.length) { | ||
return state.tournamentRoundSchedule[0].timestamp; | ||
} | ||
}, | ||
|
||
isTournamentLobbyOpen(state: State) { | ||
if (!state.tournamentStatus) { | ||
if (!state.tournamentStatus || !state.tournamentRoundSchedule?.length) { | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. could use |
||
const timeNow = new Date().getTime(); | ||
return timeNow >= nextLaunchTime - beforeOffset && timeNow <= nextLaunchTime + afterOffset; | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 likehandleSignupClicked
perfectly fine as well.How about
await this.api.setSignup(..., launchTime.isSignedUp);
This pushes the
add|remove
based on the value of theisSignedUp
boolean logic into the API method and better encapsulates API endpoint specific things