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
Confirmation refactor #214
Conversation
…lification of redirection logic #206
Hey y'all! A deployment of this PR can be found here: |
server/middleware.ts
Outdated
@@ -205,8 +205,9 @@ export function branchRedirector(requestType: ApplicationType): (request: expres | |||
response.redirect(`/confirm/${encodeURIComponent(user.confirmationBranch.toLowerCase())}`); | |||
return; | |||
} | |||
// TODO why is this !user.attending? | |||
if (questionBranches.indexOf(branchName.toLowerCase()) === -1 && !user.attending) { |
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.
@bunsenmcdubbs @petschekr Can you clarify why !user.attending
is here.
When we accept a user we assign them to a specific confirmation branch (and only one confirmation branch). Each confirmation branch is an option in the state dropdown. Instead of sending an acceptance email for the application branch, we send a pre-confirm email for the confirmation branch. This allows us to alter the message text for each branch. Waitlist/Rejected edge cases: Waitlist can operate as a normal confirmation branch if we have people confirm their spot on the waitlist. Rejected can be implemented by a simple no-op confirmation branch that does not require any user action (this is also necessary for supporting the walk-up feature). A flag on each branch can indicate if this confirmation represents "success" or "failure", for the purposes of ensuring we only check-in accepted students. The only reduction in functionality here is that users can no longer choose from multiple confirmation branch. In my opinion, this isn't necessary for us and only lead to confusion when different confirmation branches had different deadlines.
d929cb0
to
718422e
Compare
Fixes lowercase branch names crashing the server when navigating to the apply or confirm forms
server/middleware.ts
Outdated
@@ -229,7 +236,7 @@ export function branchRedirector(requestType: ApplicationType): (request: expres | |||
} | |||
} | |||
if (requestType === ApplicationType.Confirmation) { | |||
if (request.params.branch !== user.confirmationBranch ) { | |||
if (!user.accepted || branchName.toLowerCase() !== (user.confirmationBranch || "").toLowerCase()) { |
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.
@petschekr user.accepted
is not an indicator of if the user has been assigned a confirmation branch, it's better to check if user.confirmationBranch is defined.
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.
@ehsanmasdar Thanks for pointing that out. Does everything in 2e2bd7d make sense now with the distinction between confirmed and attending?
Fixes missing space in formatted application submission success message and removes "We look forward to seeing you" because the message is also shown for rejected applicants.
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.
@ehsanmasdar I made a bunch of small fixes to this PR. Could you please look them over before we merge this? Overall, this is great, resolves a ton of issues, makes the code more maintainable, and is simpler to use. Thanks!
- Scroll to top of page on successful submission - Properly slugify anonymous submission links in the admin panel - Set a title on branch names in the admin panel that might be truncated due to limited column width
Breaking API and UX changes for admins and users
@petschekr Your changes look good. I'd like to get this reviewed at least one more time considering the scope of changes, @kexin-zhang could you take a look. |
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.
Sorry for taking so long to get to this, but the changes look good to me and this is a huge improvement. Thanks y'all! Feel free to merge when ready
Confirmation refactor SEMVER-MAJOR
When we accept a user we assign them to a specific confirmation branch (and only one confirmation branch). Each confirmation branch is an option in the state dropdown.
Instead of sending an acceptance email for the application branch, we send a pre-confirm email for the confirmation branch. This allows us to alter the message text for each branch.
Waitlist/Rejected edge cases:
Waitlist can operate as a normal confirmation branch if we have users confirm their spot on the waitlist. Rejected can be implemented by a simple no-op confirmation branch that does not require any user action (this is also necessary for supporting the walk-up feature). A flag on each branch can indicate if this confirmation represents "success" or "failure", for the purposes of ensuring we only check-in accepted students.
The only reduction in functionality here is that users can no longer choose from multiple confirmation branch.
This PR implements the above changes. Some notes/other additions:
attending
is nowconfirmed
)accepted
.accepted
now simply indicates if the user has been assigned a confirmation branch that we define as anaccepted
branch. A user could, for example, confirm to the waitlist but not be accepted.a. Application branches no longer include a whitelist of confirmation branches
b. Application branch automation now configurably can automatically set a user's confirmation decision
c. Confirmation branches now have a flag to auto-confirm. This functions like a no-op, the user never recieves a post-confirm email and cannot edit/submit the branch.
d. Application branches no longer include a whitelist of confirmation branches
e. Refactor the search filters to fit this new model.
Fixes #110, fixes #117, fixes #150, fixes #156, fixes #206, fixes #208, fixes #209, fixes #211