diff --git a/components/Event/Event.tsx b/components/Event/Event.tsx index cd03d5d..049b1ec 100644 --- a/components/Event/Event.tsx +++ b/components/Event/Event.tsx @@ -1,5 +1,5 @@ import { QueriedVolunteerEventDTO } from 'bookem-shared/src/types/database'; -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import Header from '@/components/Event/Header'; import BookIcon from '@/components/Event/BookIcon'; import EventName from '@/components/Event/EventName'; @@ -16,6 +16,9 @@ import { import { Media } from '@/lib/media'; import Footer from '@/components/Event/Footer'; import { BOOKEM_THEME } from '@/utils/constants'; +import { message } from 'antd'; +import ApplicationPopup from './EventApplication/ApplicationPopup'; + /** * Event Detail * @param event Data about the event @@ -26,6 +29,7 @@ const Event = ({ event }: { event: QueriedVolunteerEventDTO }) => { * False: display Contact */ const [showAbout, setShowAbout] = useState(true); + const [showApplication, setShowApplication] = useState(false); const handleShowAbout = () => !showAbout && setShowAbout(!showAbout); const handleShowContact = () => showAbout && setShowAbout(!showAbout); @@ -33,6 +37,48 @@ const Event = ({ event }: { event: QueriedVolunteerEventDTO }) => { * Keep track of whether this event is signed up or not */ const [signedUp, setSignedUp] = useState(false); + + /** + * keep track of the fetched application's reponse when the event requires application + */ + const [applicationResponse, setApplicationResponse] = useState(null); + + useEffect(() => { + const fetchApplicationStatus = async () => { + // Fetch the submitted application + const response = await fetch( + `/api/event/${event._id}/submitted-application`, + { + method: 'GET', + } + ); + + // console.log("response: ", response.status) + + // if the application is not found, it means the user has not applied to the event + // do nothing + if (response.status === 404 || response.status === 400) { + return; + } + + const { application: eventApplication, response: applicationResponse } = + await response.json(); + + // console.log("application: ", eventApplication) + // console.log("response: ", applicationResponse) + + // If the application is submitted, set signedUp to true + setSignedUp(true); + + // set the application response + setApplicationResponse(applicationResponse); + }; + + if (event.applicationId != null) { + fetchApplicationStatus(); + } + }, [event._id, event.applicationId]); + /** * Sign up/Unsign up the current user to the event * @param event @@ -40,32 +86,38 @@ const Event = ({ event }: { event: QueriedVolunteerEventDTO }) => { const signUpEvent = async () => { try { // If the event requires application, redirect to application page - if (event.requireApplication) { - // TODO: redirect to event application page - alert('Go to event application!'); + if (event.applicationId != null) { + if (signedUp) { + message.info('You have already applied to this event'); + return; + } + setShowApplication(true); + // console.log("application questions: ", event.applicationId) + return; - } + } else { + // Send POST request to sign up + const response = await fetch('/api/event/' + event._id, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }); - // Send POST request to sign up - const response = await fetch('/api/event/' + event._id, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }); - - // Success - if (response.status === 200) { - const message = await response.json(); - console.log(message); - // Update sign up state - setSignedUp(!signedUp); + // Success + if (response.status === 200) { + const message = await response.json(); + // console.log(message); + // Update sign up state + setSignedUp(!signedUp); + } } } catch (error) { console.error(error); } }; + console.log('event: ', event); return ( <> @@ -82,6 +134,7 @@ const Event = ({ event }: { event: QueriedVolunteerEventDTO }) => { setSignedUp={setSignedUp} event={event} signUpEvent={signUpEvent} + applicationResponses={applicationResponse} /> @@ -142,6 +195,21 @@ const Event = ({ event }: { event: QueriedVolunteerEventDTO }) => { signUpEvent={signUpEvent} /> + + {/* Application Popup */} + {event.applicationId != null && ( + { + setShowApplication(false); + }} + onSubmit={() => { + message.success('Application Submitted'); + setSignedUp(true); + }} + /> + )} ); }; diff --git a/components/Event/EventApplication/ApplicationPopup.tsx b/components/Event/EventApplication/ApplicationPopup.tsx new file mode 100644 index 0000000..3e849b2 --- /dev/null +++ b/components/Event/EventApplication/ApplicationPopup.tsx @@ -0,0 +1,130 @@ +import { Modal } from 'antd'; +import 'survey-core/defaultV2.min.css'; +import { Model } from 'survey-core'; +import { Survey } from 'survey-react-ui'; +import { useState, useEffect } from 'react'; +import { + ApplicationQuestionData, + ApplicationAnswer, + QueriedVolunteerEventDTO, +} from 'bookem-shared/src/types/database'; + +// choices can type string[] or null +const processChoices = (choices: String[] | undefined) => { + if (choices == null) { + return null; + } + + return choices.map(choice => { + return { + value: choice, + text: choice, + }; + }); +}; + +// process answes to fit the answer type. return the answer casted into application answer +const processAnswers = (answerObj: any) => { + // the key of the answer object is the question id + // the value is the answer. The value can be a string or an array of strings + // we need to convert this into an array of application answers + const answers = Object.keys(answerObj).map(key => { + const answer = answerObj[key]; + return { + questionId: key, + // check if the answer is an array, if not convert it into an array + text: Array.isArray(answer) ? answer : [answer], + }; + }); + + return answers; +}; + +const makeSurveyModel = (questions: ApplicationQuestionData[]) => { + const elements = questions.map(question => { + return { + name: question._id, + title: question.title, + type: question.type, + isRequired: question.isRequired, + choices: processChoices(question.choices), + }; + }); + + return { + elements: elements, + }; +}; + +export default function ApplicationPopup({ + visible, + onClose, + event, + onSubmit, +}: { + visible: boolean; + onClose: () => void; + event: QueriedVolunteerEventDTO; + onSubmit: () => void; +}) { + const { name } = event; + const [questions, setQuestions] = useState([]); + + let survey = new Model(makeSurveyModel(questions)); + + survey.onComplete.add(result => { + const answers = processAnswers(result.data); + console.log('Survey results: ', answers); + // send the answers to the server + fetch('/api/event/' + event._id + '/apply', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + answers: answers, + }), + }); + + onClose(); + onSubmit(); + }); + + useEffect(() => { + const fetchQuestions = async () => { + const res = await fetch('/api/event/' + event._id + '/apply', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + + // no application questions found + if (res.status === 404) { + return; + } + + const data = await res.json(); + const questions = data.message; + setQuestions(questions); + }; + // fetch the questions from the database + // set the survey model + fetchQuestions(); + }, [event._id]); + + return ( + +

+ Application for event:
+ {name} +

+ +
+ ); +} diff --git a/components/Event/EventApplication/ApplicationStatusDisplay.tsx b/components/Event/EventApplication/ApplicationStatusDisplay.tsx new file mode 100644 index 0000000..bcb4736 --- /dev/null +++ b/components/Event/EventApplication/ApplicationStatusDisplay.tsx @@ -0,0 +1,78 @@ +import { StatusDisplayText } from '@/styles/components/Event/eventName.styles'; +import { + CheckCircleOutlined, + ReadOutlined, + ExclamationCircleOutlined, +} from '@ant-design/icons'; +import { useState, useEffect } from 'react'; +import { + ApplicationStatus, + ApplicationResponseData, + QueriedVolunteerEventDTO, +} from 'bookem-shared/src/types/database'; + +const ApprovedText = () => ( + + + Approved + +); + +const PendingText = () => ( + + + Under Review + +); + +const RejectedText = () => ( + + + Rejected + +); + +const statusDisplayText = { + [ApplicationStatus.Pending]: , + [ApplicationStatus.Approved]: , + [ApplicationStatus.Rejected]: , +}; + +// Display the status of the volunteer application +// TODO: add logic for fetching application responses and display its status +const ApplicationStatusDisplay = ({ + event, + applicationResponses, +}: { + event: QueriedVolunteerEventDTO; + applicationResponses: ApplicationResponseData | null; +}) => { + if (applicationResponses?.status == null) { + return Application Required; + } + + return ( + + Application Status: +
+ {statusDisplayText[applicationResponses.status]} +
+ ); +}; + +export default ApplicationStatusDisplay; diff --git a/components/Event/EventName.tsx b/components/Event/EventName.tsx index f10c0d5..ec0922a 100644 --- a/components/Event/EventName.tsx +++ b/components/Event/EventName.tsx @@ -10,7 +10,8 @@ import { useSession } from 'next-auth/react'; import { SignupButton } from '@/styles/components/Event/event.styles'; import { Media } from '@/lib/media'; import Image from 'next/image'; - +import ApplicationStatusDisplay from '@/components/Event/EventApplication/ApplicationStatusDisplay'; +import { ApplicationResponseData } from 'bookem-shared/src/types/database'; /** * Calculate the length of the event volunteers * If event.volunteers is undefined, return 0 @@ -30,23 +31,26 @@ const EventName = ({ setSignedUp, event, signUpEvent, + applicationResponses, }: { signedUp: boolean; setSignedUp: (signedUp: boolean) => void; event: QueriedVolunteerEventDTO; signUpEvent: () => void; + applicationResponses: ApplicationResponseData | null; }) => { const { data: session } = useSession(); useEffect(() => { // Initialize signedUp according to whether the current event // contains the user or not - if (session?.user) { + // only use this when the event does not have an application + if (session?.user && !event.applicationId) { setSignedUp( event.volunteers.some(volunteer => volunteer._id === session.user._id) ); } - }, [event.volunteers, session?.user, setSignedUp]); + }, [event.volunteers, session?.user, setSignedUp, event.applicationId]); return ( @@ -58,9 +62,18 @@ const EventName = ({
{getEventLength(event)}/{event.maxSpot} spots filled - - {signedUp ? 'Signed up' : 'Sign up'} - +
+ {/* when there is an application for the event, display the status */} + {event.applicationId && ( + + )} + + {signedUp ? 'Signed up' : 'Sign up'} + +
{/* Mobile */} @@ -68,11 +81,14 @@ const EventName = ({ {event.name} ({event.program?.name})
- - - {/* TODO: display this dynamically after database schema is updated */} - {'ongoing'} - + {event.applicationId && ( + + )} + {/* */} + {/* TODO: display this dynamically after database schema is updated */}
diff --git a/package-lock.json b/package-lock.json index fe89d03..80d7575 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "react-tooltip": "^5.23.0", "sharp": "^0.31.3", "styled-components": "^6.1.8", + "survey-react-ui": "^1.9.139", "swr": "^2.0.3" }, "devDependencies": { @@ -56,15 +57,6 @@ "typescript": "4.8.4" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@ant-design/colors": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-7.0.2.tgz", @@ -74,9 +66,9 @@ } }, "node_modules/@ant-design/cssinjs": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.19.1.tgz", - "integrity": "sha512-hgQ3wiys3X0sqDKWkqCJ6EYdF79i9JCvtavmIGwuuPUKmoJXV8Ff0sY+yQQSxk2dRmMyam/bYKo/Bwor45hnZw==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.20.0.tgz", + "integrity": "sha512-uG3iWzJxgNkADdZmc6W0Ci3iQAUOvLMcM8SnnmWq3r6JeocACft4ChnY/YWvI2Y+rG/68QBla/O+udke1yH3vg==", "dependencies": { "@babel/runtime": "^7.11.1", "@emotion/hash": "^0.8.0", @@ -268,16 +260,15 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/@aws-sdk/client-cognito-identity": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.554.0.tgz", - "integrity": "sha512-/rFufn75nrCj5gTpTLIlDxjGoPeAj+gC3JLVqS2Tlpqx3YhqHiz+jYaHYJbkvrcLMEdDFqaoO3DI7y/GcD59Mg==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.564.0.tgz", + "integrity": "sha512-AJGd0RXAyycNqb8RBySVkIrzNOd8JzI4sVVC/7pA41t4EeUGM6b2tcsOlt1eVqcNxR1hvn2ZbwnNI8e3OlEnhQ==", "optional": true, "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.554.0", - "@aws-sdk/core": "3.554.0", - "@aws-sdk/credential-provider-node": "3.554.0", + "@aws-sdk/core": "3.556.0", + "@aws-sdk/credential-provider-node": "3.564.0", "@aws-sdk/middleware-host-header": "3.535.0", "@aws-sdk/middleware-logger": "3.535.0", "@aws-sdk/middleware-recursion-detection": "3.535.0", @@ -319,16 +310,15 @@ } }, "node_modules/@aws-sdk/client-s3": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.554.0.tgz", - "integrity": "sha512-d5TKKtGWhN0vl9QovUFrf3UsM7jgFQkowDPx1O+E/yeQUj1FBDOoRfDCcQOKW/9ghloI6k7f0bBpNxdd+x0oKA==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.564.0.tgz", + "integrity": "sha512-QvTjjQWC7LB18X7BRvYK6Rc1oK1nToht4KOBR+zXmz4R1TEtMpyC9xgZzzVzp2aocXV1/WuDlg8Mvssx8UmUuQ==", "dependencies": { "@aws-crypto/sha1-browser": "3.0.0", "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.554.0", - "@aws-sdk/core": "3.554.0", - "@aws-sdk/credential-provider-node": "3.554.0", + "@aws-sdk/core": "3.556.0", + "@aws-sdk/credential-provider-node": "3.564.0", "@aws-sdk/middleware-bucket-endpoint": "3.535.0", "@aws-sdk/middleware-expect-continue": "3.535.0", "@aws-sdk/middleware-flexible-checksums": "3.535.0", @@ -336,12 +326,12 @@ "@aws-sdk/middleware-location-constraint": "3.535.0", "@aws-sdk/middleware-logger": "3.535.0", "@aws-sdk/middleware-recursion-detection": "3.535.0", - "@aws-sdk/middleware-sdk-s3": "3.552.0", - "@aws-sdk/middleware-signing": "3.552.0", + "@aws-sdk/middleware-sdk-s3": "3.556.0", + "@aws-sdk/middleware-signing": "3.556.0", "@aws-sdk/middleware-ssec": "3.537.0", "@aws-sdk/middleware-user-agent": "3.540.0", "@aws-sdk/region-config-resolver": "3.535.0", - "@aws-sdk/signature-v4-multi-region": "3.552.0", + "@aws-sdk/signature-v4-multi-region": "3.556.0", "@aws-sdk/types": "3.535.0", "@aws-sdk/util-endpoints": "3.540.0", "@aws-sdk/util-user-agent-browser": "3.535.0", @@ -386,13 +376,13 @@ } }, "node_modules/@aws-sdk/client-sso": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.554.0.tgz", - "integrity": "sha512-yj6CgIxCT3UwMumEO481KH4QvwArkAPzD7Xvwe1QKgJATc9bKNEo/FxV8LfnWIJ7nOtMDxbNxYLMXH/Fs1qGaQ==", + "version": "3.556.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.556.0.tgz", + "integrity": "sha512-unXdWS7uvHqCcOyC1de+Fr8m3F2vMg2m24GPea0bg7rVGTYmiyn9mhUX11VCt+ozydrw+F50FQwL6OqoqPocmw==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/core": "3.554.0", + "@aws-sdk/core": "3.556.0", "@aws-sdk/middleware-host-header": "3.535.0", "@aws-sdk/middleware-logger": "3.535.0", "@aws-sdk/middleware-recursion-detection": "3.535.0", @@ -434,14 +424,13 @@ } }, "node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.554.0.tgz", - "integrity": "sha512-M86rkiRqbZBF5VyfTQ/vttry9VSoQkZ1oCqYF+SAGlXmD0Of8587yRSj2M4rYe0Uj7nRQIfSnhDYp1UzsZeRfQ==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.564.0.tgz", + "integrity": "sha512-LWBXiwA0qlGhpJx3fbFQagVEyVPoecGtJh3+5hoc+CTVnT00J7T0jLe3kgemvEI9kjhIyDW+MFkq1jCttrGNJw==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.554.0", - "@aws-sdk/core": "3.554.0", + "@aws-sdk/core": "3.556.0", "@aws-sdk/middleware-host-header": "3.535.0", "@aws-sdk/middleware-logger": "3.535.0", "@aws-sdk/middleware-recursion-detection": "3.535.0", @@ -482,17 +471,17 @@ "node": ">=14.0.0" }, "peerDependencies": { - "@aws-sdk/credential-provider-node": "^3.554.0" + "@aws-sdk/credential-provider-node": "^3.564.0" } }, "node_modules/@aws-sdk/client-sts": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.554.0.tgz", - "integrity": "sha512-EhaA6T0M0DNg5M8TCF1a7XJI5D/ZxAF3dgVIchyF98iNzjYgl/7U8K6hJay2A11aFvVu70g46xYMpz3Meky4wQ==", + "version": "3.556.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.556.0.tgz", + "integrity": "sha512-TsK3js7Suh9xEmC886aY+bv0KdLLYtzrcmVt6sJ/W6EnDXYQhBuKYFhp03NrN2+vSvMGpqJwR62DyfKe1G0QzQ==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/core": "3.554.0", + "@aws-sdk/core": "3.556.0", "@aws-sdk/middleware-host-header": "3.535.0", "@aws-sdk/middleware-logger": "3.535.0", "@aws-sdk/middleware-recursion-detection": "3.535.0", @@ -533,17 +522,17 @@ "node": ">=14.0.0" }, "peerDependencies": { - "@aws-sdk/credential-provider-node": "^3.554.0" + "@aws-sdk/credential-provider-node": "^3.556.0" } }, "node_modules/@aws-sdk/core": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.554.0.tgz", - "integrity": "sha512-JrG7ToTLeNf+/S3IiCUPVw9jEDB0DXl5ho8n/HwOa946mv+QyCepCuV2U/8f/1KAX0mD8Ufm/E4/cbCbFHgbSg==", + "version": "3.556.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.556.0.tgz", + "integrity": "sha512-vJaSaHw2kPQlo11j/Rzuz0gk1tEaKdz+2ser0f0qZ5vwFlANjt08m/frU17ctnVKC1s58bxpctO/1P894fHLrA==", "dependencies": { "@smithy/core": "^1.4.2", "@smithy/protocol-http": "^3.3.0", - "@smithy/signature-v4": "^2.2.1", + "@smithy/signature-v4": "^2.3.0", "@smithy/smithy-client": "^2.5.1", "@smithy/types": "^2.12.0", "fast-xml-parser": "4.2.5", @@ -554,12 +543,12 @@ } }, "node_modules/@aws-sdk/credential-provider-cognito-identity": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.554.0.tgz", - "integrity": "sha512-soF84soy9rTAfzsH1ODP0AnJt5JlsJI8k1aWtC08/Al0CZjLkxDRHzaB1wxubFyT2Ql6bpxbDfU6KDFXsQIpdA==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.564.0.tgz", + "integrity": "sha512-rjpj+VR9NbF9hg2H0gfuhbQL+6WlRVEBBxI8rweSsSm5r5exENqP+xmEdL6mmFCyM/EjDQswNs0td2tVSc/onw==", "optional": true, "dependencies": { - "@aws-sdk/client-cognito-identity": "3.554.0", + "@aws-sdk/client-cognito-identity": "3.564.0", "@aws-sdk/types": "3.535.0", "@smithy/property-provider": "^2.2.0", "@smithy/types": "^2.12.0", @@ -603,15 +592,15 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.554.0.tgz", - "integrity": "sha512-BQenhg43S6TMJHxrdjDVdVF+HH5tA1op9ZYLyJrvV5nn7CCO4kyAkkOuSAv1NkL+RZsIkW0/vHTXwQOQw3cUsg==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.564.0.tgz", + "integrity": "sha512-kiEfBoKRcbX7I/rjhVGJrTUQ0895ANhPu6KE1GRZW7wc1gIGgKGJ+0tvAqRtQjYX0U9pivEDb0dh16OF9PBFFw==", "dependencies": { - "@aws-sdk/client-sts": "3.554.0", + "@aws-sdk/client-sts": "3.556.0", "@aws-sdk/credential-provider-env": "3.535.0", "@aws-sdk/credential-provider-process": "3.535.0", - "@aws-sdk/credential-provider-sso": "3.554.0", - "@aws-sdk/credential-provider-web-identity": "3.554.0", + "@aws-sdk/credential-provider-sso": "3.564.0", + "@aws-sdk/credential-provider-web-identity": "3.556.0", "@aws-sdk/types": "3.535.0", "@smithy/credential-provider-imds": "^2.3.0", "@smithy/property-provider": "^2.2.0", @@ -624,16 +613,16 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.554.0.tgz", - "integrity": "sha512-poX/+2OE3oxqp4f5MiaJh251p8l+bzcFwgcDBwz0e2rcpvMSYl9jw4AvGnCiG2bmf9yhNJdftBiS1A+KjxV0qA==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.564.0.tgz", + "integrity": "sha512-HXD5ZCXzfcd6cJ/pW8frh8DuYlKaCd/JKmwzuCRUxgxZwbLEeNmyRYvF+D7osETJJZ4VIwgVbpEw1yLqRz1onw==", "dependencies": { "@aws-sdk/credential-provider-env": "3.535.0", "@aws-sdk/credential-provider-http": "3.552.0", - "@aws-sdk/credential-provider-ini": "3.554.0", + "@aws-sdk/credential-provider-ini": "3.564.0", "@aws-sdk/credential-provider-process": "3.535.0", - "@aws-sdk/credential-provider-sso": "3.554.0", - "@aws-sdk/credential-provider-web-identity": "3.554.0", + "@aws-sdk/credential-provider-sso": "3.564.0", + "@aws-sdk/credential-provider-web-identity": "3.556.0", "@aws-sdk/types": "3.535.0", "@smithy/credential-provider-imds": "^2.3.0", "@smithy/property-provider": "^2.2.0", @@ -661,12 +650,12 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.554.0.tgz", - "integrity": "sha512-8QPpwBA31i/fZ7lDZJC4FA9EdxLg5SJ8sPB2qLSjp5UTGTYL2HRl0Eznkb7DXyp/wImsR/HFR1NxuFCCVotLCg==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.564.0.tgz", + "integrity": "sha512-Wv0NV8tDwtydEpsp/kVZ22Z+40bsSBDYgYZ1Uxx+KR8a1PvT6B5FnEtccWTJ371sQG/uqLum7dXSbJq1Qqze1w==", "dependencies": { - "@aws-sdk/client-sso": "3.554.0", - "@aws-sdk/token-providers": "3.554.0", + "@aws-sdk/client-sso": "3.556.0", + "@aws-sdk/token-providers": "3.564.0", "@aws-sdk/types": "3.535.0", "@smithy/property-provider": "^2.2.0", "@smithy/shared-ini-file-loader": "^2.4.0", @@ -678,11 +667,11 @@ } }, "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.554.0.tgz", - "integrity": "sha512-HN54DzLjepw5ZWSF9ycGevhFTyg6pjLuLKy5Y8t/f1jFDComzYdGEDe0cdV9YO653W3+PQwZZGz09YVygGYBLg==", + "version": "3.556.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.556.0.tgz", + "integrity": "sha512-R/YAL8Uh8i+dzVjzMnbcWLIGeeRi2mioHVGnVF+minmaIkCiQMZg2HPrdlKm49El+RljT28Nl5YHRuiqzEIwMA==", "dependencies": { - "@aws-sdk/client-sts": "3.554.0", + "@aws-sdk/client-sts": "3.556.0", "@aws-sdk/types": "3.535.0", "@smithy/property-provider": "^2.2.0", "@smithy/types": "^2.12.0", @@ -693,22 +682,22 @@ } }, "node_modules/@aws-sdk/credential-providers": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.554.0.tgz", - "integrity": "sha512-UMmJ4M7RknSz1p0981t57QUw6DibPEo/GG8+env6Q8dHrEc3pnRL206f1zxLcqzT5RI50XstH/bDtnyC7uRYiw==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.564.0.tgz", + "integrity": "sha512-QQrVTPuRRK37IEtCqzGpStfvr5fZMqxlCQFNJ6mDpHOkL1oyrYIrBpWCB4N95dJyoyLsogleDoFZelfjM9HIzQ==", "optional": true, "dependencies": { - "@aws-sdk/client-cognito-identity": "3.554.0", - "@aws-sdk/client-sso": "3.554.0", - "@aws-sdk/client-sts": "3.554.0", - "@aws-sdk/credential-provider-cognito-identity": "3.554.0", + "@aws-sdk/client-cognito-identity": "3.564.0", + "@aws-sdk/client-sso": "3.556.0", + "@aws-sdk/client-sts": "3.556.0", + "@aws-sdk/credential-provider-cognito-identity": "3.564.0", "@aws-sdk/credential-provider-env": "3.535.0", "@aws-sdk/credential-provider-http": "3.552.0", - "@aws-sdk/credential-provider-ini": "3.554.0", - "@aws-sdk/credential-provider-node": "3.554.0", + "@aws-sdk/credential-provider-ini": "3.564.0", + "@aws-sdk/credential-provider-node": "3.564.0", "@aws-sdk/credential-provider-process": "3.535.0", - "@aws-sdk/credential-provider-sso": "3.554.0", - "@aws-sdk/credential-provider-web-identity": "3.554.0", + "@aws-sdk/credential-provider-sso": "3.564.0", + "@aws-sdk/credential-provider-web-identity": "3.556.0", "@aws-sdk/types": "3.535.0", "@smithy/credential-provider-imds": "^2.3.0", "@smithy/property-provider": "^2.2.0", @@ -823,15 +812,15 @@ } }, "node_modules/@aws-sdk/middleware-sdk-s3": { - "version": "3.552.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.552.0.tgz", - "integrity": "sha512-9KzOqsbwJJuQcpmrpkkIftjPahB1bsrcWalYzcVqKCgHCylhkSHW2tX+uGHRnvAl9iobQD5D7LUrS+cv0NeQ/Q==", + "version": "3.556.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.556.0.tgz", + "integrity": "sha512-4W/dnxqj1B6/uS/5Z+3UHaqDDGjNPgEVlqf5d3ToOFZ31ZfpANwhcCmyX39JklC4aolCEi9renQ5wHnTCC8K8g==", "dependencies": { "@aws-sdk/types": "3.535.0", "@aws-sdk/util-arn-parser": "3.535.0", "@smithy/node-config-provider": "^2.3.0", "@smithy/protocol-http": "^3.3.0", - "@smithy/signature-v4": "^2.2.1", + "@smithy/signature-v4": "^2.3.0", "@smithy/smithy-client": "^2.5.1", "@smithy/types": "^2.12.0", "@smithy/util-config-provider": "^2.3.0", @@ -842,14 +831,14 @@ } }, "node_modules/@aws-sdk/middleware-signing": { - "version": "3.552.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.552.0.tgz", - "integrity": "sha512-ZjOrlEmwjhbmkINa4Zx9LJh+xb/kgEiUrcfud2kq/r8ath1Nv1/4zalI9jHnou1J+R+yS+FQlXLXHSZ7vqyFbA==", + "version": "3.556.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.556.0.tgz", + "integrity": "sha512-kWrPmU8qd3gI5qzpuW9LtWFaH80cOz1ZJDavXx6PRpYZJ5JaKdUHghwfDlVTzzFYAeJmVsWIkPcLT5d5mY5ZTQ==", "dependencies": { "@aws-sdk/types": "3.535.0", "@smithy/property-provider": "^2.2.0", "@smithy/protocol-http": "^3.3.0", - "@smithy/signature-v4": "^2.2.1", + "@smithy/signature-v4": "^2.3.0", "@smithy/types": "^2.12.0", "@smithy/util-middleware": "^2.2.0", "tslib": "^2.6.2" @@ -903,11 +892,11 @@ } }, "node_modules/@aws-sdk/s3-request-presigner": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.554.0.tgz", - "integrity": "sha512-499skN4HpUNXasxmCnuiAuBvx3SzYLKK0WnfXk8cnEZq13981c8lDZRjSwOBCxGl5M3bCht2wiJ2fmjz/HtYWQ==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.564.0.tgz", + "integrity": "sha512-SLsh0pIYeFqzyG5VBdBM8mtXUsj1ZF2TTA1XABb/gP6WGthePVmDkKklmsmhIyJs91DxwrU6X2HH1d6RFYwQ9A==", "dependencies": { - "@aws-sdk/signature-v4-multi-region": "3.552.0", + "@aws-sdk/signature-v4-multi-region": "3.556.0", "@aws-sdk/types": "3.535.0", "@aws-sdk/util-format-url": "3.535.0", "@smithy/middleware-endpoint": "^2.5.1", @@ -921,14 +910,14 @@ } }, "node_modules/@aws-sdk/signature-v4-multi-region": { - "version": "3.552.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.552.0.tgz", - "integrity": "sha512-cC11/5ahp+LaBCq7cR+51AM2ftf6m9diRd2oWkbEpjSiEKQzZRAltUPZAJM6NXGypmDODQDJphLGt45tvS+8kg==", + "version": "3.556.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.556.0.tgz", + "integrity": "sha512-bWDSK0ggK7QzAOmPZGv29UAIZocL1MNY7XyOvm3P3P1U3tFMoIBilQQBLabXyHoZ9J3Ik0Vv4n95htUhRQ35ow==", "dependencies": { - "@aws-sdk/middleware-sdk-s3": "3.552.0", + "@aws-sdk/middleware-sdk-s3": "3.556.0", "@aws-sdk/types": "3.535.0", "@smithy/protocol-http": "^3.3.0", - "@smithy/signature-v4": "^2.2.1", + "@smithy/signature-v4": "^2.3.0", "@smithy/types": "^2.12.0", "tslib": "^2.6.2" }, @@ -937,11 +926,11 @@ } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.554.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.554.0.tgz", - "integrity": "sha512-KMMQ5Cw0FUPL9H8g69Lp08xtzRo7r/MK+lBV6LznWBbCP/NwtZ8awVHaPy2P31z00cWtu9MYkUTviWPqJTaBvg==", + "version": "3.564.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.564.0.tgz", + "integrity": "sha512-Kk5ixcl9HjqwzfBJZGQAtsqwKa7Z8P7Mdug837BG8zCJbhf7wwNsmItzXTiAlpVrDZyT8P1yWIxsLOS1YUtmow==", "dependencies": { - "@aws-sdk/client-sso-oidc": "3.554.0", + "@aws-sdk/client-sso-oidc": "3.564.0", "@aws-sdk/types": "3.535.0", "@smithy/property-provider": "^2.2.0", "@smithy/shared-ini-file-loader": "^2.4.0", @@ -2589,9 +2578,9 @@ "dev": true }, "node_modules/@types/qs": { - "version": "6.9.14", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", - "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==", + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", "dev": true }, "node_modules/@types/range-parser": { @@ -2952,9 +2941,9 @@ } }, "node_modules/antd": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/antd/-/antd-5.16.1.tgz", - "integrity": "sha512-XAlLRrgYV+nj9FHnkXEPS6HNcKcluEa8v44e7Cixjlp8aOXRhUI6IfZaKpc2MPGjQ+06rp62/dsxOUNJW9kfLA==", + "version": "5.16.4", + "resolved": "https://registry.npmjs.org/antd/-/antd-5.16.4.tgz", + "integrity": "sha512-H3LtVz5hiNgs0lL8U6pzi11rluR6RDRw1cm2pWX6CsvgZmybWsaTBV2h+d+zmgFfuch53TWs5uztLdAldIoYYw==", "dependencies": { "@ant-design/colors": "^7.0.2", "@ant-design/cssinjs": "^1.18.5", @@ -2965,12 +2954,12 @@ "@rc-component/color-picker": "~1.5.3", "@rc-component/mutate-observer": "^1.1.0", "@rc-component/tour": "~1.14.2", - "@rc-component/trigger": "^2.0.0", + "@rc-component/trigger": "^2.1.1", "classnames": "^2.5.1", "copy-to-clipboard": "^3.3.3", "dayjs": "^1.11.10", "qrcode.react": "^3.1.0", - "rc-cascader": "~3.24.0", + "rc-cascader": "~3.24.1", "rc-checkbox": "~3.2.0", "rc-collapse": "~3.7.3", "rc-dialog": "~9.4.0", @@ -2985,13 +2974,13 @@ "rc-motion": "^2.9.0", "rc-notification": "~5.4.0", "rc-pagination": "~4.0.4", - "rc-picker": "~4.3.0", + "rc-picker": "~4.4.1", "rc-progress": "~4.0.0", "rc-rate": "~2.12.0", "rc-resize-observer": "^1.4.0", "rc-segmented": "~2.3.0", - "rc-select": "~14.13.0", - "rc-slider": "~10.5.0", + "rc-select": "~14.13.1", + "rc-slider": "~10.6.1", "rc-steps": "~6.0.1", "rc-switch": "~4.1.0", "rc-table": "~7.45.4", @@ -3341,9 +3330,9 @@ } }, "node_modules/aws-sdk": { - "version": "2.1599.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1599.0.tgz", - "integrity": "sha512-jPb1LAN+s1TLTK+VR3TTJLr//sb3AhhT60Bm9jxB5G/fVeeRczXtBtixNpQ00gksQdkstILYLc9S6MuKMsksxA==", + "version": "2.1608.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1608.0.tgz", + "integrity": "sha512-qqmKS6PRNTRO+O3ZVp9+tvB6asy5uRYDpR6AhSrnhu46JtDpI47aB/O9vyykqQf3JsFu0loinDJjl2hxQoal9A==", "hasInstallScript": true, "dependencies": { "buffer": "4.9.2", @@ -3518,7 +3507,7 @@ }, "node_modules/bookem-shared": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/ChangePlusPlusVandy/bookem-shared.git#d184ec6c0171d8758d1ce887433aaf53ec0e4aa4", + "resolved": "git+ssh://git@github.com/ChangePlusPlusVandy/bookem-shared.git#e30cbd819afd199dee2c5166745348df15b50a12", "license": "ISC", "dependencies": { "mongoose": "^6.8.3" @@ -3664,9 +3653,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001609", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001609.tgz", - "integrity": "sha512-JFPQs34lHKx1B5t1EpQpWH4c+29zIyn/haGsbpfq3suuV9v56enjFt23zqijxGTMwy1p/4H2tjnQMY+p1WoAyA==", + "version": "1.0.30001612", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001612.tgz", + "integrity": "sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==", "funding": [ { "type": "opencollective", @@ -4517,14 +4506,14 @@ "dev": true }, "node_modules/es-iterator-helpers": { - "version": "1.0.18", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.18.tgz", - "integrity": "sha512-scxAJaewsahbqTYrGKJihhViaM6DDZDDoucfvzNbK0pOren1g/daDQ3IAhzn+1G14rBG7w+i5N+qul60++zlKA==", + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", + "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", "dev": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.23.0", + "es-abstract": "^1.23.3", "es-errors": "^1.3.0", "es-set-tostringtag": "^2.0.3", "function-bind": "^1.1.2", @@ -4903,9 +4892,9 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", - "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", + "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", "dev": true, "engines": { "node": ">=10" @@ -6453,9 +6442,9 @@ } }, "node_modules/joi": { - "version": "17.12.3", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.12.3.tgz", - "integrity": "sha512-2RRziagf555owrm9IRVtdKynOBeITiDpuZqIpgwqXShPncPKNiRQoiGsl/T8SQdq+8ugRzH2LqY67irr2y/d+g==", + "version": "17.13.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.0.tgz", + "integrity": "sha512-9qcrTyoBmFZRNHeVP4edKqIUEgFzq7MHvTNSDuHSqkpOPtiBkgNgcmTSqmiw1kw9tdKaiddvIDv/eCJDxmqWCA==", "dev": true, "dependencies": { "@hapi/hoek": "^9.3.0", @@ -7609,9 +7598,9 @@ } }, "node_modules/node-abi": { - "version": "3.57.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.57.0.tgz", - "integrity": "sha512-Dp+A9JWxRaKuHP35H77I4kCKesDy5HUDEmScia2FyncMTOXASMyg251F5PhFoDA5uqBrDDffiLpbqnrZmNXW+g==", + "version": "3.62.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", + "integrity": "sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==", "dependencies": { "semver": "^7.3.5" }, @@ -7897,17 +7886,17 @@ } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -8628,9 +8617,9 @@ } }, "node_modules/rc-picker": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/rc-picker/-/rc-picker-4.3.2.tgz", - "integrity": "sha512-2NtobLxG2YqllXn4YczbupgIH6PSqzjCfFCnGlgPIY9k0HZti8WmBPjS1OD9JKQl+Tdg0pMVUeTEc07y4X9ZRQ==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/rc-picker/-/rc-picker-4.4.2.tgz", + "integrity": "sha512-MdbAXvwiGyhb+bHe66qPps8xPQivzEgcyCp3/MPK4T+oER0gOmVRCEDxaD4FhYG/7GLH3rDrHpu79BvEn2JFTQ==", "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/trigger": "^2.0.0", @@ -8748,13 +8737,13 @@ } }, "node_modules/rc-slider": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-10.5.0.tgz", - "integrity": "sha512-xiYght50cvoODZYI43v3Ylsqiw14+D7ELsgzR40boDZaya1HFa1Etnv9MDkQE8X/UrXAffwv2AcNAhslgYuDTw==", + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-10.6.2.tgz", + "integrity": "sha512-FjkoFjyvUQWcBo1F3RgSglky3ar0+qHLM41PlFVYB4Bj3RD8E/Mv7kqMouLFBU+3aFglMzzctAIWRwajEuueSw==", "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.5", - "rc-util": "^5.27.0" + "rc-util": "^5.36.0" }, "engines": { "node": ">=8.x" @@ -8929,14 +8918,14 @@ } }, "node_modules/rc-util/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" }, "node_modules/rc-virtual-list": { - "version": "3.11.4", - "resolved": "https://registry.npmjs.org/rc-virtual-list/-/rc-virtual-list-3.11.4.tgz", - "integrity": "sha512-NbBi0fvyIu26gP69nQBiWgUMTPX3mr4FcuBQiVqagU0BnuX8WQkiivnMs105JROeuUIFczLrlgUhLQwTWV1XDA==", + "version": "3.11.5", + "resolved": "https://registry.npmjs.org/rc-virtual-list/-/rc-virtual-list-3.11.5.tgz", + "integrity": "sha512-iZRW99m5jAxtwKNPLwUrPryurcnKpXBdTyhuBp6ythf7kg/otKO5cCiIvL55GQwU0QGSlouQS0tnkciRMJUwRQ==", "dependencies": { "@babel/runtime": "^7.20.0", "classnames": "^2.2.6", @@ -8965,9 +8954,9 @@ } }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -8976,15 +8965,15 @@ } }, "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "dependencies": { "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" + "scheduler": "^0.23.2" }, "peerDependencies": { - "react": "^18.2.0" + "react": "^18.3.1" } }, "node_modules/react-hook-form": { @@ -9298,9 +9287,9 @@ "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "dependencies": { "loose-envify": "^1.1.0" } @@ -9899,6 +9888,11 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, + "node_modules/styled-components/node_modules/stylis": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.1.tgz", + "integrity": "sha512-EQepAV+wMsIaGVGX1RECzgrcqRRU/0sYOHkeLsZ3fzHaHXZy4DaOOX0vOlGQdlsjkh3mFHAIlVimpwAs4dslyQ==" + }, "node_modules/styled-components/node_modules/tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", @@ -9927,9 +9921,9 @@ } }, "node_modules/stylis": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.1.tgz", - "integrity": "sha512-EQepAV+wMsIaGVGX1RECzgrcqRRU/0sYOHkeLsZ3fzHaHXZy4DaOOX0vOlGQdlsjkh3mFHAIlVimpwAs4dslyQ==" + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.2.tgz", + "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==" }, "node_modules/supports-color": { "version": "7.2.0", @@ -9955,6 +9949,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/survey-core": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/survey-core/-/survey-core-1.10.1.tgz", + "integrity": "sha512-E7wYgB1rkq/AM50kDVMwC1ptEsOOTi1TZcYk1wCYGsLZK++vn1yCGzGS0k3UN14BETYIPLFBJE6Wxy+Qy0Wp7Q==", + "peer": true + }, + "node_modules/survey-react-ui": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/survey-react-ui/-/survey-react-ui-1.10.1.tgz", + "integrity": "sha512-wYzXMi2gGpd/196E4U3Tt0lkYFhwU+U/uCAsZt7ADiIGlK+FP3hQvfPXX9RvVdwnr5rmvEKdm+GJMdOBu+AklQ==", + "peerDependencies": { + "react": "^16.5.0 || ^17.0.1 || ^18.2.0", + "react-dom": "^16.5.0 || ^17.0.1 || ^18.2.0", + "survey-core": "*" + } + }, "node_modules/swr": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/swr/-/swr-2.2.5.tgz", @@ -10377,9 +10387,9 @@ "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" }, "node_modules/use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", + "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } @@ -10591,6 +10601,15 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index a311959..016dfc9 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "react-tooltip": "^5.23.0", "sharp": "^0.31.3", "styled-components": "^6.1.8", + "survey-react-ui": "^1.9.139", "swr": "^2.0.3" }, "devDependencies": { diff --git a/pages/api/event/[id]/apply.ts b/pages/api/event/[id]/apply.ts index 41d4436..038b823 100644 --- a/pages/api/event/[id]/apply.ts +++ b/pages/api/event/[id]/apply.ts @@ -42,7 +42,7 @@ export default async function handler( // query volunteerApplication by event id attributes const volunteerApplication = await VolunteerApplications.findOne({ - eventId: id, + event: id, }); if (!volunteerApplication) { @@ -78,9 +78,9 @@ export default async function handler( await mongoSession.withTransaction(async () => { // insert the response to applicationResponses data const newResponse = new ApplicationResponse({ - userId: session.user._id, + user: session.user._id, status: 'pending', - eventId: id, + event: id, answers, }); diff --git a/styles/components/Event/eventName.styles.tsx b/styles/components/Event/eventName.styles.tsx index 3f2f04d..34eff19 100644 --- a/styles/components/Event/eventName.styles.tsx +++ b/styles/components/Event/eventName.styles.tsx @@ -27,6 +27,12 @@ export const NameAndSpot = styled.div` } `; +export const StatusDisplayText = styled.div` + font-size: 25px; + margin-top: 10px; + color: gray; +`; + /** * Contain a bullet point and a status */