Skip to content

Commit

Permalink
MLH Form Changes (#1016)
Browse files Browse the repository at this point in the history
* Updated level of study options to match MLH requirements

* #1000 - Update export from .tsv to .csv

* Changed hacker account form 'birthdate' field to 'age' #1003

* Added country of residence field to Other/Personal Details section of hacker application #1009

* Added country of residence field to the hacker application.

* add back CEGEP level of study.

---------

Co-authored-by: allennatang <[email protected]>
  • Loading branch information
tektaxi and allennatang committed Nov 15, 2024
1 parent 665f645 commit 6ad7407
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 35 deletions.
6 changes: 5 additions & 1 deletion src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const PRONOUN_PLACEHOLDER = 'Pronouns';
export const GENDER_LABEL = 'Gender';
export const GENDER_PLACEHOLDER = 'Gender';
export const PHONE_NUMBER_LABEL = 'Phone number';
export const BIRTH_DATE_LABEL = 'Birth date';
export const AGE_LABEL = 'Age';
export const FIRST_NAME_LABEL = 'First name';
export const LAST_NAME_LABEL = 'Last name';

Expand Down Expand Up @@ -102,6 +102,10 @@ export const COC_ACCEPTANCE_PHRASE = 'I accept the';
export const COC_MCHACKS_REQUEST_LABEL = 'McHacks Code of Conduct';
export const COC_MLH_REQUEST_LABEL = 'MLH terms, conditions and guidelines.';
export const COMMENTS_LABEL = "Is there anything you'd like us to know?";
export const COUNTRY_LABEL = 'Country of Residence';
export const COUNTRY_PLACEHOLDER = 'Country of Residence';
export const COUNTRY_TEXT =
'Please indicate your current country of residence.';
export const DEGREE_LABEL = 'Degree';
export const DEGREE_PLACEHOLDER = 'High School, Undergraduate...';
export const DRIBBBLE_LINK_LABEL = 'Dribbble URL';
Expand Down
259 changes: 259 additions & 0 deletions src/config/countries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
// Used MLH's recommendation to use the ISO 3166 Standard for Country Names https://www.iso.org/iso-3166-country-codes.html

export const CountriesList = [
"Canada",
"Afghanistan",
"Åland Islands",
"Albania",
"Algeria",
"American Samoa",
"Andorra",
"Angola",
"Anguilla",
"Antarctica",
"Antigua and Barbuda",
"Argentina",
"Armenia",
"Aruba",
"Australia",
"Austria",
"Azerbaijan",
"Bahamas",
"Bahrain",
"Bangladesh",
"Barbados",
"Belarus",
"Belgium",
"Belize",
"Benin",
"Bermuda",
"Bhutan",
"Bolivia, Plurinational State of",
"Bonaire, Sint Eustatius and Saba",
"Bosnia and Herzegovina",
"Botswana",
"Bouvet Island",
"Brazil",
"British Indian Ocean Territory",
"Brunei Darussalam",
"Bulgaria",
"Burkina Faso",
"Burundi",
"Cabo Verde",
"Cambodia",
"Cameroon",
"Cayman Islands",
"Central African Republic",
"Chad",
"Chile",
"China",
"Christmas Island",
"Cocos (Keeling) Islands",
"Colombia",
"Comoros",
"Congo",
"Congo, Democratic Republic of the",
"Cook Islands",
"Costa Rica",
"Côte d'Ivoire",
"Croatia",
"Cuba",
"Curaçao",
"Cyprus",
"Czechia",
"Denmark",
"Djibouti",
"Dominica",
"Dominican Republic",
"Ecuador",
"Egypt",
"El Salvador",
"Equatorial Guinea",
"Eritrea",
"Estonia",
"Eswatini",
"Ethiopia",
"Falkland Islands (Malvinas)",
"Faroe Islands",
"Fiji",
"Finland",
"France",
"French Guiana",
"French Polynesia",
"French Southern Territories",
"Gabon",
"Gambia",
"Georgia",
"Germany",
"Ghana",
"Gibraltar",
"Greece",
"Greenland",
"Grenada",
"Guadeloupe",
"Guam",
"Guatemala",
"Guernsey",
"Guinea",
"Guinea-Bissau",
"Guyana",
"Haiti",
"Heard Island and McDonald Islands",
"Holy See",
"Honduras",
"Hong Kong",
"Hungary",
"Iceland",
"India",
"Indonesia",
"Iran, Islamic Republic of",
"Iraq",
"Ireland",
"Isle of Man",
"Israel",
"Italy",
"Jamaica",
"Japan",
"Jersey",
"Jordan",
"Kazakhstan",
"Kenya",
"Kiribati",
"Korea, Democratic People's Republic of",
"Korea, Republic of",
"Kuwait",
"Kyrgyzstan",
"Lao People's Democratic Republic",
"Latvia",
"Lebanon",
"Lesotho",
"Liberia",
"Libya",
"Liechtenstein",
"Lithuania",
"Luxembourg",
"Macao",
"Madagascar",
"Malawi",
"Malaysia",
"Maldives",
"Mali",
"Malta",
"Marshall Islands",
"Martinique",
"Mauritania",
"Mauritius",
"Mayotte",
"Mexico",
"Micronesia, Federated States of",
"Moldova, Republic of",
"Monaco",
"Mongolia",
"Montenegro",
"Montserrat",
"Morocco",
"Mozambique",
"Myanmar",
"Namibia",
"Nauru",
"Nepal",
"Netherlands, Kingdom of the",
"New Caledonia",
"New Zealand",
"Nicaragua",
"Niger",
"Nigeria",
"Niue",
"Norfolk Island",
"North Macedonia",
"Northern Mariana Islands",
"Norway",
"Oman",
"Pakistan",
"Palau",
"Palestine, State of",
"Panama",
"Papua New Guinea",
"Paraguay",
"Peru",
"Philippines",
"Pitcairn",
"Poland",
"Portugal",
"Puerto Rico",
"Qatar",
"Réunion",
"Romania",
"Russian Federation",
"Rwanda",
"Saint Barthélemy",
"Saint Helena, Ascension and Tristan da Cunha",
"Saint Kitts and Nevis",
"Saint Lucia",
"Saint Martin (French part)",
"Saint Pierre and Miquelon",
"Saint Vincent and the Grenadines",
"Samoa",
"San Marino",
"Sao Tome and Principe",
"Saudi Arabia",
"Senegal",
"Serbia",
"Seychelles",
"Sierra Leone",
"Singapore",
"Sint Maarten (Dutch part)",
"Slovakia",
"Slovenia",
"Solomon Islands",
"Somalia",
"South Africa",
"South Georgia and the South Sandwich Islands",
"South Sudan",
"Spain",
"Sri Lanka",
"Sudan",
"Suriname",
"Svalbard and Jan Mayen",
"Sweden",
"Switzerland",
"Syrian Arab Republic",
"Taiwan, Province of China",
"Tajikistan",
"Tanzania, United Republic of",
"Thailand",
"Timor-Leste",
"Togo",
"Tokelau",
"Tonga",
"Trinidad and Tobago",
"Tunisia",
"Türkiye",
"Turkmenistan",
"Turks and Caicos Islands",
"Tuvalu",
"Uganda",
"Ukraine",
"United Arab Emirates",
"United Kingdom of Great Britain and Northern Ireland",
"United States of America",
"United States Minor Outlying Islands",
"Uruguay",
"Uzbekistan",
"Vanuatu",
"Venezuela, Bolivarian Republic of",
"Viet Nam",
"Virgin Islands (British)",
"Virgin Islands (U.S.)",
"Wallis and Futuna",
"Western Sahara",
"Yemen",
"Zambia",
"Zimbabwe"
];

export const Countries = CountriesList.map((v) => ({ label: v, value: v }));
export default Countries;



14 changes: 11 additions & 3 deletions src/config/degrees.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
export enum Degrees {
HIGHSCHOOL = 'High School',
LESS_THAN_SECONDARY = 'Less than Secondary / High School',
SECONDARY = 'Secondary / High School',
CEGEP = 'CEGEP',
UNDERGRADUATE = 'Undergraduate',
GRADUATE = 'Graduate',
COLLEGE = 'Undergraduate University (2 year - community college or similar)',
UNDERGRADUATE = 'Undergraduate University (3+ year)',
GRADUATE = 'Graduate University (Masters, Professional, Doctoral, etc)',
CODE_SCHOOL = 'Code School / Bootcamp',
VOCATIONAL = 'Other Vocational / Trade Program or Apprenticeship',
POSTDOC = 'Post Doctorate',
OTHER = 'Other',
NOT_STUDENT = "I'm not currently a student",
NO_ANSWER = 'Prefer not to answer'
}
export default Degrees;
1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './APIRoute';
export * from './attendanceOptions';
export * from './authToken';
export * from './constants';
export * from './countries';
export * from './degrees';
export * from './dietaryRestrictions';
export * from './ethnicity';
Expand Down
1 change: 1 addition & 0 deletions src/config/statsResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface IStatsResponse {
gender: { [key: string]: number };
travel: { true: number; false: number };
ethnicity: { [key: string]: number };
country: { [key: string]: number };
jobInterest: { [key in JobInterest]: number };
major: { [key: string]: number };
graduationYear: { [key: string]: number };
Expand Down
5 changes: 3 additions & 2 deletions src/config/userTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export interface IAccount {
password: string;
// The user's phone number
phoneNumber: string;
// The birthdate
birthDate: string;
// The user's age
age: string;
// The preferred pronoun
pronoun: string;
// The database id (if new, leave blank / make '')
Expand Down Expand Up @@ -62,6 +62,7 @@ export interface IHacker {
};
other: {
// no enum for these
country: string;
ethnicity: string[];
sendEmail: boolean;
privacyPolicy: boolean;
Expand Down
23 changes: 12 additions & 11 deletions src/features/Account/ManageAccountForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const ManageAccountForm: React.FC<IManageAccountProps> = (props) => {
const [accountDetails, setAccountDetails] = useState<IAccount>({
accountType:
(getValueFromQuery('accountType') as UserType) || UserType.UNKNOWN,
birthDate: '',
age: '',
confirmed: false,
email: getNestedAttr(props, ['location', 'state', 'email']) || '',
firstName: '',
Expand Down Expand Up @@ -101,7 +101,10 @@ const ManageAccountForm: React.FC<IManageAccountProps> = (props) => {
try {
const response = await Account.getSelf();
const newAccountDetails = response.data.data;
newAccountDetails.birthDate = date2input(newAccountDetails.birthDate);

// Changed birthdate to age
//newAccountDetails.age = date2input(newAccountDetails.age);

setAccountDetails(newAccountDetails);
} catch (e) {
// If can't find self's account, shouldn't be logged in. Redirect to home page
Expand All @@ -121,7 +124,7 @@ const ManageAccountForm: React.FC<IManageAccountProps> = (props) => {
accountId: string = ''
): IAccount => ({
accountType: UserType.UNKNOWN,
birthDate: input2date(values.birthDate),
age: values.age,
confirmed: false,
email: values.email,
firstName: values.firstName,
Expand Down Expand Up @@ -245,15 +248,13 @@ const ManageAccountForm: React.FC<IManageAccountProps> = (props) => {
</Flex>
<FastField
component={FormikElements.FormattedNumber}
label={CONSTANTS.BIRTH_DATE_LABEL}
placeholder="MM/DD/YYYY"
format="##/##/####"
name={'birthDate'}
label={CONSTANTS.AGE_LABEL}
format="##"
name={'age'}
required={true}
value={fp.values.birthDate}
disabled={props.mode === ManageAccountModes.EDIT}
value={fp.values.age}
/>
<ErrorMessage component={FormikElements.Error} name="birthDate" />
<ErrorMessage component={FormikElements.Error} name="age" />
<FastField
name={'email'}
label={CONSTANTS.EMAIL_LABEL}
Expand Down Expand Up @@ -359,7 +360,7 @@ const ManageAccountForm: React.FC<IManageAccountProps> = (props) => {
gender: accountDetails.gender,
dietaryRestrictions: accountDetails.dietaryRestrictions,
phoneNumber: accountDetails.phoneNumber,
birthDate: accountDetails.birthDate,
age: accountDetails.age,
}}
onSubmit={handleSubmit}
validationSchema={getValidationSchema(
Expand Down
Loading

0 comments on commit 6ad7407

Please sign in to comment.