Skip to content

Commit

Permalink
Merge branch 'dev' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurikam2003 committed Jul 9, 2024
2 parents 1257d65 + b88fcce commit 2b4207c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
37 changes: 31 additions & 6 deletions client/src/pages/Registration/RegistrationFields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ export const fields = {
localStorageKey: 'registration-phoneNumberCountryCode',
className: 'small-width-input',
inputTitle: 'Country Code',
maxLength: 3,
maxLength: 4,
noEdit: false,
validation: (value) => {
if (/^[+0-9]*$/.test(value)) {
if (value.length <= 3) {
if (value.length <= 4) {
return true;
} else {
return 'Must be at most 3 characters';
return 'Must be at most 4 characters';
}
} else {
return 'Must contain characters 0-9 or +';
Expand Down Expand Up @@ -253,17 +253,43 @@ export const fields = {
className: 'half-width-input',
validation: textLengthValidation,
},
emergencyContactNumberLabel: {
type: 'label',
label: 'Emergency Contact Phone Number',
isRequiredInput: true,
},
emergencyContactCountryCode: {
type: 'text',
inputType: 'text',
placeholder: '+1',
hasRestrictedInput: false,
localStorageKey: 'registration-emergencyContactNumberCountryCode',
className: 'small-width-input',
inputTitle: 'Country Code',
maxLength: 4,
noEdit: false,
validation: (value) => {
if (/^[+0-9]*$/.test(value)) {
if (value.length <= 4) {
return true;
} else {
return 'Must be at most 4 characters';
}
} else {
return 'Must contain characters 0-9 or +';
}
},
},
emergencyContactNumber: {
type: 'text',
inputType: 'text',
label: 'Emergency Contact Phone Number',
placeholder: '(416) 123-4567',
hasRestrictedInput: true,
isRequiredInput: true,
noEdit: false,
errorMessage: 'Please enter a valid phone number',
localStorageKey: 'registration-emergencyContactNumber',
className: 'half-width-input',
className: 'fill-remaining-width-input',
isPhoneNumber: true,
inputTitle: 'Phone Number',
validation: phoneNumberValidation,
Expand Down Expand Up @@ -378,7 +404,6 @@ export const fields = {
type: 'radio',
label: 'Would you like us to reach out to you about how we can best accommodate you?',
values: ['Yes', 'No'],
initialSelectedIndex: 0,
isRequiredInput: false,
noEdit: false,
localStorageKey: 'registration-accommodation',
Expand Down
4 changes: 4 additions & 0 deletions server/src/models/FroshModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ const FroshSchema = new mongoose.Schema(
type: String,
required: true,
},
emergencyContactCountryCode: {
type: String,
required: false,
},
emergencyContactNumber: {
type: String,
required: true,
Expand Down

0 comments on commit 2b4207c

Please sign in to comment.