Skip to content

Commit

Permalink
Select end-of-year donation receipt by default
Browse files Browse the repository at this point in the history
  • Loading branch information
denisw committed Aug 29, 2023
1 parent 1a1ec7f commit 41ae565
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const FORM_LABEL_BOOTSTRAP_CLASSES = 'col-md-3'
export const FORM_INPUT_BOOTSTRAP_CLASSES = 'col-md-8'

export const RECEIPT_END_OF_YEAR_OPTION_VALUE = 'receipt_end_of_year'
export const NO_RECEIPT_OPTION_VALUE = 'no_receipt'
export const RECEIPT_NOW_OPTION_VALUE = 'receipt_now'

Expand Down
10 changes: 7 additions & 3 deletions src/components/wie-sie-helfen/DonationForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
COUNTRY_GERMANY,
DE_PROJECT_ID,
NO_RECEIPT_OPTION_VALUE,
RECEIPT_END_OF_YEAR_OPTION_VALUE,
RECEIPT_NOW_OPTION_VALUE,
SA_PROJECT_ID,
} from './constants/formValues'
Expand Down Expand Up @@ -80,10 +81,13 @@ const DonationForm = ({
)
const receiptOptions = [
{
value: 'receipt_end_of_year',
value: RECEIPT_END_OF_YEAR_OPTION_VALUE,
text: 'Ja, konsolidiert am Ende des Jahres',
},
{ value: RECEIPT_NOW_OPTION_VALUE, text: 'Ja, so schnell wie möglich' },
{
value: RECEIPT_NOW_OPTION_VALUE,
text: 'Ja, so schnell wie möglich',
},
{
value: NO_RECEIPT_OPTION_VALUE,
text: 'Nein, ich brauche keine Quittung',
Expand All @@ -104,7 +108,7 @@ const DonationForm = ({
onSubmit={noop}
decorators={decorators}
initialValues={{
[WANTS_RECEIPT]: RECEIPT_NOW_OPTION_VALUE,
[WANTS_RECEIPT]: RECEIPT_END_OF_YEAR_OPTION_VALUE,
[COUNTRY]: COUNTRY_GERMANY,
// if the interval is disabled then assume the payment will be single
...(disableIntervalSelection && { [PAYMENT_INTERVAL]: '0' }),
Expand Down

0 comments on commit 41ae565

Please sign in to comment.