diff --git a/client/src/assets/judges/alexi.jpg b/client/src/assets/judges/alexi.jpg new file mode 100644 index 00000000..74926959 Binary files /dev/null and b/client/src/assets/judges/alexi.jpg differ diff --git a/client/src/assets/judges/amelie.jpg b/client/src/assets/judges/amelie.jpg new file mode 100644 index 00000000..b4096ff1 Binary files /dev/null and b/client/src/assets/judges/amelie.jpg differ diff --git a/client/src/assets/judges/ben.jpg b/client/src/assets/judges/ben.jpg new file mode 100644 index 00000000..a65f69aa Binary files /dev/null and b/client/src/assets/judges/ben.jpg differ diff --git a/client/src/assets/judges/celin.jpg b/client/src/assets/judges/celin.jpg new file mode 100644 index 00000000..af4e65dd Binary files /dev/null and b/client/src/assets/judges/celin.jpg differ diff --git a/client/src/assets/judges/emaan.jpg b/client/src/assets/judges/emaan.jpg new file mode 100644 index 00000000..93d44b5e Binary files /dev/null and b/client/src/assets/judges/emaan.jpg differ diff --git a/client/src/assets/judges/erika.jpg b/client/src/assets/judges/erika.jpg new file mode 100644 index 00000000..d3a8b03e Binary files /dev/null and b/client/src/assets/judges/erika.jpg differ diff --git a/client/src/assets/judges/jeremy.jpg b/client/src/assets/judges/jeremy.jpg new file mode 100644 index 00000000..b6a6e2c8 Binary files /dev/null and b/client/src/assets/judges/jeremy.jpg differ diff --git a/client/src/assets/judges/kaija.jpeg b/client/src/assets/judges/kaija.jpeg new file mode 100644 index 00000000..48268901 Binary files /dev/null and b/client/src/assets/judges/kaija.jpeg differ diff --git a/client/src/assets/judges/karen.jpg b/client/src/assets/judges/karen.jpg new file mode 100644 index 00000000..6487dbd7 Binary files /dev/null and b/client/src/assets/judges/karen.jpg differ diff --git a/client/src/assets/judges/katie.jpg b/client/src/assets/judges/katie.jpg new file mode 100644 index 00000000..e9aecf5a Binary files /dev/null and b/client/src/assets/judges/katie.jpg differ diff --git a/client/src/assets/judges/khalil.jpg b/client/src/assets/judges/khalil.jpg new file mode 100644 index 00000000..12f64621 Binary files /dev/null and b/client/src/assets/judges/khalil.jpg differ diff --git a/client/src/assets/judges/luka.jpg b/client/src/assets/judges/luka.jpg new file mode 100644 index 00000000..10b08f46 Binary files /dev/null and b/client/src/assets/judges/luka.jpg differ diff --git a/client/src/assets/judges/nat.jpg b/client/src/assets/judges/nat.jpg new file mode 100644 index 00000000..412628ab Binary files /dev/null and b/client/src/assets/judges/nat.jpg differ diff --git a/client/src/assets/judges/novera.jpg b/client/src/assets/judges/novera.jpg new file mode 100644 index 00000000..948cec8b Binary files /dev/null and b/client/src/assets/judges/novera.jpg differ diff --git a/client/src/assets/judges/rimjot.jpg b/client/src/assets/judges/rimjot.jpg new file mode 100644 index 00000000..727b03f7 Binary files /dev/null and b/client/src/assets/judges/rimjot.jpg differ diff --git a/client/src/assets/judges/tanya.jpg b/client/src/assets/judges/tanya.jpg new file mode 100644 index 00000000..9d01fbb3 Binary files /dev/null and b/client/src/assets/judges/tanya.jpg differ diff --git a/client/src/assets/judges/tech.png b/client/src/assets/judges/tech.png new file mode 100644 index 00000000..c4f132f4 Binary files /dev/null and b/client/src/assets/judges/tech.png differ diff --git a/client/src/components/ScuntLinks/ScuntLinks.jsx b/client/src/components/ScuntLinks/ScuntLinks.jsx index 378eec62..59c3c766 100644 --- a/client/src/components/ScuntLinks/ScuntLinks.jsx +++ b/client/src/components/ScuntLinks/ScuntLinks.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React from 'react'; import { Link, useLocation } from 'react-router-dom'; import { pages } from '../../util/pages'; import { ButtonOutlined } from '../button/ButtonOutlined/ButtonOutlined'; diff --git a/client/src/components/profile/leedur/ProfilePageQRScanner/ProfilePageQRScanner.jsx b/client/src/components/profile/leedur/ProfilePageQRScanner/ProfilePageQRScanner.jsx index 919d2662..f10ee492 100644 --- a/client/src/components/profile/leedur/ProfilePageQRScanner/ProfilePageQRScanner.jsx +++ b/client/src/components/profile/leedur/ProfilePageQRScanner/ProfilePageQRScanner.jsx @@ -11,6 +11,7 @@ import { preKitPickUp, searchFroshList, clearFroshList, + getFood, } from '../../../../state/frosh/saga'; import PropTypes from 'prop-types'; import { capitalizeFirstLetter } from '../../../../pages/Profile/functions'; @@ -29,6 +30,8 @@ export const ProfilePageQRScanner = ({ scopes }) => { setScannerType('registration'); } else if (scopes?.includes('scanner:kits')) { setScannerType('kits'); + } else if (scopes?.includes('scanner:food')) { + setScannerType('food'); } }, [scopes]); @@ -91,6 +94,20 @@ export const ProfilePageQRScanner = ({ scopes }) => { )} ); + case 'food': + return ( + <> + {frosh['gotFood'] ? ( +
+ +
+ ) : ( +
+ +
+ )} + + ); } }; @@ -104,6 +121,8 @@ export const ProfilePageQRScanner = ({ scopes }) => { dispatch(signInFrosh({ userID })); } else if (scannerType === 'kits') { dispatch(preKitPickUp({ userID })); + } else if (scannerType === 'food') { + dispatch(getFood({ userID })); } } }} @@ -126,9 +145,16 @@ export const ProfilePageQRScanner = ({ scopes }) => { {Object.keys(frosh).map((keyPassed) => { const key = keyPassed.toString(); return ( - !['_id', 'signInDate', 'userType', 'firstName', 'preferredName', 'preKit'].includes( - key, - ) && ( + ![ + '_id', + 'signInDate', + 'userType', + 'firstName', + 'preferredName', + 'preKit', + 'isRegistered', + 'gotFood', + ].includes(key) && (
{capitalizeFirstLetter(key) + ': '} {frosh[key]?.toString()} @@ -179,6 +205,8 @@ export const ProfilePageQRScanner = ({ scopes }) => { dispatch(signInFrosh({ userID: searchResultFrosh._id })); } else if (scannerType === 'kits') { dispatch(preKitPickUp({ userID: searchResultFrosh._id })); + } else if (scannerType === 'food') { + dispatch(getFood({ userID: searchResultFrosh._id })); } }} key={searchResultFrosh.email + index} diff --git a/client/src/components/profile/scunt/ProfilePageScuntToken/ProfilePageScuntToken.jsx b/client/src/components/profile/scunt/ProfilePageScuntToken/ProfilePageScuntToken.jsx index d190809a..a7cfb9ba 100644 --- a/client/src/components/profile/scunt/ProfilePageScuntToken/ProfilePageScuntToken.jsx +++ b/client/src/components/profile/scunt/ProfilePageScuntToken/ProfilePageScuntToken.jsx @@ -10,64 +10,62 @@ import { getScuntTeamObjFromTeamNumber } from '../../../../pages/ScuntJudgeForm/ import { scuntDiscord } from '../../../../util/scunt-constants'; import { scuntTeamsSelector } from '../../../../state/scuntTeams/scuntTeamsSlice'; -export const ProfilePageScuntToken = () => { - const { scuntSettings } = useSelector(scuntSettingsSelector); - const { user } = useSelector(userSelector); - const { scuntTeams } = useSelector(scuntTeamsSelector); - const isRegistered = useSelector(registeredSelector); - const { setSnackbar } = useContext(SnackbarContext); - const [showToken, setShowToken] = useState(false); +// export const ProfilePageScuntToken = () => { +// const { scuntSettings } = useSelector(scuntSettingsSelector); +// const { user } = useSelector(userSelector); +// const { scuntTeams } = useSelector(scuntTeamsSelector); +// const isRegistered = useSelector(registeredSelector); +// const { setSnackbar } = useContext(SnackbarContext); +// const [showToken, setShowToken] = useState(false); +// if (!isRegistered || (scuntSettings && !scuntSettings?.revealTeams)) { +// return null; +// } - const code = user?.scuntToken; - if (code === undefined || !isRegistered || (scuntSettings && !scuntSettings?.revealTeams)) { - return null; - } +// if (!user?.attendingScunt && user?.userType !== 'leadur') { +// return ( +//
+//

+// Looking for your Scunt login Token? +//

+//

You have chosen not to participate in Scunt.

+//
+//
+// ); +// } +// return ( +//
+//

{getScuntTeamObjFromTeamNumber(user?.scuntTeam, scuntTeams)?.name}

+// +//

Team {user?.scuntTeam ? user?.scuntTeam.toString() : '‽'}

+//
+//

{ +// navigator.clipboard.writeText(code); +// setSnackbar('Copied to clipboard'); +// }} +// > +// {code} +//

+//

Scunt Login Token

+//

+// Use this token to login to the{' '} +// +// Scunt Discord +// +//

+// { +// setShowToken(!showToken); +// }} +// /> +//
+// ); +// }; - if (!user?.attendingScunt && user?.userType !== 'leadur') { - return ( -
-

- Looking for your Scunt login Token? -

-

You have chosen not to participate in Scunt.

-
-
- ); - } - return ( -
-

{getScuntTeamObjFromTeamNumber(user?.scuntTeam, scuntTeams)?.name}

- -

Team {user?.scuntTeam ? user?.scuntTeam.toString() : '‽'}

-
-

{ - navigator.clipboard.writeText(code); - setSnackbar('Copied to clipboard'); - }} - > - {code} -

-

Scunt Login Token

-

- Use this token to login to the{' '} - - Scunt Discord - -

- { - setShowToken(!showToken); - }} - /> -
- ); -}; - -ProfilePageScuntToken.propTypes = { - scuntTeams: PropTypes.array, - scuntTeamObjs: PropTypes.array, -}; +// ProfilePageScuntToken.propTypes = { +// scuntTeams: PropTypes.array, +// scuntTeamObjs: PropTypes.array, +// }; diff --git a/client/src/pages/Profile/PageProfileFrosh.jsx b/client/src/pages/Profile/PageProfileFrosh.jsx index 3bdc50b5..18022ef5 100644 --- a/client/src/pages/Profile/PageProfileFrosh.jsx +++ b/client/src/pages/Profile/PageProfileFrosh.jsx @@ -29,7 +29,7 @@ import { scuntSettingsSelector } from '../../state/scuntSettings/scuntSettingsSl import { getRemainingTickets } from '../FroshRetreat/FroshRetreat'; import { ProfilePageSchedule } from '../../components/profile/ProfilePageSchedule/ProfilePageSchedule'; import { ProfilePageResources } from '../../components/profile/ProfilePageResources/ProfilePageResources'; -import { ProfilePageFroshScuntTeamsSelection } from '../../components/profile/scunt/ProfilePageFroshScuntTeamsSelection/ProfilePageFroshScuntTeamsSelection'; +// import { ProfilePageFroshScuntTeamsSelection } from '../../components/profile/scunt/ProfilePageFroshScuntTeamsSelection/ProfilePageFroshScuntTeamsSelection'; import { getScuntTeams } from '../../state/scuntTeams/saga'; import { getScuntSettings } from '../../state/scuntSettings/saga'; import { scuntTeamsSelector } from '../../state/scuntTeams/scuntTeamsSlice'; @@ -42,16 +42,18 @@ const PageProfileFrosh = () => { const dispatch = useDispatch(); useEffect(() => { - dispatch(getScuntSettings()); - dispatch(getScuntTeams()); - }, [dispatch]); + if (user?.attendingScunt) { + dispatch(getScuntSettings()); + dispatch(getScuntTeams()); + } + }, [dispatch, user]); return ( <>
- + {user?.attendingScunt === true ? : null} {isRegistered ? : null} {/* */} @@ -61,9 +63,9 @@ const PageProfileFrosh = () => {
{/* not doing discord */} - - - + {user?.attendingScunt ? : null} + {/* */} +
@@ -164,8 +166,7 @@ const ProfilePageFroshScuntMessage = () => { const isRegistered = useSelector(registeredSelector); const { darkMode } = useContext(DarkModeContext); - const code = user?.scuntToken; - if (code === undefined || !isRegistered || !scuntSettings || !scuntSettings?.revealTeams) { + if (!isRegistered || !scuntSettings || !scuntSettings?.revealTeams) { return null; } @@ -174,8 +175,8 @@ const ProfilePageFroshScuntMessage = () => {
Scunt
-

Havenger Scunt!

-

Find more information about Scunt by clicking here!

+

SkavENGer Hunt!

+

Find more information about The Hunt by clicking here!

@@ -425,22 +426,30 @@ const ProfilePageQRCode = () => { ); }; -const ProfilePageScuntTeam = () => { +export const ProfilePageScuntTeam = () => { const isRegistered = useSelector(registeredSelector); const { scuntSettings } = useSelector(scuntSettingsSelector); const { scuntTeams } = useSelector(scuntTeamsSelector); const { user } = useSelector(userSelector); - const [scuntTeam, setScuntTeam] = useState(); + const [scuntTeam, setScuntTeam] = useState(null); + + const dispatch = useDispatch(); + + useEffect(() => { + dispatch(getScuntSettings()); + dispatch(getScuntTeams()); + }, [dispatch]); - if (!isRegistered || !scuntSettings || !scuntSettings?.revealTeams) return null; useEffect(() => { if (scuntTeams?.length) { const [team] = scuntTeams.filter((team) => { - return team.number === user?.scuntTeam; + return team?.number === user?.scuntTeam; }); setScuntTeam(team); } }, [scuntTeams]); + + if (!isRegistered || !scuntSettings || !scuntSettings?.revealTeams) return null; return (

Your Scunt Team:

diff --git a/client/src/pages/Profile/PageProfileLeader.jsx b/client/src/pages/Profile/PageProfileLeader.jsx index 60b3dc1b..7ed4e304 100644 --- a/client/src/pages/Profile/PageProfileLeader.jsx +++ b/client/src/pages/Profile/PageProfileLeader.jsx @@ -25,7 +25,8 @@ const PageProfileLeader = () => { const { user } = useSelector(userSelector); const qrCodeLeader = user?.authScopes?.approved.includes('scanner:registration') || - user?.authScopes?.approved.includes('scanner:kits'); + user?.authScopes?.approved.includes('scanner:kits') || + user?.authScopes?.approved.includes('scanner:food'); const dispatch = useDispatch(); diff --git a/client/src/pages/ScopeRequest/functions.jsx b/client/src/pages/ScopeRequest/functions.jsx index 02511246..c85859ee 100644 --- a/client/src/pages/ScopeRequest/functions.jsx +++ b/client/src/pages/ScopeRequest/functions.jsx @@ -39,7 +39,7 @@ export const getTotalScopes = () => { accounts: ['read', 'edit', 'delete'], email: ['send'], timeline: ['create', 'edit', 'delete'], - scanner: ['registration', 'kits'], + scanner: ['registration', 'kits', 'food'], scunt: [ 'judge missions', 'judge bribe points', diff --git a/client/src/pages/ScuntHome/ScuntHome.jsx b/client/src/pages/ScuntHome/ScuntHome.jsx index 75497586..c4b48cf3 100644 --- a/client/src/pages/ScuntHome/ScuntHome.jsx +++ b/client/src/pages/ScuntHome/ScuntHome.jsx @@ -5,19 +5,20 @@ import WaveDarkMode from '../../assets/darkmode/misc/wave.png'; import waveBottom from '../../assets/misc/wave-reverse.png'; import waveBottomDarkMode from '../../assets/darkmode/misc/wave-reverse.png'; import { Confetti } from '../../components/misc/Confetti/Confetti'; -import { Link, useLocation } from 'react-router-dom'; +import { Link } from 'react-router-dom'; import { ScuntLinks } from '../../components/ScuntLinks/ScuntLinks'; import { DarkModeContext } from '../../util/DarkModeProvider'; -import DiscordIcon from '../../assets/social/discord-brands.svg'; +// import DiscordIcon from '../../assets/social/discord-brands.svg'; import { aboutScunt, okayToInviteToScunt, scuntDiscord } from '../../util/scunt-constants'; import { useDispatch, useSelector } from 'react-redux'; import { userSelector } from '../../state/user/userSlice'; import { scuntSettingsSelector } from '../../state/scuntSettings/scuntSettingsSlice'; import useAxios from '../../hooks/useAxios'; -import { ProfilePageScuntToken } from '../../components/profile/scunt/ProfilePageScuntToken/ProfilePageScuntToken'; +// import { ProfilePageScuntToken } from '../../components/profile/scunt/ProfilePageScuntToken/ProfilePageScuntToken'; import { scuntTeamsSelector } from '../../state/scuntTeams/scuntTeamsSlice'; import { getScuntSettings } from '../../state/scuntSettings/saga'; import { getScuntTeams } from '../../state/scuntTeams/saga'; +// import { ProfilePageScuntTeam } from '../Profile/PageProfileFrosh'; const { axios } = useAxios(); export const PageScuntHome = () => { @@ -39,54 +40,27 @@ export const PageScuntHome = () => { const AboutScunt = () => { const { darkMode } = useContext(DarkModeContext); - const [scuntTeamObjs, setScuntTeamObjs] = useState(); - const { scuntTeams } = useSelector(scuntTeamsSelector); - // const getScuntTeams = async () => { - // try { - // const response = await axios.get('/scunt-teams'); - // const { teamPoints } = response.data; - // if (teamPoints.length <= 0 || !teamPoints) setScuntTeams([]); - // else { - // setScuntTeamObjs(teamPoints); - // setScuntTeams( - // teamPoints.map((team) => { - // return team?.name; - // }), - // ); - // } - // } catch (e) { - // console.error(e.toString()); - // setScuntTeams(['Error loading teams']); - // } - // }; - - // useEffect(() => { - // getScuntTeams(); - // }, []); return ( <> - {darkMode ? ( - - ) : ( - - )} +
-
- -
+ {/*
+ +
*/}

Check the Rules for more information

- {darkMode ? ( - wave - ) : ( - wave - )} + wave +
); diff --git a/client/src/pages/ScuntJudges/ScuntJudges.jsx b/client/src/pages/ScuntJudges/ScuntJudges.jsx index 466da7a0..6b1f8939 100644 --- a/client/src/pages/ScuntJudges/ScuntJudges.jsx +++ b/client/src/pages/ScuntJudges/ScuntJudges.jsx @@ -20,9 +20,15 @@ const ScuntJudges = () => { const { scuntSettings, loading } = useSelector(scuntSettingsSelector); // returns array const [revealJudgesAndBribes, setRevealJudgesAndBribes] = useState(false); + const dispatch = useDispatch(); + + useEffect(() => { + dispatch(getScuntSettings()); + }, [dispatch]); + useEffect(() => { if (scuntSettings !== undefined) { - setRevealJudgesAndBribes(scuntSettings[0]?.revealJudgesAndBribes); + setRevealJudgesAndBribes(scuntSettings?.revealJudgesAndBribes); } }, [scuntSettings]); diff --git a/client/src/pages/ScuntLeaderboard/ScuntLeaderboard.jsx b/client/src/pages/ScuntLeaderboard/ScuntLeaderboard.jsx index 4d752a92..7911bca6 100644 --- a/client/src/pages/ScuntLeaderboard/ScuntLeaderboard.jsx +++ b/client/src/pages/ScuntLeaderboard/ScuntLeaderboard.jsx @@ -12,7 +12,7 @@ import thirdPlace from '../../assets/scuntleaderboard/third-medal.svg'; import { Button } from '../../components/button/Button/Button'; import { useSelector } from 'react-redux'; -import { userSelector } from '../../state/user/userSlice'; +import { loggedInSelector, userSelector } from '../../state/user/userSlice'; import { scuntSettingsSelector } from '../../state/scuntSettings/scuntSettingsSlice'; import io from 'socket.io-client'; @@ -54,6 +54,7 @@ const buttonStyle = { width: 'fit-content' }; const ScuntLeaderboard = () => { const { user } = useSelector(userSelector); const leader = user?.userType === 'leadur'; + const loggedIn = useSelector(loggedInSelector); const { scuntSettings } = useSelector(scuntSettingsSelector); const [revealJudgesAndBribes, setRevealJudgesAndBribes] = useState(false); const socket = io(`${import.meta.env.VITE_API_BASE_URL}/leaderboard`, { autoConnect: false }); @@ -98,7 +99,7 @@ const ScuntLeaderboard = () => { } }, [scuntSettings]); - if (revealJudgesAndBribes !== true && !leader) { + if ((revealJudgesAndBribes !== true && !leader) || !loggedIn || !user?.attendingScunt) { return (
diff --git a/client/src/pages/ScuntMissionsDashboard/ScuntMissionsDashboard.jsx b/client/src/pages/ScuntMissionsDashboard/ScuntMissionsDashboard.jsx index f07a5b2c..9b07b847 100644 --- a/client/src/pages/ScuntMissionsDashboard/ScuntMissionsDashboard.jsx +++ b/client/src/pages/ScuntMissionsDashboard/ScuntMissionsDashboard.jsx @@ -2,7 +2,6 @@ import { React, useState, useEffect, useContext } from 'react'; -import { list } from '../ScuntJudgeForm/scuntTempData'; import './ScuntMissionsDashboard.scss'; import '../AccountsApproval/AccountsApproval.scss'; @@ -68,7 +67,6 @@ const ScuntCreateMissions = () => { }; const { setSnackbar } = useContext(SnackbarContext); // use Snackbar to send messages --> successfull hidden/deleted, etc. - const { darkMode } = useContext(DarkModeContext); const [newMission, setNewMission] = useState(initialMission); let keys = Object.keys(newMission); @@ -106,89 +104,87 @@ const ScuntCreateMissions = () => { }; return ( - <> -
-
-
- {missioninput.map((i) => { - return ( - { - handleInput(input, i.key); - } - // TODO: update the state var -- DONE +
+
+
+ {missioninput.map((i) => { + return ( + { + handleInput(input, i.key); } - style={{ width: '100%', flexGrow: '1' }} - description={i.des} - /> - ); - })} - { - handleInput(state, 'isHidden'); - }} - /> - { - handleInput(state, 'isJudgingStation'); - }} - /> -
-
-
-

Mission Preview

- - {newMission !== undefined ? ( - keys?.map((i) => { - return ( -
-

- {convertCamelToLabel(i)} - {': '} -

- {newMission[i] === true || newMission[i] === false ? ( -
- {newMission[i].toString()} -
- ) : ( - newMission[i].toString() - )} -
- ); - }) - ) : ( - <> - )} -
- -
+
+
+

Mission Preview

+ + {newMission !== undefined ? ( + keys?.map((i) => { + return ( +
+

+ {convertCamelToLabel(i)} + {': '} +

+ {newMission[i] === true || newMission[i] === false ? ( +
+ {newMission[i].toString()} +
+ ) : ( + newMission[i].toString() + )} +
+ ); + }) + ) : ( + <> + )}
+ +
- +
); }; @@ -429,7 +425,7 @@ const ScuntUploadMissions = () => { if (file) { fileReader.onload = function (event) { const text = event.target.result; - const { data, errors } = parseCsvString(text, csvFields); + const { data } = parseCsvString(text, csvFields); setArray(data); }; diff --git a/client/src/pages/ScuntMissionsList/ScuntMissionsList.jsx b/client/src/pages/ScuntMissionsList/ScuntMissionsList.jsx index 1ce4964d..1829feb3 100644 --- a/client/src/pages/ScuntMissionsList/ScuntMissionsList.jsx +++ b/client/src/pages/ScuntMissionsList/ScuntMissionsList.jsx @@ -36,6 +36,7 @@ function getMissionCategories(missions) { const PageScuntMissionsList = () => { const { user } = useSelector(userSelector); + const loggedIn = useSelector(loggedInSelector); const { setSnackbar } = useContext(SnackbarContext); const leader = user?.userType === 'leadur'; const { scuntSettings, loading } = useSelector(scuntSettingsSelector); @@ -44,14 +45,14 @@ const PageScuntMissionsList = () => { const dispatch = useDispatch(); useEffect(() => { - if (scuntSettings) setRevealMissions(scuntSettings?.revealMissions); + if (scuntSettings?.revealMissions) setRevealMissions(true); }, [scuntSettings]); useEffect(() => { dispatch(getScuntMissions({ showHidden: false })); }, [dispatch]); - if (revealMissions !== true && !leader) { + if ((revealMissions !== true && !leader) || !loggedIn) { return ( <>
@@ -429,16 +430,12 @@ const PageScuntMissionsListShow = () => {

No search results

) : mission === undefined ? (
- ) : ( - <> - )} + ) : null}
{!loggedIn ? (

To see mission status and mission QR code please login to your account.

- ) : ( - <> - )} + ) : null} {loggedIn && mission !== undefined ? ( missionStatus?.completed ? ( <> @@ -452,12 +449,8 @@ const PageScuntMissionsListShow = () => {

- ) : ( - <> - ) - ) : ( - <> - )} + ) : null + ) : null} {loggedIn && user?.scuntTeam && mission !== undefined ? (
{ backgroundColor="white" />
- ) : ( - <> - )} + ) : null}
); }; diff --git a/client/src/state/frosh/saga.jsx b/client/src/state/frosh/saga.jsx index 1bd6c546..7f8fc6b4 100644 --- a/client/src/state/frosh/saga.jsx +++ b/client/src/state/frosh/saga.jsx @@ -105,6 +105,23 @@ export function* preKitPickUpSaga({ payload: { userID } }) { } } +export const getFood = createAction('getFoodSaga'); + +export function* getFoodSaga({ payload: { userID } }) { + const { axios } = useAxios(); + try { + yield put(preKitPickUpStart()); + const date = new Date(); + const result = yield call(axios.put, '/qr/food', { + userID, + }); + yield put(preKitPickUpSuccess(result?.data?.frosh)); + } catch (error) { + console.error(error); + yield put(preKitPickUpFailure(error?.response?.data?.errorMessage)); + } +} + export default function* froshSaga() { yield takeLeading(getFroshList.type, getFroshListSaga); yield takeLeading(redistributeFrosh.type, redistributeFroshSaga); @@ -112,4 +129,5 @@ export default function* froshSaga() { yield takeLeading(preKitPickUp.type, preKitPickUpSaga); yield takeLeading(searchFroshList.type, searchFroshListSaga); yield takeLeading(clearFroshList.type, clearFroshListSaga); + yield takeLeading(getFood.type, getFoodSaga); } diff --git a/client/src/util/scunt-constants.jsx b/client/src/util/scunt-constants.jsx index 85385b89..f3564ffd 100644 --- a/client/src/util/scunt-constants.jsx +++ b/client/src/util/scunt-constants.jsx @@ -2,24 +2,21 @@ export const okayToInviteToScunt = false; export const scuntDiscord = 'https://discord.gg/mRutbwuCK9'; export const scuntDate = 'September 7, 2022 18:00:00'; export const aboutScunt = ` -

Scunt

-

What is Scunt?

+

The H!unt

+

What is S!cavenger H!unt?

- Scunt is the best part of F!rosh Week (we promise we aren’t biased)! It’s a chaos filled event where you and your team compete against other F!rosh to get as many points as you possibly can. Your team gains points by completing missions and getting them judged by our super judgy judges (judging stations are located in the Pit and on the GB steps). The top three teams mayyyy also get something special on top of well-deserved bragging rights ;) -

-

Important Info

-

- You will be assigned a Scunt team (different from your F!rosh group) on Wednesday on the F!rosh week website. Please meet with your team on King’s College Road (outside of Sandford Fleming) at 5:30PM. We’ve attached a map that shows the location each team will be meeting at and our Scunt HLs will also have signs. Please do not be late, teams will be moving off of campus once the event begins. If you have any questions contact us at scunt@orientation.skule.ca. + The H!unt is the best part of F!rosh Week (we promise we aren’t biased)! It’s a chaos filled event where you and your team compete against other F!rosh to get as many points as you possibly can. Your team gains points by completing missions and getting them judged by our super judgy judges (judging stations are located in the Pit). The top three teams mayyyy also get something special on top of well-deserved bragging rights ;)

+ `; export const rules = { start: [ { title: 'Eligibility', - sub: 'To compete in the Havenger Scunt, one must be:', + sub: 'To compete in the S!cavenger H!unt, one must be:', items: [ 'Human, or near human (Engineering Science students will be accepted).', - 'A F!rosh (2T6!).', + 'A F!rosh (2T7!).', 'Currently enrolled within the Faculty of Applied Science and Engineering at the University of Toronto.', 'Have officially registered for the event via F!rosh Week 2T3.', ], @@ -35,7 +32,7 @@ export const rules = { }, { title: 'Teams', - sub: 'The team structure of Havenger Scunt will be as follows:', + sub: 'The team structure of S!cavenger H!unt will be as follows:', items: [ 'Contestants will be assigned randomly to 1 of 10 teams to approximate fairness prior to the event.', 'Each team will consist of 2 Head Leedurs and a number of Leedurs.', @@ -44,11 +41,11 @@ export const rules = { }, { title: 'Event Schedule', - sub: 'The timing of Havenger Scunt will be as follows:', + sub: 'The timing of S!cavenger H!unt will be as follows:', items: [ - 'The event shall begin on Wednesday, September 7th at 6:00 PM EST. At this time, orientation.skule.ca/scunt will go live with the list, as will all the commands on our Discord server. Oh yeah and the judges will rise from their upper year slumber too.', + 'The event shall begin on Wednesday, September 6th at 6:00 PM EST. At this time, orientation.skule.ca/scunt will go live with the list. Oh yeah and the judges will rise from their upper year slumber too.', 'The Royal Wedding will occur at approximately 10:00 PM', - 'The event will end on Wednesday, September 7th at 11:00 PM EST. There will be a 15-minute warning announcement.', + 'The event will end on Wednesday, September 6th at 11:00 PM EST. There will be a 15-minute warning announcement.', ], }, { @@ -61,7 +58,7 @@ export const rules = { '***The item must be on the list.***', 'Said item must have been completed by (at minimum) one freshman (F!rosh) from said team. Items completed by Leedurs alone will be ineligible for scoring.
  1. Leedurs may present digital evidence to a Judge to submit an item for their team, but there must either be a F!rosh featured in the photo/video, or proof that it was sent to the Leedur by a F!rosh.
', '***The item must be on the list.***', - 'It is encouraged to let Judges keep physical items brought in person (like a bigass fucking dildo) as part of the Havenger Scunt unless the items have a significant sentimental value.', + 'It is encouraged to let Judges keep physical items brought in person (like a bigass fucking dildo) as part of the S!cavenger H!unt unless the items have a significant sentimental value.', '***The item must be on the list.***', 'If there is any mess created by performing an item, it must be cleaned up or you will not get the points.', '***The item must be on the list.***', @@ -77,7 +74,7 @@ export const rules = { title: 'Judging', items: [ 'Items must be submitted in person to a judge, starting at 6:00 PM and ending at 11:00 PM as with the rest of the event.', - 'There will be sixteen (16) total judges for Havenger Scunt.
  1. Occasionally, members of the F!rosh Week Executive Team may stand in as judges, during busy periods.
', + 'There will be sixteen (16) total judges for S!cavenger H!unt.
  1. Occasionally, members of the F!rosh Week Executive Team may stand in as judges, during busy periods.
', 'There will be two (2) Judging Stations, one in the Pit and another on the steps of Galbraith Building. Each station will have eight (8) judges.
  1. Partway through the evening, the judges will swap stations.
', 'A maximum of three (3) items may be submitted to a single judge by one person at once. This is required both to keep traffic flowing and to eliminate biases from particular judges.
  1. If there is a line, the submitter must return to the back of the line upon completion of the three items.
  2. If there is no line, the submitter must move to a different judge to submit more items.
  3. Judges and Base Leedurs are entitled to further limit the number of items judged at once if needed, to decrease wait times.
', 'There will be Skule Patrollers and Base Leedurs at each station to promote safety and control traffic at each station.
  1. The Base Leedurs and Patrollers must be obeyed, if they get sad points will be deducted.
', @@ -105,7 +102,7 @@ export const rules = { }, { title: 'Prizes', - sub: 'The winners of the Havenger Scunt will receive a super cool first tier prize! The second place team will receive a super cool second tier prize! The third place group will receive a super cool third tier prize! All of these groups will earn the ability to go to other teams and say "Neener, neener, etc.", "HAHAHAHA HAHAHAHA! IN YOUR FACE #%$@*#*$*#!" or something similar. Essentially bragging rights forever.', + sub: 'The winners of the S!cavenger H!unt will receive a super cool first tier prize! The second place team will receive a super cool second tier prize! The third place group will receive a super cool third tier prize! All of these groups will earn the ability to go to other teams and say "Neener, neener, etc.", "HAHAHAHA HAHAHAHA! IN YOUR FACE #%$@*#*$*#!" or something similar. Essentially bragging rights forever.', items: [ 'Prizes will be available for pickup at Engineering Stores (located in the Pit) from Thursday, September 8th to Friday, September 16th, 2022.', @@ -115,7 +112,7 @@ export const rules = { }, { title: 'Kidnapping', - sub: 'Any kidnapping requested by judges that occurs during the Havenger Scunt must follow this code:', + sub: 'Any kidnapping requested by judges that occurs during the S!cavenger H!unt must follow this code:', items: [ 'In accordance with the second guiding principle the kidnapping should be well planned. Knowing in advance how the kidnapee will respond, or pre-staging the kidnapping is essential for avoiding conflict.', 'Any use of force must desist if the kidnapee is unwilling to participate.', @@ -128,10 +125,10 @@ export const rules = { ], }, { - title: 'Havenger Scunt Chairs', + title: 'S!cavenger H!unt Chairs', sub: 'Oh Hey, that’s us!', items: [ - 'Any and all disputes will be brought before the Havenger Scunt Chairs who are infallible - as all decisions are infallible, they are also final.', + 'Any and all disputes will be brought before the S!cavenger H!unt Chairs who are infallible - as all decisions are infallible, they are also final.', 'The Chairs have the reserved right to deduct up to infinity points from any team that leaves a mess in the completion of Scunt Items. Teams should thus clean up their messes to avoid the humiliation and shame that comes with being singled out for leaving a mess.', 'The Chairs have the reserved right to deduct up to infinity points from any team found to be in violation of Section 12 rules (Kidnapping) as laid out above or for breaking the law. This is only an option for situations that can be resolved to the satisfaction of all parties.', 'The Chairs have the reserved right to disqualify teams or individuals that are found to be in irreparable breach of these rules. Furthermore, it is the Chairs’ responsibilities to bar judges that have proven to be in breach of their expected conduct.', @@ -141,12 +138,12 @@ export const rules = { }, { title: 'Rules', - sub: 'These rules are up to the interpretation of the Havenger Scunt Chairs, and may be changed at any time.', + sub: 'These rules are up to the interpretation of the S!cavenger H!unt Chairs, and may be changed at any time.', }, { title: 'Liability', - sub: 'The University of Toronto, the Engineering Society, the Orientation Committee, and the Havenger Scunt executive committee will not be held accountable for illegal or unethical actions performed by event participants. The same parties will also not be liable for any injuries sustained through direct or indirect participation in the event.', + sub: 'The University of Toronto, the Engineering Society, the Orientation Committee, and the S!cavenger H!unt executive committee will not be held accountable for illegal or unethical actions performed by event participants. The same parties will also not be liable for any injuries sustained through direct or indirect participation in the event.', items: [], }, ], diff --git a/client/src/util/scunt-judges.jsx b/client/src/util/scunt-judges.jsx index 8a5f0cf4..a36f0230 100644 --- a/client/src/util/scunt-judges.jsx +++ b/client/src/util/scunt-judges.jsx @@ -1 +1,278 @@ -export const scuntJudges = []; +import erika from '../assets/judges/erika.jpg'; +import celin from '../assets/judges/celin.jpg'; +import ben from '../assets/judges/ben.jpg'; +import Kaija from '../assets/judges/kaija.jpeg'; +import alexi from '../assets/judges/alexi.jpg'; +import karen from '../assets/judges/karen.jpg'; +import nat from '../assets/judges/nat.jpg'; +import khalil from '../assets/judges/khalil.jpg'; +import tanya from '../assets/judges/tanya.jpg'; +import luka from '../assets/judges/luka.jpg'; +import novera from '../assets/judges/novera.jpg'; +import jeremy from '../assets/judges/jeremy.jpg'; +import rimjot from '../assets/judges/rimjot.jpg'; +import katie from '../assets/judges/katie.jpg'; +import emaan from '../assets/judges/emaan.jpg'; +import amelie from '../assets/judges/amelie.jpg'; +import tech from '../assets/judges/tech.png'; + +export const scuntJudges = [ + { + name: 'Tech Team', + description: 'Wink wink we made the website... we have unlimited bribe points...', + content: [ + 'Follow each of us on insta', + 'Star the website repo on GitHub', + 'Fix a bug on the website', + 'Coding takes energy. Energy comes from food. We like food. Enough said...', + 'Draw a nice pic of our team', + 'Appreciate the work we have given to Frosh week', + 'Have a nice convo with us :)', + ], + img: tech, + }, + { + name: 'Erika', + description: + "Waddup homies, I'm Erika (MECH 2T3 + PEY)! You can find me somewhere in the Pit- my home (15 mins) away from home <3. My favorite pasttimes include looking at pictures of otters holding hands, excessive crying, and curling up in balls until I become dirt.", + content: [ + 'A dog to pet (bonus points if it is a very very long dog, or in a hotdog costume)', + 'A smooch on the cheek from Mario Baker (bonus points for his hand in marriage)', + 'Make me a playlist', + 'An essay on why alcohol is bad and should NEVER be permitted at any and all university events, especially in the Pit (bonus points for funniness)', + 'Food of any sort', + 'Convince someone to get their jacket weened', + ], + img: erika, + }, + { + name: 'Celin', + description: + 'Heyo everyone, I"m Celin (Mech 2T5) and I commute all the way from Aurora (so sad). My toxic trait is that I make commuting my entire identity. I also love defying gravity temporarily, jumping, cats, and Skule.', + content: [ + 'Come up with a new engineering dance to an anime song and perform it', + 'Make/bring me an exotic meal under 10 dollars', + 'As many Ultimate F!rosh as you can find (past or present) doing an epic jump sequence (Bonus points for amount of UFs and creativity of jump sequence)', + 'A picture of your team with an old ttc streetcar', + 'The funniest patch you can find', + "Mr Blue and Gold's hardhat", + ], + img: celin, + }, + { + name: 'Ben', + description: + 'Hello hello I"m Ben (EngSci 2T4 + PEY)! I come from a distant rural community (KW) but I basically live in the Pit full time. I"m a big fan of truthful and accurate newspapers, as well as leafy greens! I can drive a tractor and I have (accidentally) tipped one (1) cow.', + content: [ + 'A DIY musical instrument', + 'One head of lettuce to share', + 'A drawing of me', + 'A better chair', + 'A cool rock', + 'A cool bug', + 'Blackout poetry with the Toike', + 'Something tasty', + 'A little kiss on the forehead from a SUDS manager', + ], + img: ben, + }, + { + name: 'Kaija', + description: + 'I"m Kaija and I am an EngSci (unfortunate ik) 2T5! I enjoy many normal hobbies like crocheting, singing and baking and I also enjoy even normaler hobbies like being in the pit for long periods of time, accidentally overcommitting and recreational screaming. Oh and I am from Alberta (yeehaw!) (feel free to use this against me) Uh I have bribes too, I promise', + content: [ + "Perform your favourite song for me and then explain to me why it's your favourite. (bonus points if I add it to my playlist!)", + 'Have the Lady Godiva Memorial Bnad serenade me', + 'Something I can add to my covvies (patches are good but creativity is encouraged!)', + 'Find a scunt chair (past or present) and do something nice for them (provide me with proof!)', + 'Teach me to wink with my left eye (points for effort because I am a lost cause)', + 'Make me cool new earrings', + 'Any number of bees', + ], + img: Kaija, + }, + { + name: 'Alexi', + description: + "Hello nerds!! I'm Alexi and an NΨ2T3 + PEY. Yes, the back pain has started along with fourth year, but it's fine!! I game sometimes, but my aim is so bad it actually takes skill to be as bad as me. If you can teach me to get better you'll have a special place in my heart.", + content: [ + "do 30 push-ups. If you do even one push-up with me on your back I'll give you bonus points.", + "Explain to me why when a ship transports something it's cargo but when a car transports something it's a shipment", + "Show that 9 = 10. Bonus points if you're an engineer about it", + 'Tell me why', + 'Make me laugh with your best dad joke', + 'Guess the longest distance I have ever driven in one stretch (including gas and bathroom breaks)', + "Beat me in a fair eating contest using a meal of your choice. I'll even pay you back if you win (I can't eat forever so this is a one time deal)", + ], + img: alexi, + }, + { + name: 'Karen', + description: + "Hello! My friends call me Karen and the Dean calls me trouble. I'm a ECE1T9+???, and I'm here for both a long time and also a good time. My hobbies include irrigation systems, wittowy hitting the gwiddy durwing fwosh week, and arson.", + content: [ + 'An original erotic fanfiction between Sudsman and the LGMBeaver', + "Sing for me, with guitar accompaniment, the 'Stuart Little's Not A Mouse' song by Jordan Keyes", + 'Food (must be tasty)', + 'Wear a full body denim joutfit, with minimum 5 different pieces', + 'A bottle of pickle ranch', + 'A John Denver CD', + 'patch???', + "Stella Gregorski's University Degree (folded)", + ], + img: karen, + }, + { + name: 'Nat', + description: + 'Hey party people! I"m Nat an MSE 2T4 + PEY (yes we are the material gorls). I don"t condone stealing from small local businesses, but big box corporations are free game (for legal reasons this is a joke). Ask me about my go-to vintage stores or about the time that I got lost in the city sewer system and I"d be happy to tell you!', + content: [ + 'Bring me an ultrasound of a farm animal', + 'Give a glam makeover to an engineering building', + 'A drag performer (bonus points if they perform)', + 'Make a creative disguise', + 'Some container of candy corn (bonus points if there is exactly 69 pieces inside)', + "Print and post my propaganda up around campus (bonus points if it's somewhere unexpected)", + 'A live bird (bonus points if it can talk)', + 'Something that I would find meaningful', + ], + img: nat, + }, + { + name: 'Khalil', + description: + "Hi everyone! My name's Khalil and I'm an EngSci 2T3 in the ECE option. I love computers (obviously) and have built one from part I found in the trash, live music, and video games. I just finished my PEY at intel (ik im old) and I'm also in UTAT space!", + content: [ + 'A Colins era CIV102 notebook', + "Mr B&G pants (Not the ones they're wearing please), or Lady Godiva horse", + 'Patches from another university (More points the further the uni is, or the weirder the patch is)', + 'A dog!!', + 'The smallest USB (storage-wise) you can find', + 'Old Comics', + 'Justify your favourite bubble tea', + 'Ikea Plushies', + ], + img: khalil, + }, + { + name: 'Tanya', + description: + 'Howdy! Im Tanya and an ECE 2T5, I am a fan of traveling to different countries, reading fanfics and wasting all my money on food!', + content: [ + 'bring me a live animal (extra points if its a farm animal)', + "a photo of a campus study spot I haven't been to", + 'make me a cool tattoo design', + "sing 'ole' MacDonald had a farm' in front of a mcdonalds", + 'make me a paper crown', + 'perform an animal-sound off with another scunt group (oink/bark/sheep sounds at other groups)', + 'sign one of the scunt-co-chairs body part in permeant marker', + ], + img: tanya, + }, + { + name: 'Luka', + description: + 'Hi All! I am Luka and I am a Eng Sci BME 2T3 + PEY. I am into every sport possible so I may or may not have a soft spot for sports related bribes . Other than that, I love to travel, make bad jokes, and watch sitcoms. I am also involved with UT BIOME so come talk to me if you want to learn more about biomedical design teams! ', + content: [ + 'Paint/Draw a portrait of me (needs to pass my approval) 🖼️', + 'Bring me anything purple not from your frosh kit 💜', + 'Perform the final scene of Jack and Rose in the Titanic (extra for singing “My Heart Will Go On” by Celine Dion) 🚢', + 'Bring me a hard copy of Stewart Calculus 📕', + 'Food is the way to my heart ❤️', + 'Wear some Toronto Maple Leafs gear 🍁', + 'Bring me some dog toys (bonus points if you wear a dog collar and leash while doing it)', + ], + img: luka, + }, + { + name: 'Novera', + description: + "Hiya frens, I'm Novera, an Engsci (fiziks) 2T5. If I'm not taking photos around Skule or being overcommitted to Engsoc and Design Teams, then you'll probably find me eeping through 9 am lectures, being a competitive vroom vroom gamer grill, or religiously organizing my monthly Spotify playlists.", + content: [ + 'A cat to pet and give cuddles to', + 'Signed and addressed love letter to me from anyone in Engsoc VP team (Past or Present)', + '3D CAD design me something cool', + "Live karaoke performance with backup dancers (Bonus points if you've got the fit or its one of my favourite artists)", + 'Let me talk to ur mum on the phone', + 'Print out your favorite picture of me holding a camera on photos.skule.ca and sign it', + 'Make me a DIY friendship bracelet', + 'Get me a list of people that would actually date Emaan and let me filter through it (Potentials must be upper year only)', + ], + img: novera, + }, + { + name: 'Jeremy', + description: + "Hi peeps, my name is Jeremy and I am a mech 2T3+PEY from the the good ol' USA (Seattle). If I am not busy trying to figure out how to do skule, I can usually be found on the volleyball court or at some UTAT event. Below is the list of bribes I have.", + content: [ + 'The best, leveled up, instant ramen (quality over quantity)', + 'Complete my sad patch collection (bonus points if it is old and relates to one I already have)', + 'The OG, better version of the CN Tower', + 'Come up with a nickname/pun using my name that I have not heard already', + 'Something from my favorite basketball player (hint: we have something in common)', + 'Teach me how to properly do a volleyball dolphin dive (bonus points if it is with a volleyball)', + 'A list of UTAT Executive directors past and present and the years they served', + ], + img: jeremy, + }, + { + name: 'Rimjot', + description: + "Howdy y'all! My name's Rimjot and I'm a CHEM 2T5. You'll likely spot me around a library trying to study for something or at an event with free food (we love free food)! But otherwise I really enjoy listening to music (Spotify increasing its monthly fee made me cry) and walking weirdly fast until I realize I'm walking super fast and then slowing down because suddenly I'm tired.", + content: [ + "Make me something containing flowers (bonus points if you're able to incorporate my favourite colour) (no I'm not telling you what my favourite colour is)", + "A patch to add to my collection pls (bonus points if it's not a UofT patch)", + 'Make me a little playlist', + "A picture of something that you'd find on a farm that's actually in a big city (bonus points if it's not located in a store)", + 'Find my favourite study spot', + 'Tell a Scunt Chair I said hi in an unconventional way (pls provide proof)', + ], + img: rimjot, + }, + { + name: 'Katie', + description: + "Heyyy I'm Katie. I'm an EngSci 2T5 in the Biomedical Systems Engineering option. I am literally from a town that used to be called Farmersville so Frosh this year is my thing. I can also totally be bought so please bribe me.", + content: [ + 'Sing Taylor Swift (bonus if you do All Too Well 10 minute version)', + 'Figure out my favourite night-before-a-midterm food and get it for me', + "Draw me a picture that would look good in my apartment (I'm in desperate need of artwork)", + 'Find me a patch you think would look fire on my overalls', + 'Get me a book you think I need to read', + 'DIY me something to add to my outfit', + 'Write me a poem and perform it (more drama, more points)', + ], + img: katie, + }, + { + name: 'Emaan', + description: + "Heyo cuties, I'm Emaan, an EngSci 2T5, choosing to go into the Energy Systems option after pouring my heart and soul into making it everybody else's problem because my indecisive ass has issues. For entertainment purposes, you can probably find my face stuck behind a phone documenting your life for the sole reason of subscribing you to FarmersOnly because I believe everybody deserves love! I'm a dramatic piece of shit, but also a pathological people pleaser so you can probably beg me for points but here's some potential bribes since I'm assuming (unlike me) you probably want to keep your dignity intact:", + content: [ + 'guess articles I wrote in the Toike (bonus points if you can get me to actually admit it)', + "get me a customized Iced Capp from Tims to try (note: no whipped cream, no alcohol, no FOOD in it pls i'll cry and you'll get negative points, and make sure it's under $5)", + 'get Mario to design me personalized converse', + 'for educational purposes, DM me a detailed explanation of what a red flag is (pls I need to know)', + 'get/make me fake flowers', + "love letters from people in the F!rosh Week 2T3 Marketing team (bonus points if it's from Novera)", + 'make me cool rings! (bonus points if you can get my ring size right)', + "make a tiktok/take a bereal with me because I'm into clout", + ], + img: emaan, + }, + { + name: 'Amélie', + description: + 'Hi hi I"m Amélie I"m a Mech 2T4 + PEY. l have two cats back home in Chicago named Saffron and Edward Geraldson the 3rd and I like launching things into the sky and zooming down hills', + content: [ + 'Build me a model of a rocket-propelled toboggan', + 'Put together a frosh kit for me with things around the pit', + 'Perform a mashup of the English, American, and Canadian National anthem', + 'Handstand', + 'Design a patch for me and explain the reasoning behind your design', + "Bring me the picture of my girlfriend in the varsity (I'll tell you the edition for a cookie)", + 'Haiku on why I should not go into work tomorrow', + ], + img: amelie, + }, +]; diff --git a/server/src/controllers/QrController.js b/server/src/controllers/QrController.js index edea7216..1969c9bb 100644 --- a/server/src/controllers/QrController.js +++ b/server/src/controllers/QrController.js @@ -66,7 +66,7 @@ const QrController = { try { const frosh = ( await FroshServices.getFilteredFroshInfo( - { _id: userID }, + { _id: userID, isRegistered: true }, { firstName: 1, lastName: 1, @@ -91,6 +91,39 @@ const QrController = { next(error); } }, + + async getFood(req, res, next) { + const { userID } = req.body; + + try { + const [frosh] = await FroshServices.getFilteredFroshInfo( + { _id: userID }, + { + firstName: 1, + lastName: 1, + preferredName: 1, + pronouns: 1, + medicalInfo: 1, + specficMedicalInfo: 1, + allergies: 1, + allergiesOther: 1, + gotFood: 1, + }, + ); + + if (frosh.gotFood) { + return res.status(200).send({ message: 'Food already picked up', frosh }); + } + + await FroshServices.updateFroshInfo(userID, { + gotFood: true, + }); + + return res.status(200).send({ message: 'Food picked up', frosh }); + } catch (error) { + next(error); + } + }, }; module.exports = QrController; diff --git a/server/src/middlewares/errorResponseMiddleware.js b/server/src/middlewares/errorResponseMiddleware.js index b753f226..bee91e19 100644 --- a/server/src/middlewares/errorResponseMiddleware.js +++ b/server/src/middlewares/errorResponseMiddleware.js @@ -85,6 +85,9 @@ function errorResponseMiddleware(err, req, res, next) { } else if (err.message === 'UNABLE_TO_UPDATE_SCUNT_SETTINGS') { statusCode = 400; errorMessage = 'Unable to update scunt settings. Please input valid values.'; + } else if (err.message === 'FROSH_NOT_FOUND') { + statusCode = 404; + errorMessage = 'Frosh not found. They might not be registered.'; } else { statusCode = 500; errorMessage = 'whoops we have no idea what happened!?'; diff --git a/server/src/models/FroshModel.js b/server/src/models/FroshModel.js index 311638f2..da5f154a 100644 --- a/server/src/models/FroshModel.js +++ b/server/src/models/FroshModel.js @@ -188,6 +188,11 @@ const FroshSchema = new mongoose.Schema( required: false, default: false, }, + gotFood: { + type: Boolean, + required: false, + default: false, + }, }, { discriminatorKey: 'userType' }, ); diff --git a/server/src/routes/qrRoutes.js b/server/src/routes/qrRoutes.js index ca8ea3fd..e923e533 100644 --- a/server/src/routes/qrRoutes.js +++ b/server/src/routes/qrRoutes.js @@ -48,4 +48,6 @@ router.put( router.put('/prekit', checkLoggedIn, hasAuthScopes(['scanner:kits']), QRController.preKitPickUp); +router.put('/food', checkLoggedIn, hasAuthScopes(['scanner:food']), QRController.getFood); + module.exports = router;