Skip to content

Commit 89c6a13

Browse files
committed
Updated email regex validation, added scholarship email instructions, improved group creation, and updated form ID
1 parent 55aa66c commit 89c6a13

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/components/Registration/GroupManager/GroupManager.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function GroupManager(props) {
2424
setLoadingNewTeam(true);
2525
setGroupInputError(false);
2626
groupRest
27-
.createGroup(props.eventId)
27+
.createGroup(props.eventId, groupName)
2828
.then((response) => {
2929
setLoadingNewTeam(false);
3030
setGroup(response.data);

src/components/Registration/Registration.jsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ const personalData = [
7171
type: INPUT_TYPES.TEXT_FIELD,
7272
input: ["example@example.com"],
7373
name: "email",
74-
regex: /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/,
74+
regex:
75+
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
7576
required: true,
7677
},
7778
{
@@ -203,7 +204,13 @@ const travelSponsorship = [
203204
{
204205
fullWidth: true,
205206
input:
206-
"Quantco, our partner, is offering travel scholarships to participants worldwide. To apply, simply submit your CV using the checkbox below.",
207+
"Our partner, Quantco, provides travel scholarships for participants from around the globe. Applying is easy — just submit your CV and select the checkbox below.",
208+
type: INPUT_TYPES.TYPOGRAPHY,
209+
},
210+
{
211+
fullWidth: true,
212+
input:
213+
"Please email your CV in PDF format to travel-scholarship@hackhpi.org.",
207214
type: INPUT_TYPES.TYPOGRAPHY,
208215
},
209216
{
@@ -337,6 +344,11 @@ function Registration() {
337344
) {
338345
return previous && false;
339346
}
347+
348+
if (current.regex && !values[current.name].match(current.regex)){
349+
return previous && false;
350+
}
351+
340352
const meetsMax = current.max
341353
? values[current.name]?.length <= current.max
342354
: true;
@@ -484,7 +496,7 @@ function Registration() {
484496
email: values.email,
485497
fieldData: JSON.stringify(values),
486498
signUpForm: {
487-
id: "283db119-046c-4418-939d-ab9bee06c996",
499+
id: "e73735ad-c930-44ee-8631-6c5bc3aed029",
488500
//id: "2f1c60f2-f30b-4432-8129-9131c6e398dd",
489501
},
490502
group: values.group ? values.group : undefined,

0 commit comments

Comments
 (0)