Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
86 changes: 86 additions & 0 deletions common/questions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,92 @@ export const PostAcceptanceFormSections: Array<QuestionSection | QuestionDefinit
true,
'First Last'
),
makeShortText('email', 'Email', true, '[email protected]'),
makeShortText('phoneNumber', 'Phone Number', true, 'Phone Number'),
makeShortText('age', 'Age', true, 'Enter your age'),
makeDropdown(
'school',
'School',
Object.values(School).sort((a, b) => {
if (a === School['Northeastern University']) return -1;
if (b === School['Northeastern University']) return 1;

if (a === School['Other']) return 1;
if (b === School['Other']) return -1;
return a.localeCompare(b);
}),
true,
'School'
),
makeDropdown(
'levelOfStudy',
'Level of Study',
Object.values(YearOfEducation),
true,
'Level of Study'
),
makeShortText('countryOfResidence', 'Country of Residence', true, 'Country of Residence'),
makeSection(<>MLH Policies</>),
makeCheckbox(
'mlhCodeOfConduct',
<p>
I have read and agree to the{' '}
<a
href="https://github.com/MLH/mlh-policies/blob/main/code-of-conduct.md"
target="_blank"
rel="noopener noreferrer"
style={{ color: '#1890ff', textDecoration: 'underline' }}
>
MLH Code of Conduct
</a>
</p>,
[YesOrNo.Yes],
true,
1
),
makeCheckbox(
'mlhApplicationSharingAuthorization',
<p>
I authorize you to share my application/registration information with Major League Hacking for
event administration, ranking, and MLH administration in-line with the{' '}
<a
href="https://github.com/MLH/mlh-policies/blob/main/privacy-policy.md"
target="_blank"
rel="noopener noreferrer"
style={{ color: '#1890ff', textDecoration: 'underline' }}
>
MLH Privacy Policy
</a>
. I further agree to the terms of both the{' '}
<a
href="https://github.com/MLH/mlh-policies/blob/main/contest-terms.md"
target="_blank"
rel="noopener noreferrer"
style={{ color: '#1890ff', textDecoration: 'underline' }}
>
MLH Contest Terms and Conditions
</a>{' '}
and the{' '}
<a
href="https://github.com/MLH/mlh-policies/blob/main/privacy-policy.md"
target="_blank"
rel="noopener noreferrer"
style={{ color: '#1890ff', textDecoration: 'underline' }}
>
MLH Privacy Policy
</a>
</p>,
[YesOrNo.Yes],
true,
1
),
makeCheckbox(
'mlhMarketingAuthorization',
'I authorize MLH to send me occasional emails about relevant events, career opportunities, and community announcements.',
[YesOrNo.Yes],
true,
1
),
];

export const PostAcceptanceFormQuestions = PostAcceptanceFormSections.filter(filterQuestion);
9 changes: 9 additions & 0 deletions common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ export interface PostAcceptanceResponses extends SharedResponses {
adultSignature?: string;
minorSignature?: string;
guardianSignature?: string;
email?: string;
phoneNumber?: string;
age?: string;
school?: School;
levelOfStudy?: YearOfEducation;
countryOfResidence?: string;
mlhCodeOfConduct?: Array<string>;
mlhApplicationSharingAuthorization?: Array<string>;
mlhMarketingAuthorization?: Array<string>;
hangingWithFriends?: HangingWithFriends;
zombieApocalypse?: ZombieApocalypse;
takeOverNation?: TakeOverNation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type ShortTextProps = {
};

const ShortTextQuestion: FC<ShortTextProps> = ({ question, form, disabled }) => {
const isNumberInput = question.field === 'age';
return (
<Form.Item
data-testid="shortText-question"
Expand All @@ -22,6 +23,7 @@ const ShortTextQuestion: FC<ShortTextProps> = ({ question, form, disabled }) =>
data-testid="inputText3"
disabled={disabled}
placeholder={question.placeholder}
type={isNumberInput ? 'number' : 'text'}
onChange={(e) => form.setFieldsValue({ [question.id]: e.target.value as string })}
/>
</Form.Item>
Expand Down