Skip to content

Commit

Permalink
Burgess/autocomplete-fix (#499)
Browse files Browse the repository at this point in the history
* Fixing school dropdown

* Run Prettier

* Forgot to remove package

* responding to a comment sad face

* fixing according to mlh

* Run Prettier

* Adding a comment

---------

Co-authored-by: kyleburgess2025 <[email protected]>
  • Loading branch information
kyleburgess2025 and kyleburgess2025 authored Aug 22, 2024
1 parent e17e104 commit fe2c300
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 21 deletions.
9 changes: 5 additions & 4 deletions components/Organizer/ApplicantsTab/ApplicantsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ const APPLICATION_KEY_MAP = {
lastName: 'Last Name',
preferredName: 'Preferred Name',
gender: 'Gender',
dateOfBirth: 'Date of Birth',
age: 'Age',
phoneNumber: 'Phone Number',
school: 'School',
major: 'Major',
yearOfStudy: 'Year Of Study',
levelOfStudy: 'Level Of Study',
graduationYear: 'Graduation Year',
address1: 'Address 1',
address2: 'Address 2',
city: 'City',
Expand Down Expand Up @@ -271,11 +272,11 @@ export const ApplicantsTab = () => {
title: 'Graduation Year',
dataIndex: ['application', 'graduationYear'],
filters: [
{ text: '2022', value: '2022' },
{ text: '2023', value: '2023' },
{ text: '2024', value: '2024' },
{ text: '2025', value: '2025' },
{ text: '2026', value: '2026' },
{ text: '2027', value: '2027' },
{ text: '2028', value: '2028' },
{ text: 'Other', value: 'Other' },
],
filteredValue: filteredInfo['application.graduationYear'] || null,
Expand Down
65 changes: 53 additions & 12 deletions components/hacker/HackerDash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
{ label: 'Other', value: 'other' },
];

// Level of study provided by MLH
const levelOfStudy = [
{ label: 'Less than Secondary / High School', value: 'less_than_high_school' },
{ label: 'Secondary / High School', value: 'high_school' },
{ label: 'Undergraduate University (2 year - community college or similar)', value: 'undergrad_2_year' },
{ label: 'Undergraduate University (3+ year)', value: 'undergrad_3_plus_year' },
{ label: 'Graduate University (Masters, Professional, Doctoral, etc)', value: 'graduate_university' },
{ label: 'Code School / Bootcamp', value: 'code_bootcamp' },
{ label: 'Other Vocational / Trade Program or Apprenticeship', value: 'vocational_trade' },
{ label: 'Post Doctorate', value: 'post_doctorate' },
{ label: 'Other', value: 'other' },
{ label: "I'm not currently a student", value: 'not_student' },
{ label: 'Prefer not to answer', value: 'prefer_not_to_answer' },
];

const [resumeFile, setResumeFile] = useState<UploadFile[]>([]);
const [resumeToUpload, setResumeToUpload] = useState<string | Blob>('');

Expand Down Expand Up @@ -274,10 +289,19 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
</Radio.Group>
</Form.Item>
<Form.Item
name="dateOfBirth"
label={<p className={styles.Label}>Date of Birth</p>}
rules={[{ required: true, message: 'Please select your date of birth!' }]}>
<DatePicker placeholder="MM-DD-YYYY" format="MM-DD-YYYY" />
name="age"
label={<p className={styles.Label}>Age</p>}
rules={[
{
required: true,
message: 'Please input a valid age.',
validator: (_, value) =>
value && value > 0 && value < 150
? Promise.resolve()
: Promise.reject(new Error('Please input a valid age.')),
},
]}>
<Input className={styles.Input} type="number" />
</Form.Item>
<Form.Item
label={<p className={styles.Label}>Phone Number</p>}
Expand Down Expand Up @@ -309,15 +333,32 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
rules={[{ required: true, message: 'Please input your major!' }]}>
<Input className={styles.Input} />
</Form.Item>
<Form.Item
label={<p className={styles.Label}>Level of Study</p>}
name="levelOfStudy"
rules={[{ required: true, message: 'Please select your level of study!' }]}>
<Radio.Group>
{levelOfStudy.map((level: DropdownItem) => (
<Radio.Button key={level.value} value={level.value}>
{level.label}
</Radio.Button>
))}
</Radio.Group>
</Form.Item>
<Form.Item
label={<p className={styles.Label}>Graduation Year</p>}
name="yearOfStudy"
rules={[{ required: true, message: 'Please select your year of study!' }]}>
name="graduationYear"
rules={[
{ required: true, message: 'Please select the year you intend to graduate!' },
]}>
<Radio.Group>
<Radio.Button value="freshman">Freshman</Radio.Button>
<Radio.Button value="sophomore">Sophomore</Radio.Button>
<Radio.Button value="junior">Junior</Radio.Button>
<Radio.Button value="senior">Senior</Radio.Button>
<Radio.Button value="2024">2024</Radio.Button>
<Radio.Button value="2025">2025</Radio.Button>
<Radio.Button value="2026">2026</Radio.Button>
<Radio.Button value="2027">2027</Radio.Button>
<Radio.Button value="2028">2028</Radio.Button>
<Radio.Button value="2029">2029</Radio.Button>
<Radio.Button value="other">Not sure/Other</Radio.Button>
</Radio.Group>
</Form.Item>
<Form.Item
Expand Down Expand Up @@ -632,8 +673,8 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
</Form.Item>
<Form.Item valuePropName="checked" name="mlhComms">
<Checkbox style={{ color: 'white' }}>
I authorize MLH to send me occasional emails about relevant events,
career opportunities, and community announcements.
I authorize MLH to send me occasional emails about relevant events, career
opportunities, and community announcements.
</Checkbox>
</Form.Item>
<br />
Expand Down
10 changes: 7 additions & 3 deletions models/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export const ApplicationSchema = new Schema(
type: String,
required: true,
},
dateOfBirth: {
type: String,
age: {
type: Number,
required: true,
},
phoneNumber: {
Expand All @@ -36,7 +36,11 @@ export const ApplicationSchema = new Schema(
type: String,
required: true,
},
yearOfStudy: {
levelOfStudy: {
type: String,
required: true,
},
graduationYear: {
type: String,
required: true,
},
Expand Down
5 changes: 3 additions & 2 deletions types/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ export interface ApplicationData {
dietaryRestrictions: string[];
accomodationNeeds: string;
phoneNumber: string;
dateOfBirth: string;
age: number;
school: string;
major: string;
yearOfStudy: string;
levelOfStudy: string;
graduationYear: string;
race: string[];
motivation: string[];
applyTravelReimbursement: boolean;
Expand Down

0 comments on commit fe2c300

Please sign in to comment.