From 592ec5fefd812af155d5c4b0aec27493a9aa8a40 Mon Sep 17 00:00:00 2001 From: Gabriel Ting Date: Tue, 30 Jun 2020 14:32:26 -0500 Subject: [PATCH 1/6] Templatize custom strings in strings.json across application (#646) * Centralize custom strings in client to strings.json * Make redirect on unsubscribe templatized * Fix typo in Announcement * Rename application_status.svg --- ..._incomplete.svg => application_status.svg} | 0 src/client/assets/strings.json | 25 +++++---- src/client/components/Sidebar/Sidebar.tsx | 2 +- .../{Announcment.tsx => Announcement.tsx} | 0 src/client/routes/dashboard/HackerDash.tsx | 55 ++++++++++--------- .../routes/manageSponsor/CreateSponsor.tsx | 15 ++--- src/client/routes/team/Team.tsx | 4 +- src/server/mail/handlers.ts | 3 +- 8 files changed, 56 insertions(+), 48 deletions(-) rename src/client/assets/img/{application_incomplete.svg => application_status.svg} (100%) rename src/client/components/Text/{Announcment.tsx => Announcement.tsx} (100%) diff --git a/src/client/assets/img/application_incomplete.svg b/src/client/assets/img/application_status.svg similarity index 100% rename from src/client/assets/img/application_incomplete.svg rename to src/client/assets/img/application_status.svg diff --git a/src/client/assets/strings.json b/src/client/assets/strings.json index 44e967ed3..b2fa56c09 100644 --- a/src/client/assets/strings.json +++ b/src/client/assets/strings.json @@ -1,8 +1,12 @@ { "FULL_NAME": "VandyHacks VI", "HACKATHON_TITLE": "VandyHacks VI", + "SHORTENED_HACKATHON_TITLE": "VH", + "HACKATHON_WEBSITE": "https://vandyhacks.org", "WEBSITE_HTML_TITLE": "VandyHacks VI Application Portal", "DEADLINE": "October 30th, 2019 at 11:59pm (CDT)", + "START_DAY": "November. 1st", + "START_DAY_SHORT": "Nov. 1st", "DARK_TEXT_COLOR": "#3f3356", "DARKEST_TEXT_COLOR": "#1A051D", "BASE_COLOR": "#B1D0FE", @@ -12,21 +16,20 @@ "LIGHT_TEXT_COLOR": "#D0C9D6", "SQUARE_LOGO_ALT_TEXT": "VH Logo", "HACKER_DASHBOARD_HEADER_TEXT": "Your application status:", - "HACKER_TEAMS_ANNOUNCMENT_TEXT": "Create a new team or join an existing one for the weekend! Due to prize arrangments, the maximum number of hackers per team is 4.\n\nThere will also be opportunities at the event to form teams.", + "HACKER_TEAMS_ANNOUNCEMENT_TEXT": "Create a new team or join an existing one for the weekend! Due to prize arrangements, the maximum number of hackers per team is 4.\n\nThere will also be opportunities at the event to form teams.", "HACKER_TEAMS_FOOTER_TEXT": "You can join and leave a team at any time.", + "APPLICATION_STATUS_SVG_ALT_TEXT": "Pink VH 8-bit computer", "GRAPHQL_ORGANIZER_ERROR_MESSAGE": "There was a problem.\nPlease contact your dev team.", "GRAPHQL_HACKER_ERROR_MESSAGE": "There was a problem.\nPlease contact help@vandyhacks.org.", "HELP_TEXT": "Please contact us at info@vandyhacks.org with any questions or concerns, and we'd be happy to help you!", "HELP_EMAIL": "info@vandyhacks.org", - "COLOR_PALETTE": [ - "#D0C9D6", - "#DBA5F5", - "#FFC7A6", - "#FFE29D", - "#7DDFC3", - "#A5AFFB", - "#FDAFBB" - ], + "COLOR_PALETTE": ["#D0C9D6", "#DBA5F5", "#FFC7A6", "#FFE29D", "#7DDFC3", "#A5AFFB", "#FDAFBB"], + "APPLICATION_INCOMPLETE_STATUSBG": "#FBE4E8", + "APPLICATION_INCOMPLETE_STATUSCOLOR": "#FF647C", + "APPLICATION_COMPLETE_STATUSBG": "#D5F2EA", + "APPLICATION_COMPLETE_STATUSCOLOR": "hsl(163.4,52.7%,35%)", + "APPLICATION_DECLINED_STATUSBG": "#9C9C9C", + "APPLICATION_DECLINED_STATUSCOLOR": "#FFFFFF", "TEXT_AREA_MAX_LENGTH": 1500, "INPUT_MAX_LENGTH": 100, "SENTRY_URL": "https://70347d4c70054bdbafe6cf9a5be5a530@sentry.io/1769889", @@ -34,4 +37,4 @@ "PERMISSIONS_HACKER_TABLE": "hackertable", "PERMISSIONS_RESUME": "resume", "PERMISSIONS_NFC": "nfc" -} \ No newline at end of file +} diff --git a/src/client/components/Sidebar/Sidebar.tsx b/src/client/components/Sidebar/Sidebar.tsx index 694e115cb..f213f92f6 100644 --- a/src/client/components/Sidebar/Sidebar.tsx +++ b/src/client/components/Sidebar/Sidebar.tsx @@ -130,7 +130,7 @@ const Sidebar: FC<{ setMenuOpen?: React.Dispatch> - VH graphic + {`${STRINGS.SHORTENED_HACKATHON_TITLE} diff --git a/src/client/components/Text/Announcment.tsx b/src/client/components/Text/Announcement.tsx similarity index 100% rename from src/client/components/Text/Announcment.tsx rename to src/client/components/Text/Announcement.tsx diff --git a/src/client/routes/dashboard/HackerDash.tsx b/src/client/routes/dashboard/HackerDash.tsx index 74c625fba..bcdc94491 100644 --- a/src/client/routes/dashboard/HackerDash.tsx +++ b/src/client/routes/dashboard/HackerDash.tsx @@ -6,7 +6,7 @@ import { FlexColumn, FlexStartColumn } from '../../components/Containers/FlexCon import { Title } from '../../components/Text/Title'; import STRINGS from '../../assets/strings.json'; import { ButtonOutline, CenterButtonText } from '../../components/Buttons/Buttons'; -import applicationIncompleteSVG from '../../assets/img/application_incomplete.svg'; +import applicationStatusSVG from '../../assets/img/application_status.svg'; import { SmallCenteredText } from '../../components/Text/SmallCenteredText'; import { ApplicationStatus, @@ -26,10 +26,10 @@ const statusConfig = { }, ], boldText: "You haven't started your application yet.", - img: applicationIncompleteSVG, + img: applicationStatusSVG, status: 'Not Started', - statusBG: '#FBE4E8', - statusColor: '#FF647C', + statusBG: STRINGS.APPLICATION_INCOMPLETE_STATUSBG, + statusColor: STRINGS.APPLICATION_INCOMPLETE_STATUSCOLOR, text: `The deadline is ${STRINGS.DEADLINE}`, }, [ApplicationStatus.Started]: { @@ -40,10 +40,10 @@ const statusConfig = { }, ], boldText: 'You still need to finish your application.', - img: applicationIncompleteSVG, + img: applicationStatusSVG, status: 'Incomplete', - statusBG: '#FBE4E8', - statusColor: '#FF647C', + statusBG: STRINGS.APPLICATION_INCOMPLETE_STATUSBG, + statusColor: STRINGS.APPLICATION_INCOMPLETE_STATUSCOLOR, text: `The deadline is ${STRINGS.DEADLINE}`, }, [ApplicationStatus.Submitted]: { @@ -54,19 +54,19 @@ const statusConfig = { }, ], boldText: "Thanks for applying! We'll get back to you with a decision shortly.", - img: applicationIncompleteSVG, + img: applicationStatusSVG, status: 'Submitted', - statusBG: '#D5F2EA', - statusColor: 'hsl(163.4,52.7%,35%)', + statusBG: STRINGS.APPLICATION_COMPLETE_STATUSBG, + statusColor: STRINGS.APPLICATION_COMPLETE_STATUSCOLOR, text: "You may update your responses at any time by re-visiting the application.'", }, [ApplicationStatus.Confirmed]: { actions: [], - boldText: "Whoo hoo! We'll see you Nov. 1st!", - img: applicationIncompleteSVG, + boldText: `Whoo hoo! We'll see you ${STRINGS.START_DAY}!`, + img: applicationStatusSVG, status: 'Confirmed', - statusBG: '#D5F2EA', - statusColor: 'hsl(163.4,52.7%,35%)', + statusBG: STRINGS.APPLICATION_COMPLETE_STATUSBG, + statusColor: STRINGS.APPLICATION_COMPLETE_STATUSCOLOR, text: "If you don't have a team, you can form one when you get here!", }, [ApplicationStatus.Accepted]: { @@ -81,28 +81,28 @@ const statusConfig = { }, ], boldText: "You've been accepted!", - img: applicationIncompleteSVG, + img: applicationStatusSVG, status: 'Accepted', - statusBG: '#D5F2EA', - statusColor: 'hsl(163.4,52.7%,35%)', + statusBG: STRINGS.APPLICATION_COMPLETE_STATUSBG, + statusColor: STRINGS.APPLICATION_COMPLETE_STATUSCOLOR, text: "Confirm your spot to let us know you'll be coming", }, [ApplicationStatus.Declined]: { actions: [], boldText: "You've declined.", - img: applicationIncompleteSVG, + img: applicationStatusSVG, status: 'Declined', - statusBG: '#9C9C9C', - statusColor: '#FFFFFF', - text: ' Changed your mind? Email info@vandyhacks.org', + statusBG: STRINGS.APPLICATION_DECLINED_STATUSBG, + statusColor: STRINGS.APPLICATION_DECLINED_STATUSCOLOR, + text: `Changed your mind? Email ${STRINGS.HELP_EMAIL}`, }, [ApplicationStatus.Rejected]: { actions: [], boldText: "Unfortunately, we couldn't offer you a spot this year :(", - img: applicationIncompleteSVG, + img: applicationStatusSVG, status: 'Denied', - statusBG: '#FBE4E8', - statusColor: '#FF647C', + statusBG: STRINGS.APPLICATION_INCOMPLETE_STATUSBG, + statusColor: STRINGS.APPLICATION_INCOMPLETE_STATUSCOLOR, text: '', }, }; @@ -183,9 +183,12 @@ export const HackerDash: FunctionComponent = (): JSX.Element => { Man wearing hoodie at holographic computer - + {statusInfo.boldText}
{statusInfo.text} diff --git a/src/client/routes/manageSponsor/CreateSponsor.tsx b/src/client/routes/manageSponsor/CreateSponsor.tsx index d0e26f9b6..4318a87a3 100644 --- a/src/client/routes/manageSponsor/CreateSponsor.tsx +++ b/src/client/routes/manageSponsor/CreateSponsor.tsx @@ -13,6 +13,7 @@ import { useTiersQuery, } from '../../generated/graphql'; import Spinner from '../../components/Loading/Spinner'; +import STRINGS from '../../assets/strings.json'; const EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; @@ -53,11 +54,11 @@ const CreateCompany: React.FunctionComponent = (): JSX.Element => { const onCreateCompany = async (): Promise => { try { createCompany().catch(res => { - setCreateCompanyMsg(`Sorry. ${res.graphQLErrors[0].message} Try again :-)`); + setCreateCompanyMsg(`Sorry. ${res.graphQLErrors[0].message} Please try again :-)`); }); } catch (err) { console.error(err); - setCreateCompanyMsg(`Sorry. Something bad happens.`); + setCreateCompanyMsg(STRINGS.GRAPHQL_ORGANIZER_ERROR_MESSAGE); } }; @@ -89,7 +90,7 @@ const CreateCompany: React.FunctionComponent = (): JSX.Element => {

Create

- + {createCompanyMsg} @@ -108,11 +109,11 @@ const CreateTier: React.FunctionComponent = (): JSX.Element => { const onCreateTier = async (): Promise => { try { createTier().catch(res => { - setCreateTierMsg(`Sorry. ${res.graphQLErrors[0].message} Try again :-)`); + setCreateTierMsg(`Sorry. ${res.graphQLErrors[0].message} Please try again :-)`); }); } catch (err) { console.error(err); - setCreateTierMsg(`Sorry. Something bad happens.`); + setCreateTierMsg(STRINGS.GRAPHQL_ORGANIZER_ERROR_MESSAGE); } }; @@ -163,13 +164,13 @@ const CreateSponsor: React.FunctionComponent = (): JSX.Element => { console.log(sponsorEmail); console.log(sponsorName); createSponsor().catch(res => { - setCreateSponsorMsg(`Sorry. ${res.graphQLErrors[0].message} Try again :-)`); + setCreateSponsorMsg(`Sorry. ${res.graphQLErrors[0].message} Please try again :-)`); }); // create sponsor in the database // already created or not } catch (err) { console.error(err); - setCreateSponsorMsg(`Sorry. Something bad happens.`); + setCreateSponsorMsg(STRINGS.GRAPHQL_ORGANIZER_ERROR_MESSAGE); } } else { setCreateSponsorMsg(`Email '${sponsorEmail}' is not valid when creating sponsor`); diff --git a/src/client/routes/team/Team.tsx b/src/client/routes/team/Team.tsx index 0e2697f31..e682367bd 100644 --- a/src/client/routes/team/Team.tsx +++ b/src/client/routes/team/Team.tsx @@ -3,7 +3,7 @@ import FloatingPopup from '../../components/Containers/FloatingPopup'; import { JoinTeam } from './JoinTeam'; import { ViewTeam } from './ViewTeam'; import { FlexColumn } from '../../components/Containers/FlexContainers'; -import Announcment from '../../components/Text/Announcment'; +import { Announcement } from '../../components/Text/Announcement'; import STRINGS from '../../assets/strings.json'; import { GraphQLErrorMessage } from '../../components/Text/ErrorMessage'; import Spinner from '../../components/Loading/Spinner'; @@ -23,7 +23,7 @@ export const Team: FC = () => { return ( - + {!team || !team.name ? : } diff --git a/src/server/mail/handlers.ts b/src/server/mail/handlers.ts index 119496db0..184f7c6e2 100644 --- a/src/server/mail/handlers.ts +++ b/src/server/mail/handlers.ts @@ -2,6 +2,7 @@ import { RequestHandler } from 'express'; import { ObjectID } from 'mongodb'; import { Models } from '../models'; import logger from '../logger'; +import STRINGS from '../../client/assets/strings.json'; export const UnsubscribeHandler = (models: Models): RequestHandler => { return async (req, res) => { @@ -13,7 +14,7 @@ export const UnsubscribeHandler = (models: Models): RequestHandler => { ) .then(response => { logger.info('Unsubscribed user from emails', response); - return res.redirect(301, 'https://vandyhacks.org'); + return res.redirect(301, STRINGS.HACKATHON_WEBSITE); }) .catch(logger.error); } else { From 833254ea6b7ded4f914d48818e4fa24f45d48d51 Mon Sep 17 00:00:00 2001 From: Aadi Bajpai Date: Mon, 10 Aug 2020 05:45:05 +0530 Subject: [PATCH 2/6] Fix GitHub capitalization in README.md (#667) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45714c7e4..e3d657e6e 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ A next-gen hackathon registration system. ### Login Page ![Login Page](./pics/vaken1.png) - - supports Github, Google, and Microsoft SSO logins + - supports GitHub, Google, and Microsoft SSO logins ### Detailed Hacker Management for Organizers ![Organizer Page](./pics/vaken-org.png) From 49448df86d1a7a31c53d5173d940a4db6dea8049 Mon Sep 17 00:00:00 2001 From: Gabriel Ting Date: Thu, 20 Aug 2020 18:09:21 -0500 Subject: [PATCH 3/6] Default emails and strings to virtual context (#663) * Modify application to prepare for VH2020 summer * Fix minor bugs and update title string * Add 2024 as grad year option * Add button on login screen to redirect to summer.vh website (#631) * add button linking to summervh * Fix linting and testing errors Co-authored-by: Gabriel Ting * Make summer link open in new tab * Update email templates for vh summer edition 2020 (#636) * update application deadline (#641) * add summer hackathon waiver (#639) * add summer hackathon waiver * Add waiver as required field Co-authored-by: Gabriel Ting * Add sentence about hackathon waiver (#643) * add sentence about hackathon waiver * Change waiver wording * Change waiver wording Co-authored-by: Gabriel Ting Co-authored-by: Baibhav Vatsa --- .../components/Sidebar/Sidebar.test.tsx.snap | 2 +- .../routes/dashboard/Frame.test.tsx.snap | 2 +- .../client/routes/login/Login.test.tsx.snap | 40 ++-- .../routes/profile/Profile.test.tsx.snap | 2 +- package.json | 1 + src/client/assets/application.js | 175 +++++++++--------- src/client/assets/strings.json | 12 +- src/client/routes/login/Login.tsx | 12 +- src/client/routes/profile/ProfileConfig.ts | 32 ++-- src/server/auth/index.test.ts | 103 +++++------ src/server/mail/templates/accepted.ts | 92 ++++++--- src/server/mail/templates/confirmed.ts | 44 +++-- src/server/mail/templates/submitted.ts | 43 +++-- src/server/plugins.ts | 2 - src/server/resolvers/index.ts | 14 +- 15 files changed, 317 insertions(+), 259 deletions(-) diff --git a/__snapshots__/client/components/Sidebar/Sidebar.test.tsx.snap b/__snapshots__/client/components/Sidebar/Sidebar.test.tsx.snap index d5e764e60..376097aeb 100644 --- a/__snapshots__/client/components/Sidebar/Sidebar.test.tsx.snap +++ b/__snapshots__/client/components/Sidebar/Sidebar.test.tsx.snap @@ -104,7 +104,7 @@ exports[`Test Sidebar Sidebar renders correctly 1`] = `

- VandyHacks VI + VandyHacks: Summer Edition

diff --git a/__snapshots__/client/routes/dashboard/Frame.test.tsx.snap b/__snapshots__/client/routes/dashboard/Frame.test.tsx.snap index 76a19fe43..5242afd52 100644 --- a/__snapshots__/client/routes/dashboard/Frame.test.tsx.snap +++ b/__snapshots__/client/routes/dashboard/Frame.test.tsx.snap @@ -140,7 +140,7 @@ exports[`Test Frame Frame renders correctly 1`] = `

- VandyHacks VI + VandyHacks: Summer Edition

diff --git a/__snapshots__/client/routes/login/Login.test.tsx.snap b/__snapshots__/client/routes/login/Login.test.tsx.snap index 9fd25f8a1..307cc9ec6 100644 --- a/__snapshots__/client/routes/login/Login.test.tsx.snap +++ b/__snapshots__/client/routes/login/Login.test.tsx.snap @@ -5,18 +5,18 @@ exports[`Login renders properly 1`] = ` className="sc-fznZeY gnTxhM" >

- VandyHacks VI + VandyHacks: Summer Edition

GitHub logo @@ -40,12 +40,12 @@ exports[`Login renders properly 1`] = `
- Sign in with GitHub + Sign in with Google
Google logo @@ -69,36 +69,28 @@ exports[`Login renders properly 1`] = `
- Sign in with Google + Sign in with GitHub
diff --git a/__snapshots__/client/routes/profile/Profile.test.tsx.snap b/__snapshots__/client/routes/profile/Profile.test.tsx.snap index 620bca50a..008d72f00 100644 --- a/__snapshots__/client/routes/profile/Profile.test.tsx.snap +++ b/__snapshots__/client/routes/profile/Profile.test.tsx.snap @@ -10,7 +10,7 @@ exports[`Test Profile renders correctly 1`] = ` className="sc-fzqBkg dovGdd" >
VandyHacks: Summer Edition Waiver', + ], + title: 'Summer Hackathon Waiver', + }, { Component: CheckboxSansTitleCase, fieldName: 'infoSharingConsent', @@ -176,56 +184,57 @@ export const questions = [ ], title: 'Hacker Application', }, - { - category: 'travel', - fields: [ - { - Component: Boolean, - fieldName: 'reimbursementRequired', - note: "Answering 'Yes' here does not guarantee any reimbursement", - optional: true, - title: 'Do you require travel reimbursement to get to VandyHacks?', - }, - { - Component: Boolean, - fieldName: 'travelInfoSharingConsent', - note: 'Information will be shared to facilitate carpooling', - optional: true, - title: 'May we share your name and email with others coming from your school/city?', - }, - { - Component: Slider, - fieldName: 'transportationMode', - optional: true, - options: ['Car', 'Bus', 'Plane', 'Blimp'], - title: 'How do you plan on getting to VandyHacks?', - }, - { - Component: Boolean, - fieldName: 'travelAdmissionConsent', - note: "Please acknowledge this by clicking 'Yes'", - optional: true, - title: - 'If you are purchasing a non-refundable ticket for long distance travel, we can offer guaranteed admission if you email info@vandyhacks.org along with a request and a receipt for your travel.', - }, - ], - title: 'Travel Reimbursement', - }, + // { + // category: 'travel', + // fields: [ + // { + // Component: Boolean, + // fieldName: 'reimbursementRequired', + // note: "Answering 'Yes' here does not guarantee any reimbursement", + // optional: true, + // title: 'Do you require travel reimbursement to get to VandyHacks?', + // }, + // { + // Component: Boolean, + // fieldName: 'travelInfoSharingConsent', + // note: 'Information will be shared to facilitate carpooling', + // optional: true, + // title: 'May we share your name and email with others coming from your school/city?', + // }, + // { + // Component: Slider, + // fieldName: 'transportationMode', + // optional: true, + // options: ['Car', 'Bus', 'Plane', 'Blimp'], + // title: 'How do you plan on getting to VandyHacks?', + // }, + // { + // Component: Boolean, + // fieldName: 'travelAdmissionConsent', + // note: "Please acknowledge this by clicking 'Yes'", + // optional: true, + // title: + // 'If you are purchasing a non-refundable ticket for long distance travel, we can offer guaranteed admission if you email info@vandyhacks.org along with a request and a receipt for your travel.', + // }, + // ], + // title: 'Travel Reimbursement', + // }, ]; export const requiredFields = [ 'firstName', 'lastName', - 'shirtSize', + // 'shirtSize', 'phoneNumber', 'dateOfBirth', 'school', 'major', 'graduationYear', 'race', - 'essay1', - 'volunteer', + // 'essay1', + // 'volunteer', 'consent', + 'summerHackathonWaiver', ]; export default questions; diff --git a/src/client/assets/strings.json b/src/client/assets/strings.json index b2fa56c09..dd2fea059 100644 --- a/src/client/assets/strings.json +++ b/src/client/assets/strings.json @@ -1,12 +1,12 @@ { - "FULL_NAME": "VandyHacks VI", - "HACKATHON_TITLE": "VandyHacks VI", + "FULL_NAME": "VandyHacks: Summer Edition", + "HACKATHON_TITLE": "VandyHacks: Summer Edition", + "WEBSITE_HTML_TITLE": "VandyHacks Application Portal", + "DEADLINE": "July 10, 2020 at 6:00pm (CST)", "SHORTENED_HACKATHON_TITLE": "VH", "HACKATHON_WEBSITE": "https://vandyhacks.org", - "WEBSITE_HTML_TITLE": "VandyHacks VI Application Portal", - "DEADLINE": "October 30th, 2019 at 11:59pm (CDT)", - "START_DAY": "November. 1st", - "START_DAY_SHORT": "Nov. 1st", + "START_DAY": "July 10th", + "START_DAY_SHORT": "July 10th", "DARK_TEXT_COLOR": "#3f3356", "DARKEST_TEXT_COLOR": "#1A051D", "BASE_COLOR": "#B1D0FE", diff --git a/src/client/routes/login/Login.tsx b/src/client/routes/login/Login.tsx index 4f2106e35..8c878c3e6 100644 --- a/src/client/routes/login/Login.tsx +++ b/src/client/routes/login/Login.tsx @@ -3,6 +3,7 @@ import STRINGS from '../../assets/strings.json'; import bg from '../../assets/img/login_bg.jpg'; import OAuthLogin from './OAuthLogin'; import Background from '../../components/Containers/Background'; +import TextButton from '../../components/Buttons/TextButton'; import FloatingPopup from '../../components/Containers/FloatingPopup'; import { Title } from '../../components/Text/Title'; @@ -10,8 +11,17 @@ const LoginPage: FunctionComponent = (): JSX.Element => ( <> - {STRINGS.FULL_NAME} + + {STRINGS.FULL_NAME} + + + Learn more + diff --git a/src/client/routes/profile/ProfileConfig.ts b/src/client/routes/profile/ProfileConfig.ts index d55c62085..f2f86584c 100644 --- a/src/client/routes/profile/ProfileConfig.ts +++ b/src/client/routes/profile/ProfileConfig.ts @@ -57,22 +57,22 @@ export const profile = [ sortOrder: 5, title: 'Gender', }, - { - Component: Checkbox, - fieldName: 'dietaryRestrictions', - optional: true, - options: [ - DietaryRestriction.GlutenFree, - DietaryRestriction.Vegetarian, - DietaryRestriction.Vegan, - DietaryRestriction.LactoseAllergy, - DietaryRestriction.NutAllergy, - DietaryRestriction.Halal, - DietaryRestriction.Kosher, - ], - sortOrder: 6, - title: 'Dietary Restrictions', - }, + // { + // Component: Checkbox, + // fieldName: 'dietaryRestrictions', + // optional: true, + // options: [ + // DietaryRestriction.GlutenFree, + // DietaryRestriction.Vegetarian, + // DietaryRestriction.Vegan, + // DietaryRestriction.LactoseAllergy, + // DietaryRestriction.NutAllergy, + // DietaryRestriction.Halal, + // DietaryRestriction.Kosher, + // ], + // sortOrder: 6, + // title: 'Dietary Restrictions', + // }, ]; export default profile; diff --git a/src/server/auth/index.test.ts b/src/server/auth/index.test.ts index 4049f25d1..cfe32f2be 100644 --- a/src/server/auth/index.test.ts +++ b/src/server/auth/index.test.ts @@ -6,63 +6,46 @@ import { authPlugins } from '../plugins'; const app = Express(); registerAuthRoutes(app, authPlugins); -// describe('Test auth/index.ts', () => { -// describe('registerAuthRoutes', () => { -// it('registers /api/auth/google', async () => { -// expect( -// app._router.stack.some( -// (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/google' -// ) -// ).toBeTruthy(); -// }); - -// it('registers /api/auth/google/callback', async () => { -// expect( -// app._router.stack.some( -// (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/google/callback' -// ) -// ).toBeTruthy(); -// }); - -// it('registers /api/auth/github', async () => { -// expect( -// app._router.stack.some( -// (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/github' -// ) -// ).toBeTruthy(); -// }); - -// it('registers /api/auth/github/callback', async () => { -// expect( -// app._router.stack.some( -// (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/github/callback' -// ) -// ).toBeTruthy(); -// }); - -// it('registers /api/auth/microsoft', async () => { -// expect( -// app._router.stack.some( -// (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/microsoft' -// ) -// ).toBeTruthy(); -// }); - -// it('registers /api/auth/microsoft/callback', async () => { -// expect( -// app._router.stack.some( -// (r: { route: Express.IRoute }) => -// r.route && r.route.path === '/api/auth/microsoft/callback' -// ) -// ).toBeTruthy(); -// }); - -// it('registers /api/logout', async () => { -// expect( -// app._router.stack.some( -// (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/logout' -// ) -// ).toBeTruthy(); -// }); -// }); -// }); +describe('Test auth/index.ts', () => { + describe('registerAuthRoutes', () => { + it('registers /api/auth/google', async () => { + expect( + app._router.stack.some( + (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/google' + ) + ).toBeTruthy(); + }); + + it('registers /api/auth/google/callback', async () => { + expect( + app._router.stack.some( + (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/google/callback' + ) + ).toBeTruthy(); + }); + + it('registers /api/auth/github', async () => { + expect( + app._router.stack.some( + (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/github' + ) + ).toBeTruthy(); + }); + + it('registers /api/auth/github/callback', async () => { + expect( + app._router.stack.some( + (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/auth/github/callback' + ) + ).toBeTruthy(); + }); + + it('registers /api/logout', async () => { + expect( + app._router.stack.some( + (r: { route: Express.IRoute }) => r.route && r.route.path === '/api/logout' + ) + ).toBeTruthy(); + }); + }); +}); diff --git a/src/server/mail/templates/accepted.ts b/src/server/mail/templates/accepted.ts index 5765707cb..eed8d1fe9 100644 --- a/src/server/mail/templates/accepted.ts +++ b/src/server/mail/templates/accepted.ts @@ -194,11 +194,11 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ - +
+
- + -
@@ -255,44 +255,84 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ - - + +
-
Hey ${escape( +
Hi ${escape( user.preferredName || user.firstName )}!
-
Congratulations! We want you to be a part of VandyHacks VI: Art Edition!
+
+ Congratulations! You’re invited to be a part of VandyHacks: Summer Edition! We enjoyed reading your application and would love to see your ideas come to life during our virtual event on July 10th-12th! +
-
We were impressed with your application–your experience, motivation, and aspirations inspired us. We would love to invite you to come to VandyHacks VI from November 1st-3rd to code a masterpiece with us!
+
+ Head over to the application portal here and confirm your attendance by July 10th, 6:00 PM CST. + Please make sure you’ve read and checked “agree” to our hackathon waiver in the “Apply” section. +
-
Please confirm your attendance at VandyHacks VI: Art Edition by revisiting our application portal before 10/25.
-
+
+ Finally, please make sure to do the following in preparation for + the event: +
    +
  • + Join our Discord + here + for communication before, during, and after the hackathon! +
  • +
  • + Review the full hackathon schedule + here! +
  • +
  • + *NOTE: We will be baking actual lemon bars at 10:00 PM CST + on Friday, July 10th, so get your ingredients ready! +
  • +
+
+
-
If you are interested in reserving a spot on one of our buses, please rsvp for the buses by following the instructions in our bus guide.
+
+ If you have any questions or concerns, check out our FAQ or reach out to us at info@vandyhacks.org. +
-
In the meantime, like our page on Facebook, follow us on Instagram, and keep up to date with our Twitter for more details and exciting updates!
+
+ Cheers, +
-
Happy Hacking!
+
+ The VandyHacks Team +
-
The VandyHacks Team
+
+ P.S. And of course, make sure to stay up-to-date by following us on Instagram and checking out our Facebook Event +
@@ -448,15 +488,17 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ -
You are receiving this application update because you applied at apply.vandyhacks.org. If you would like to opt-out of - any future emails pertaining to VandyHacks VI applications, please click + You are receiving this application update because you applied at apply.vandyhacks.org. + If you would like to opt-out of + any future emails pertaining to VandyHacks applications, please click here
-
© 2019 VandyHacks, All Rights Reserved.
+
© 2020 VandyHacks, All Rights Reserved.
@@ -589,13 +631,15 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ Text: { Charset: 'UTF-8', Data: `Hey ${escape(user.preferredName || user.firstName)}, -Congratulations! We want you to be a part of VandyHacks VI: Art Edition! -We were impressed with your application–your experience, motivation, and aspirations inspired us. We would love to invite you to come to VandyHacks VI from November 1st-3rd to code a masterpiece with us! -Please confirm your attendance at VandyHacks VI: Art Edition by revisiting our application portal before 10/25. -If you are interested in reserving a spot on one of our buses, please rsvp for the buses by following the instructions in our bus guide. -In the meantime, like our page on Facebook, follow us on Instagram, and keep up to date with our Twitter for more details and exciting updates! -Happy Hacking! -The VandyHacks Team`, + Congratulations! You’re invited to be a part of VandyHacks: Summer Edition! We enjoyed reading your application and would love to see your ideas come to life during our virtual event on July 10th-12th! + Head over to the application portal here and confirm your attendance by July 10th, 6:00 PM CST. Please make sure you’ve read and checked “agree” to our hackathon waiver in the “Apply” section. + Finally, please make sure to do the following in preparation for the event: + Join our Discord here for communication before, during, and after the hackathon! + Review the full hackathon schedule here! + *NOTE: We will be baking actual lemon bars at 10:00 PM CST on Friday, July 10th, so get your ingredients ready! + If you have any questions or concerns, check out our FAQ or reach out to us at info@vandyhacks.org. + Cheers, + The VandyHacks Team`, }, }, Subject: { diff --git a/src/server/mail/templates/confirmed.ts b/src/server/mail/templates/confirmed.ts index d99f8f220..814318225 100644 --- a/src/server/mail/templates/confirmed.ts +++ b/src/server/mail/templates/confirmed.ts @@ -194,11 +194,11 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ - +
+
- + -
@@ -262,32 +262,44 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ -
We're so excited that you'll be joining us for VandyHacks VI: Art Edition!
+
+ We're so excited that you'll be joining us for VandyHacks: Summer Edition! +
-
This email is just to confirm you've RSVPed to our event. We'll be in touch soon with more information, but for now you can plan on check-in starting at 5:30pm Nov. 1st and the weekend wrapping up at 3:00pm Sunday, Nov 3rd.
+
+ This email is just to confirm that you've RSVPed to our event. We'll be in touch again soon with more information on our opening ceremony, but as a reminder, festivities will start at 8:00 PM CST Friday, July 10th, and wrap up by 10:45 AM CST Sunday, July 12th. +
-
If you are interested in reserving a spot on one of our buses, please rsvp for the buses by following the instructions in our bus guide.
+
+ In the meantime, be sure to like our page on Facebook and follow us on Instagram for some sneak peeks at the organizers in action! +
-
In the meantime, we'll be putting all the finishing touches on the weekend, so be sure to like our page on Facebook, follow us on Instagram, and keep up to date with our Twitter for some sneak peeks at the organizers in action!
+
+ NOTE: If you are no longer able to attend, please indicate this in the portal ASAP so that we can get an accurate attendance count. +
-
Happy Hacking!
+
+ See you soon! +
-
The VandyHacks Team
+
+ The VandyHacks Team +
@@ -444,14 +456,14 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({
You are receiving this application update because you applied at apply.vandyhacks.org. If you would like to opt-out of - any future emails pertaining to VandyHacks VI applications, please click here
-
© 2019 VandyHacks, All Rights Reserved.
+
© 2020 VandyHacks, All Rights Reserved.
@@ -584,11 +596,11 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ Text: { Charset: 'UTF-8', Data: `Hey ${escape(user.preferredName || user.firstName)}, - We're so excited that you'll be joining us for VandyHacks VI: Art Edition! - This email is just to confirm you've RSVPed to our event. We'll be in touch soon with more information, but for now you can plan on check-in starting at 5:30pm Nov. 1st and the weekend wrapping up at 3:00pm Sunday, Nov 3rd. - If you are interested in reserving a spot on one of our buses, please rsvp for the buses by following the instructions in our bus guide. - In the meantime, we'll be putting all the finishing touches on the weekend, so be sure to like our page on Facebook, follow us on Instagram, and keep up to date with our Twitter for some sneak peeks at the organizers in action! - Happy Hacking! + We're so excited that you'll be joining us for VandyHacks: Summer Edition! + This email is just to confirm that you've RSVPed to our event. We'll be in touch again soon with more information on our opening ceremony, but as a reminder, festivities will start at 8:00 PM CST Friday, July 10th, and wrap up by 10:45 AM CST Sunday, July 12th. + In the meantime, be sure to like our page on Facebook and follow us on Instagram for some sneak peeks at the organizers in action! + NOTE: If you are no longer able to attend, please indicate this in the portal ASAP so that we can get an accurate attendance count. + See you soon! The VandyHacks Team`, }, }, diff --git a/src/server/mail/templates/submitted.ts b/src/server/mail/templates/submitted.ts index 014ab7cc3..6cfd64de9 100644 --- a/src/server/mail/templates/submitted.ts +++ b/src/server/mail/templates/submitted.ts @@ -194,11 +194,11 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ - +
+
- + -
@@ -260,35 +260,44 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ -
Hey ${escape( +
Hi ${escape( user.preferredName || user.firstName )},
-
We've received your application for VandyHacks VI: Art Edition! We'll be accepting applications on a rolling basis, so keep your eyes out for another email from us for your application decision.
+
+ Thanks for taking the time to complete your application! We’re so excited that you’re interested in being a part of VandyHacks: Summer Edition. +
-
In the meantime, you can hype up by following us on Facebook, Twitter, - and Instagram, as well as update your application at any point up to your decision.
+
+ We will be reviewing your submission soon, so be on the lookout for another email regarding your status. +
-
If you have any questions, please don't hesitate to reach out to info@vandyhacks.org
+
+ Until then, stay hyped about VandyHacks! Like our page on Facebook and follow us on Instagram. +
-
Happy Hacking!
+
+ Cheers, +
-
The VandyHacks Team
+
+ The VandyHacks Team +
@@ -445,14 +454,14 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({
You are receiving this application update because you applied at apply.vandyhacks.org. If you would like to opt-out of - any future emails pertaining to VandyHacks VI applications, please click here
-
© 2019 VandyHacks, All Rights Reserved.
+
© 2020 VandyHacks, All Rights Reserved.
@@ -585,11 +594,11 @@ export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ Text: { Charset: 'UTF-8', Data: `Thank you for applying! - Hey ${escape(user.preferredName || user.firstName)}, - We've received your application for VandyHacks VI: Art Edition! We'll be accepting applications on a rolling basis, so keep your eyes out for another email from us for your application decision. - In the meantime, you can hype up by following us on Facebook, Twitter, and Instagram, as well as update your application at any point up to your decision. - If you have any questions, please don't hesitate to reach out to info@vandyhacks.org - Happy Hacking! + Hi ${escape(user.preferredName || user.firstName)}, + Thanks for taking the time to complete your application! We’re so excited that you’re interested in being a part of VandyHacks: Summer Edition. + We will be reviewing your submission soon, so be on the lookout for another email regarding your status. + Until then, stay hyped about VandyHacks! Like our page on Facebook and follow us on Instagram. + Cheers, The VandyHacks Team`, }, }, diff --git a/src/server/plugins.ts b/src/server/plugins.ts index 6f24d8807..828e131d7 100644 --- a/src/server/plugins.ts +++ b/src/server/plugins.ts @@ -1,5 +1,3 @@ -/* eslint-disable */ - import { NFCPlugin } from '../../plugins/nfc/server'; import { GoogleOAuth } from '../../plugins/google-oauth'; import { GitHubOAuth } from '../../plugins/github-oauth'; diff --git a/src/server/resolvers/index.ts b/src/server/resolvers/index.ts index ef66e4d48..ce3fc9970 100644 --- a/src/server/resolvers/index.ts +++ b/src/server/resolvers/index.ts @@ -32,14 +32,14 @@ import { getSignedUploadUrl, getSignedReadUrl } from '../storage/gcp'; import { sendStatusEmail } from '../mail/aws'; import logger from '../logger'; -// added here b/c webpack JSON compilation with 'use-strict' is broken (10/31/19) -const DEADLINE_TS = 1572497940000; +// added here b/c webpack JSON compilation with 'use-strict' is broken (7/10/19 at 23:59) +const DEADLINE_TS = 1594443599000; // TODO: Cannot import frontend files so this is ugly workaround. Fix this. const requiredFields = [ 'firstName', 'lastName', - 'shirtSize', + // 'shirtSize', 'gender', 'phoneNumber', 'dateOfBirth', @@ -47,9 +47,9 @@ const requiredFields = [ 'major', 'gradYear', 'race', - 'favArtPiece', - 'essay1', - 'volunteer', + // 'favArtPiece', + // 'essay1', + // 'volunteer', 'resume', 'codeOfConduct', 'infoSharingConsent', @@ -458,7 +458,7 @@ export const resolvers: CustomResolvers = { 'lastName', 'shirtSize', 'gender', - 'dietaryRestrictions', + // 'dietaryRestrictions', 'phoneNumber', 'race', 'school', From d5178b91902a9922239991bfe704f5cd94d8d567 Mon Sep 17 00:00:00 2001 From: Gabriel Ting Date: Thu, 27 Aug 2020 21:42:29 -0500 Subject: [PATCH 4/6] Extract deadline to STRINGS, bump to October, build unix timestamp from string --- src/client/assets/strings.json | 7 ++++--- src/server/resolvers/index.ts | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client/assets/strings.json b/src/client/assets/strings.json index dd2fea059..7d914df87 100644 --- a/src/client/assets/strings.json +++ b/src/client/assets/strings.json @@ -2,11 +2,12 @@ "FULL_NAME": "VandyHacks: Summer Edition", "HACKATHON_TITLE": "VandyHacks: Summer Edition", "WEBSITE_HTML_TITLE": "VandyHacks Application Portal", - "DEADLINE": "July 10, 2020 at 6:00pm (CST)", + "DEADLINE": "October 2, 2020 at 12:00pm (CST)", + "DEADLINE_DATE_FORMAT": "October 2, 2020 12:00:00", "SHORTENED_HACKATHON_TITLE": "VH", "HACKATHON_WEBSITE": "https://vandyhacks.org", - "START_DAY": "July 10th", - "START_DAY_SHORT": "July 10th", + "START_DAY": "October 2nd", + "START_DAY_SHORT": "October 2nd", "DARK_TEXT_COLOR": "#3f3356", "DARKEST_TEXT_COLOR": "#1A051D", "BASE_COLOR": "#B1D0FE", diff --git a/src/server/resolvers/index.ts b/src/server/resolvers/index.ts index ce3fc9970..f102058c6 100644 --- a/src/server/resolvers/index.ts +++ b/src/server/resolvers/index.ts @@ -31,9 +31,11 @@ import { addOrUpdateEvent, assignEventToCompany, removeAbsentEvents } from '../e import { getSignedUploadUrl, getSignedReadUrl } from '../storage/gcp'; import { sendStatusEmail } from '../mail/aws'; import logger from '../logger'; +import { DEADLINE_DATE_FORMAT } from '../../client/assets/strings.json'; // added here b/c webpack JSON compilation with 'use-strict' is broken (7/10/19 at 23:59) -const DEADLINE_TS = 1594443599000; +const deadline = new Date(DEADLINE_DATE_FORMAT); +const DEADLINE_TS = deadline.getTime(); // TODO: Cannot import frontend files so this is ugly workaround. Fix this. const requiredFields = [ From 8cb56831f4ee22354f0a6c8c5048efd852d291d5 Mon Sep 17 00:00:00 2001 From: Lu Cao Date: Tue, 1 Sep 2020 13:12:21 -0500 Subject: [PATCH 5/6] Add support for rejection emails --- src/server/mail/aws.ts | 6 +- src/server/mail/templates/rejected.ts | 606 ++++++++++++++++++++++++++ src/server/resolvers/index.ts | 1 + 3 files changed, 612 insertions(+), 1 deletion(-) create mode 100644 src/server/mail/templates/rejected.ts diff --git a/src/server/mail/aws.ts b/src/server/mail/aws.ts index 9729cddf0..c55b91005 100644 --- a/src/server/mail/aws.ts +++ b/src/server/mail/aws.ts @@ -3,6 +3,7 @@ import { UserDbInterface, ApplicationStatus } from '../generated/graphql'; import submitted from './templates/submitted'; import accepted from './templates/accepted'; import confirmed from './templates/confirmed'; +import rejected from './templates/rejected'; import logger from '../logger'; const { AWS_REGION } = process.env; @@ -31,6 +32,9 @@ export function sendStatusEmail(user: UserDbInterface, status: ApplicationStatus case ApplicationStatus.Confirmed: email = confirmed(user); break; + case ApplicationStatus.Rejected: + email = rejected(user); + break; default: throw new Error(`Unimplemented email for status "${status}" to user "${user.email}`); } @@ -42,4 +46,4 @@ export function sendStatusEmail(user: UserDbInterface, status: ApplicationStatus .catch(logger.error); } -export default { sendStatusEmail }; +export default { sendStatusEmail }; \ No newline at end of file diff --git a/src/server/mail/templates/rejected.ts b/src/server/mail/templates/rejected.ts new file mode 100644 index 000000000..9253d61f2 --- /dev/null +++ b/src/server/mail/templates/rejected.ts @@ -0,0 +1,606 @@ +import escape from 'escape-html'; +import { UserDbInterface } from '../../generated/graphql'; + +// TODO: Dedupe these emails. All the HTML is the same, the only difference is in the +// actual lines presented to the user, which could be parameterized. Rich HTML content +// (links only so far) could be tricky if we want to re-use the same HTML for text and +// HTML sections. + +export default (user: UserDbInterface): AWS.SES.SendEmailRequest => ({ + Destination: { + ToAddresses: [user.email], // Email address/addresses that you want to send your email + }, + Message: { + Body: { + Html: { + // HTML Format of the email + Charset: 'UTF-8', + Data: ` + + + + Thank you for applying to VandyHacks + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ +
+
+ +
+ + + + + + +
+ +
+ + + + + + +
+ +
+ + + + +
+ + + + + + +
+ + + +
+
+
+ +
+
+ +
+ + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+
Hi ${escape( + user.preferredName || user.firstName + )}!
+
+
+ Thank you for your interest in VandyHacks: Summer Edition. Unfortunately, we are unable to offer you a spot at this year's event. +
+
+
+ We really appreciate your interest and hope you will apply to another VandyHacks opportunity in the future. +
+
+
+ Best, +
+
+
+ The VandyHacks Team +
+
+
+ P.S. And of course, make sure to stay up-to-date by following us on Instagram and checking out our Facebook Event +
+
+
+ +
+
+ +
+
+ + + + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
+ + + + + + + + + + +
+ + + + + +
+ + + + +
+ +
+
+ + + + + +
+ + + + +
+ +
+
+ + + + + +
+ + + + +
+ +
+
+ +
+
+ You are receiving this application update because you applied at apply.vandyhacks.org. + If you would like to opt-out of + any future emails pertaining to VandyHacks applications, please click here
+
+
© 2020 VandyHacks, All Rights Reserved.
+
+
+
+ +
+
+ +
+ + + + + + +
+ +
+ +
+ + + + + + +
+ + + + +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + `, + }, + Text: { + Charset: 'UTF-8', + Data: `Hi ${escape(user.preferredName || user.firstName)}, + Thank you for your interest in VandyHacks: Summer Edition. Unfortunately, we are unable to offer you a spot at this year's event. + We really appreciate your interest and hope you will apply to another VandyHacks opportunity in the future. + Best, + The VandyHacks Team`, + }, + }, + Subject: { + Charset: 'UTF-8', + Data: 'Thank you for applying to VandyHacks', + }, + }, + Source: 'VandyHacks ', +}); \ No newline at end of file diff --git a/src/server/resolvers/index.ts b/src/server/resolvers/index.ts index f102058c6..8afb7fc7a 100644 --- a/src/server/resolvers/index.ts +++ b/src/server/resolvers/index.ts @@ -318,6 +318,7 @@ export const resolvers: CustomResolvers = { throw new UserInputError(`user ${id} (${value}) error: ${JSON.stringify(err)}`); if (status === ApplicationStatus.Accepted) sendStatusEmail(value, ApplicationStatus.Accepted); + if (status === ApplicationStatus.Rejected) sendStatusEmail(value, ApplicationStatus.Rejected); return value; }, From 6b1ffecbbc13a566af5d9508d444b798ff8bf34b Mon Sep 17 00:00:00 2001 From: Lu Cao Date: Wed, 9 Sep 2020 16:46:04 -0500 Subject: [PATCH 6/6] Update ApplicationStatus conditionals --- src/server/resolvers/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/resolvers/index.ts b/src/server/resolvers/index.ts index 8afb7fc7a..bb6da6c32 100644 --- a/src/server/resolvers/index.ts +++ b/src/server/resolvers/index.ts @@ -318,7 +318,7 @@ export const resolvers: CustomResolvers = { throw new UserInputError(`user ${id} (${value}) error: ${JSON.stringify(err)}`); if (status === ApplicationStatus.Accepted) sendStatusEmail(value, ApplicationStatus.Accepted); - if (status === ApplicationStatus.Rejected) sendStatusEmail(value, ApplicationStatus.Rejected); + else if (status === ApplicationStatus.Rejected) sendStatusEmail(value, ApplicationStatus.Rejected); return value; },