Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap getAndAssignProjects with db.runTransaction #629

Merged
merged 29 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
00a9669
Merge pull request #605 from nwplus/dev
martincai8 Oct 1, 2024
7c51e51
Merge pull request #607 from nwplus/dev
martincai8 Oct 1, 2024
5e2443d
Merge pull request #608 from nwplus/dev
martincai8 Oct 1, 2024
123af66
Merge pull request #610 from nwplus/dev
martincai8 Oct 2, 2024
fd896d4
turn visit website on for HC
martincai8 Oct 2, 2024
d17484d
undo visit website
martincai8 Oct 2, 2024
7a69627
Merge pull request #614 from nwplus/dev
martincai8 Oct 2, 2024
ef35b26
Merge pull request #616 from nwplus/dev
martincai8 Oct 3, 2024
40ee2b8
don't redirect to closed page when user is on the main application da…
martincai8 Oct 16, 2024
a918d40
Add updated hackcamp colors
daniel-panhead Oct 17, 2024
42f016a
Merge pull request #619 from nwplus/application-closed-dashboard
martincai8 Oct 18, 2024
30f7d12
Merge pull request #620 from nwplus/daniel/new-hc-colors
martincai8 Oct 18, 2024
41853f1
remove charcuterie from sidebar
martincai8 Oct 19, 2024
48f1161
yay
martincai8 Oct 19, 2024
11f3d83
Merge pull request #621 from nwplus/redirect-fix
martincai8 Oct 19, 2024
e96e677
small fixes
martincai8 Oct 19, 2024
21ea7e6
Merge pull request #622 from nwplus/small-fixes
martincai8 Oct 19, 2024
2f03304
only access portal when is live
DonaldKLee Oct 21, 2024
ba4e062
Merge pull request #623 from nwplus/route-fix
martincai8 Oct 21, 2024
cee3054
add feature q, add waiver links, removed mentorship
tdanielles Oct 22, 2024
aca9808
make radio buttons into checkboxes and change their values to booleans
martincai8 Oct 22, 2024
f7c780c
reskin the ticket
martincai8 Oct 23, 2024
11b9ea7
yay responsiveness
martincai8 Oct 23, 2024
a25f1e7
updated text
DonaldKLee Oct 23, 2024
e440dcc
Merge pull request #624 from nwplus/hc-rsvp-page-update
DonaldKLee Oct 23, 2024
db5ba0c
Merge pull request #625 from nwplus/ticket-reskin
martincai8 Oct 23, 2024
ee93d3a
wrap getAndAssignProjects with db.runTransaction
tdanielles Oct 29, 2024
d8fe8dc
replaced methods to transaction
tdanielles Oct 29, 2024
8140c9a
add error handling for functions
tdanielles Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
521 changes: 521 additions & 0 deletions src/assets/hc2024qrcode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions src/assets/hc_background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 50 additions & 22 deletions src/components/ApplicationDashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,14 @@ const Dashboard = ({
setMediaConsentCheck,
ageOfMajoritySelect,
setAgeOfMajoritySelect,
willBeAttendingSelect,
setWillBeAttendingSelect,
willBeAttendingCheck,
setWillBeAttendingCheck,
safewalkSelect,
setSafewalkSelect,
nwMentorshipSelect,
setNwMentorshipSelect,
// nwMentorshipSelect,
// setNwMentorshipSelect,
hcFeatureSelect,
setHcFeatureSelect,
username,
editApplication,
relevantDates,
Expand All @@ -395,9 +397,10 @@ const Dashboard = ({
const [releaseLiability, setReleaseLiability] = useState(releaseLiabilityCheck || undefined)
const [mediaConsent, setMediaConsent] = useState(mediaConsentCheck || undefined)
// const [ageOfMajority, setAgeOfMajority] = useState(ageOfMajoritySelect || undefined)
const [willBeAttending, setWillBeAttending] = useState(willBeAttendingSelect || undefined)
const [willBeAttending, setWillBeAttending] = useState(willBeAttendingCheck || false)
const [safewalk, setSafewalk] = useState(safewalkSelect || undefined)
const [nwMentorship, setNwMentorship] = useState(nwMentorshipSelect || undefined)
// const [nwMentorship, setNwMentorship] = useState(nwMentorshipSelect || undefined)
const [hcFeature, setHcFeature] = useState(hcFeatureSelect || false)

const hackerRSVPStatus = hackerStatuses()[hackerStatus]?.sidebarText

Expand Down Expand Up @@ -430,19 +433,24 @@ const Dashboard = ({
// setAgeOfMajoritySelect(e.target.value)
// }

const handleWillBeAttendingSelectChange = e => {
setWillBeAttending(e.target.value)
setWillBeAttendingSelect(e.target.value)
const handleWillBeAttendingChange = () => {
setWillBeAttending(!willBeAttending)
setWillBeAttendingCheck(!willBeAttendingCheck)
}

const handleSafewalkSelectChange = e => {
setSafewalk(e.target.value)
setSafewalkSelect(e.target.value)
}

const handleNwMentorshipSelectChange = e => {
setNwMentorship(e.target.value)
setNwMentorshipSelect(e.target.value)
// const handleNwMentorshipSelectChange = e => {
// setNwMentorship(e.target.value)
// setNwMentorshipSelect(e.target.value)
// }

const handleHcFeatureChange = value => {
setHcFeature(value)
setHcFeatureSelect(value)
}

const handleRSVPClick = () => {
Expand Down Expand Up @@ -495,15 +503,11 @@ const Dashboard = ({
{relevantDates.hackathonWeekend}? <Required />
</QuestionLabel>
<SelectOptionContainer>
<input
type="radio"
id="willBeAttendingYes"
name="willBeAttendingYes"
value="willBeAttendingYes"
checked={willBeAttending === 'willBeAttendingYes'}
onChange={handleWillBeAttendingSelectChange}
<Checkbox
checked={willBeAttending}
onChange={handleWillBeAttendingChange}
label="Yes, I will be attending"
/>
<label htmlFor="willBeAttendingYes">Yes</label>
</SelectOptionContainer>
</SelectContainer>

Expand Down Expand Up @@ -594,7 +598,7 @@ const Dashboard = ({
width="130px"
target="_blank"
rel="noopener noreferrer"
href={waiversAndForms.COVID}
href={waiversAndForms.covid}
>
Read Full Waiver.
</A>{' '}
Expand Down Expand Up @@ -632,6 +636,30 @@ const Dashboard = ({
</QuestionContainer>

<SelectContainer>
<QuestionLabel>HackCamp 2024 Feature Preference</QuestionLabel>
<P>
We are looking for people to be featured in interview videos about their experience
at HackCamp. Filming will take ~10 mins and will take place during Build Day
(Sunday, November 10th). If chosen, our team will reach out with further
instructions. Are you interested in participating?{' '}
</P>
<SelectOptionContainer>
<Checkbox
checked={hcFeature}
onChange={() => handleHcFeatureChange(true)}
label="Yes"
/>
</SelectOptionContainer>
<SelectOptionContainer>
<Checkbox
checked={!hcFeature}
onChange={() => handleHcFeatureChange(false)}
label="No"
/>
</SelectOptionContainer>
</SelectContainer>

{/* <SelectContainer>
<QuestionLabel>nwMentorship Program</QuestionLabel>
<P>
I would like to participate in the nwMentorship program to connect with an industry
Expand Down Expand Up @@ -669,7 +697,7 @@ const Dashboard = ({
/>
<label htmlFor="nwMentorshipNo">No</label>
</SelectOptionContainer>
</SelectContainer>
</SelectContainer> */}
</>
)}

Expand Down
19 changes: 8 additions & 11 deletions src/components/MobileMenuBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,22 @@ const MobileMenuBarContainer = styled.div`
display: none;
z-index: 100;
${p => p.theme.mediaQueries.mobile} {
padding: 15px;
display: inline-block;
text-align: center;
padding: 15px 0;
width: 100%;
box-sizing: border-box;
// -webkit-box-shadow: 0 6px 8px -8px #000;
// -moz-box-shadow: 0 6px 8px -8px #000;
// box-shadow: 0 6px 8px -8px #000;

display: flex;
justify-content: center;
align-items: center;
}
`

const Logo = styled.img`
display: inline-block;
margin-left: -50px;
width: 40px;
height: 60px;
`

const Menu = styled.img`
float: left;
position: absolute;
left: 20px;
width: 30px;
cursor: pointer;
`
Expand Down
129 changes: 73 additions & 56 deletions src/components/QrCode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ import styled from 'styled-components'
import { useQRCode } from 'next-qrcode'
// import JsPDF from 'jspdf'
// import html2canvas from 'html2canvas'
import qrcodeBackground from '../assets/cmdf2024qrcode.svg'
import qrcodeBackground from '../assets/hc2024qrcode.svg'
import AppleWalletButtonImage from '../assets/apple_wallet_button.svg'

const QRContainer = styled.div`
display: flex;
z-index: 98;
${p => p.theme.mediaQueries.mobile} {
justify-content: space-around;

${p => p.theme.mediaQueries.tabletLarge} {
flex-direction: column;
align-items: center;
justify-content: center;
}
`

Expand All @@ -20,21 +23,43 @@ const QRContainer = styled.div`
// display: flex;
// `

const QRCodeDesignContainer = styled.div``
const QRTicketContainer = styled.div`
position: relative;
width: 442.8px;
height: 583.2px;
margin-top: 30px;

${p => p.theme.mediaQueries.mobile} {
width: 354.24px;
height: 464.4px;
}
`

const QRCodeBackground = styled.img`
position: absolute;
width: 442.8px;
height: 583.2px;

${p => p.theme.mediaQueries.mobile} {
width: 354.24px;
height: 464.4px;
}
`

const QRCodeDesign = styled.div`
display: flex;
flex-direction: column;
align-items: flex-start;
position: relative;
width: 300px;
height: 500px;
background-size: 100% auto;
background-repeat: no-repeat;
padding: 45px;
left: 50px;
top: 80px;
border-radius: 20px;
z-index: 10;
background-image: url(${qrcodeBackground});
margin: 0 auto;
display: block;
margin-top: 30px;

${p => p.theme.mediaQueries.mobile} {
left: 30px;
top: 40px;
}
`

const HackerName = styled.h1`
Expand All @@ -43,12 +68,20 @@ const HackerName = styled.h1`
margin-top: 60px;
position: relative;
color: ${p => p.theme.colors.cardText};

${p => p.theme.mediaQueries.mobile} {
font-size: 1.5em;
}
`

const HackerEmail = styled.p`
color: #2e2e2e !important;
font-size: 1.2em;
margin-top: -10px;

${p => p.theme.mediaQueries.mobile} {
font-size: 1em;
}
`

const QRTags = styled.div`
Expand Down Expand Up @@ -78,14 +111,6 @@ const QRTags = styled.div`
// display: block;
// `

const QRTicketContainer = styled.div`
float: left;
width: 50%;
${p => p.theme.mediaQueries.mobile} {
float: none;
width: 100%;
}
`
const QRInfo = styled.div`
float: right;
width: 45%;
Expand All @@ -94,7 +119,7 @@ const QRInfo = styled.div`

${p => p.theme.mediaQueries.mobile} {
float: none;
margin-top: 0;
margin-top: 20px;
width: 100%;
padding-left: 0px;
}
Expand Down Expand Up @@ -125,9 +150,6 @@ const QRInfoName = styled.h1`
const QRInfoDes = styled.p``

const AppleWalletButton = styled.button`
position: absolute;
left: 40px;
bottom: 100px;
width: 110px;
height: 35px;
padding: 10px;
Expand All @@ -136,7 +158,9 @@ const AppleWalletButton = styled.button`
background-size: auto auto;
background-color: transparent;
cursor: pointer;
margin-top: 30px;
`

// temporary comment out for lint fix
// const generatePDF = () => {
// // const report = new JsPDF('portrait', 'pt', [300, 500.01])
Expand Down Expand Up @@ -171,48 +195,41 @@ const QrCode = ({ userInfo, userId }) => {
<QRInfoMobileWelcome>Welcome, {userInfo.displayName}!</QRInfoMobileWelcome>

<QRTicketContainer>
<QRCodeDesignContainer>
<QRCodeDesign id="QRCodeContainer">
<HackerName>{userInfo.displayName}</HackerName>
<HackerEmail>{userInfo.email}</HackerEmail>
<QRCodeBackground src={qrcodeBackground} />
<QRCodeDesign id="QRCodeContainer">
<HackerName>{userInfo.displayName}</HackerName>
<HackerEmail>{userInfo.email}</HackerEmail>

<QRTags>
{/* {userInfo.safewalkNote ? <SafeWalk>SafeWalk: Yes</SafeWalk> : <SafeWalk >SafeWalk: No</SafeWalk>}
<QRTags>
{/* {userInfo.safewalkNote ? <SafeWalk>SafeWalk: Yes</SafeWalk> : <SafeWalk >SafeWalk: No</SafeWalk>}
<ShirtSize></ShirtSize>
<Allergies></Allergies> */}
</QRTags>

<Canvas
text={userId}
options={{
level: 'M',
margin: 2,
scale: 3,
width: 140,
color: {
dark: '#000000',
light: '#FFFFFF',
},
}}
/>

{/* <QRInstructions>Please hold onto this QR Code for check-in, meals, etc</QRInstructions> */}
<AppleWalletButton onClick={() => downloadAppleWalletPass()} />
</QRCodeDesign>
</QRCodeDesignContainer>

{/* <SavePDFBtn color="secondary" onClick={generatePDF}>
{' '}
Save as PDF
</SavePDFBtn> */}
</QRTags>

<Canvas
text={userId}
options={{
level: 'M',
margin: 2,
scale: 4.5,
// width: '100%',
color: {
dark: '#000000',
light: '#FFFFFF',
},
}}
/>

{/* <AppleWalletButton onClick={() => downloadAppleWalletPass()} /> */}
</QRCodeDesign>
</QRTicketContainer>

<QRInfo>
<QRInfoWelcome>Welcome,</QRInfoWelcome>
<QRInfoName>{userInfo.displayName}!</QRInfoName>
<QRInfoDes>
This ticket contains your personal QR code which will be scanned throughout the event.
Please add this ticket to your mobile wallet or take a screenshot.
Please take a screenshot or otherwise have your QR code ready to scan.
</QRInfoDes>
</QRInfo>
</QRContainer>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ const Sidebar = ({
links.tools.push({ location: '/judging/admin', text: 'Judging Admin' })
}

if (import.meta.env.NODE_ENV !== 'production') {
links.information.push({ location: '/charcuterie', text: 'CHARCUTERIE' })
}
// if (import.meta.env.NODE_ENV !== 'production') {
// links.information.push({ location: '/charcuterie', text: 'CHARCUTERIE' })
// }

if (isApplicationOpen) {
// List the application as the last item on the menu
Expand Down
Loading
Loading