Skip to content

Commit 1fe2d5e

Browse files
committed
Make grant form options required with no default selection
1 parent 6b6f520 commit 1fe2d5e

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ export const GrantForm = ({
146146
const inputPlaceholderText = useTranslatedMessage("input.placeholder");
147147
const { user, loading: loadingUser } = useCurrentUser({});
148148
const [formState, formOptions] = useFormState<GrantFormFields>(
149-
{
150-
needsFundsForTravel: "false",
151-
},
149+
{},
152150
{
153151
withIds: true,
154152
},
@@ -480,8 +478,12 @@ export const GrantForm = ({
480478
description={
481479
<FormattedMessage id="grants.form.fields.needsFundsForTravel.description" />
482480
}
481+
required={true}
483482
>
484-
<Select {...select("needsFundsForTravel")}>
483+
<Select {...select("needsFundsForTravel")} required={true}>
484+
<FormattedMessage id="global.selectOption">
485+
{(msg) => <option value="">{msg}</option>}
486+
</FormattedMessage>
485487
<FormattedMessage id="global.no">
486488
{(msg) => <option value="false">{msg}</option>}
487489
</FormattedMessage>
@@ -496,8 +498,12 @@ export const GrantForm = ({
496498
description={
497499
<FormattedMessage id="grants.form.fields.needVisa.description" />
498500
}
501+
required={true}
499502
>
500-
<Select {...select("needVisa")}>
503+
<Select {...select("needVisa")} required={true}>
504+
<FormattedMessage id="global.selectOption">
505+
{(msg) => <option value="">{msg}</option>}
506+
</FormattedMessage>
501507
<FormattedMessage id="global.no">
502508
{(msg) => <option value="false">{msg}</option>}
503509
</FormattedMessage>
@@ -514,8 +520,12 @@ export const GrantForm = ({
514520
description={
515521
<FormattedMessage id="grants.form.fields.needAccommodation.description" />
516522
}
523+
required={true}
517524
>
518-
<Select {...select("needAccommodation")}>
525+
<Select {...select("needAccommodation")} required={true}>
526+
<FormattedMessage id="global.selectOption">
527+
{(msg) => <option value="">{msg}</option>}
528+
</FormattedMessage>
519529
<FormattedMessage id="global.no">
520530
{(msg) => <option value="false">{msg}</option>}
521531
</FormattedMessage>

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

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,21 @@ query MyGrant($conference: String!) {
2121
notes
2222
travellingFrom
2323

24+
participant {
25+
id
26+
photo
27+
bio
28+
website
29+
twitterHandle
30+
instagramHandle
31+
linkedinUrl
32+
facebookUrl
33+
mastodonHandle
2434

25-
26-
participant {
27-
id
28-
photo
29-
bio
30-
website
31-
twitterHandle
32-
instagramHandle
33-
linkedinUrl
34-
facebookUrl
35-
mastodonHandle
36-
37-
fullname
38-
publicProfile
39-
userId
40-
}
35+
fullname
36+
publicProfile
37+
userId
38+
}
4139
}
4240
}
4341
}

0 commit comments

Comments
 (0)