Skip to content

Commit 47675bc

Browse files
committed
Update grant form to include nationality and departureCity inputs
1 parent c75f6b1 commit 47675bc

File tree

4 files changed

+60
-4
lines changed

4 files changed

+60
-4
lines changed

frontend/src/components/grant-form/index.tsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export type GrantFormFields = ParticipantFormFields & {
6868
why: string;
6969
notes: string;
7070
travellingFrom: string;
71+
nationality: string;
72+
departureCity: string;
7173
acceptedPrivacyPolicy: boolean;
7274
};
7375

@@ -205,6 +207,8 @@ export const GrantForm = ({
205207
formState.setField("why", grant.why);
206208
formState.setField("notes", grant.notes);
207209
formState.setField("travellingFrom", grant.travellingFrom);
210+
formState.setField("nationality", grant.nationality);
211+
formState.setField("departureCity", grant.departureCity);
208212

209213
formState.setField("acceptedPrivacyPolicy", true);
210214
}
@@ -253,6 +257,8 @@ export const GrantForm = ({
253257
needsFundsForTravel: formState.values.needsFundsForTravel === "true",
254258
why: formState.values.why,
255259
travellingFrom: formState.values.travellingFrom,
260+
nationality: formState.values.nationality,
261+
departureCity: formState.values.departureCity,
256262
occupation: formState.values.occupation,
257263
pythonUsage: formState.values.pythonUsage,
258264
communityContribution: formState.values.communityContribution,
@@ -481,6 +487,37 @@ export const GrantForm = ({
481487
</Select>
482488
</InputWrapper>
483489

490+
<InputWrapper
491+
required={true}
492+
title={<FormattedMessage id="grants.form.fields.nationality" />}
493+
description={
494+
<FormattedMessage id="grants.form.fields.nationality.description" />
495+
}
496+
>
497+
<Input
498+
{...text("nationality")}
499+
required={true}
500+
maxLength={100}
501+
placeholder={inputPlaceholderText}
502+
errors={getErrors("nationality")}
503+
/>
504+
</InputWrapper>
505+
506+
<InputWrapper
507+
required={true}
508+
title={<FormattedMessage id="grants.form.fields.departureCity" />}
509+
description={
510+
<FormattedMessage id="grants.form.fields.departureCity.description" />
511+
}
512+
>
513+
<Input
514+
{...text("departureCity")}
515+
required={true}
516+
maxLength={100}
517+
placeholder={inputPlaceholderText}
518+
errors={getErrors("departureCity")}
519+
/>
520+
</InputWrapper>
484521
<InputWrapper
485522
title={
486523
<FormattedMessage id="grants.form.fields.needsFundsForTravel" />

frontend/src/locale/index.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,17 @@ We look forward to reading about you and hope to see you at PyCon Italia 2024!
735735
"grants.form.fields.grantType.values.diversity": "Diversity",
736736
"grants.form.fields.grantType.values.unemployed": "Unemployed",
737737
"grants.form.fields.grantType.values.speaker": "Speaker",
738-
"grants.form.fields.travellingFrom": "Where are you travelling from?",
738+
"grants.form.fields.travellingFrom":
739+
"Which country will you be travelling from?",
739740
"grants.form.fields.travellingFrom.description":
740-
"Please indicate the city and country you will be travelling from to attend the conference.",
741+
"Please select the country you will be departing from to attend the conference.",
742+
"grants.form.fields.nationality": "What is your nationality?",
743+
"grants.form.fields.nationality.description":
744+
"Please indicate your nationality.",
745+
"grants.form.fields.departureCity":
746+
"What city will you be travelling from?",
747+
"grants.form.fields.departureCity.description":
748+
"Specify the city you will depart from for the conference.",
741749
"grants.form.fields.needsFundsForTravel":
742750
"Do you need financial aid for travelling to PyCon Italia?",
743751
"grants.form.fields.needsFundsForTravel.description":
@@ -1456,9 +1464,14 @@ Non vediamo l'ora di leggere la tua storia e speriamo di vederti a PyCon Italia
14561464
"grants.form.fields.grantType.values.diversity": "Diversity",
14571465
"grants.form.fields.grantType.values.unemployed": "Disoccupato",
14581466
"grants.form.fields.grantType.values.speaker": "Speaker",
1459-
"grants.form.fields.travellingFrom": "Da dove partirai?",
1467+
"grants.form.fields.travellingFrom": "Da quale paese partirai?",
14601468
"grants.form.fields.travellingFrom.description":
1461-
"Indica la città e il paese da cui partirai per partecipare alla conferenza.",
1469+
"Seleziona il paese da cui partirai per partecipare alla conferenza.",
1470+
"grants.form.fields.nationality": "Da quale città partirai?",
1471+
"grants.form.fields.nationality.description": "Indica la tua nazionalità.",
1472+
"grants.form.fields.departureCity": "Qual è la tua nazionalità?",
1473+
"grants.form.fields.departureCity.description":
1474+
"Indica la città da cui inizierai il tuo viaggio.",
14621475
"grants.form.fields.needsFundsForTravel":
14631476
"Hai bisogno di aiuti finanziari per le spese di viaggio a Pycon Italia?",
14641477
"grants.form.fields.needsFundsForTravel.description":

frontend/src/pages/grants/edit/my-grant.graphql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ query MyGrant($conference: String!) {
2020
why
2121
notes
2222
travellingFrom
23+
nationality
24+
departureCity
2325
}
2426
}
2527
}

frontend/src/pages/grants/edit/update-grant.graphql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ mutation UpdateGrant($input: UpdateGrantInput!) {
1717
needVisa
1818
notes
1919
travellingFrom
20+
nationality
21+
departureCity
2022
}
2123

2224
... on GrantErrors {
@@ -37,6 +39,8 @@ mutation UpdateGrant($input: UpdateGrantInput!) {
3739
validationWhy: why
3840
validationNotes: notes
3941
validationTravellingFrom: travellingFrom
42+
validationNationality: nationality
43+
validationDepartureCity: departureCity
4044
validationParticipantBio: participantBio
4145
validationParticipantWebsite: participantWebsite
4246
validationParticipantTwitterHandle: participantTwitterHandle

0 commit comments

Comments
 (0)