Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable "no" option for direct debit #539

Closed
wants to merge 1 commit into from

Conversation

moiikana
Copy link
Contributor

  • we demand a full address from users when they select direct debit as a payment option. when asking about if they want to have a receipt, they need to say yes (give address), so we have to disable the "no" option.

  • respectively the DirectDebit option should be disabled when "no" got selected first

  • lift the tooltip message above other neighboring elements that updated dynamically

this fixes https://phabricator.wikimedia.org/T379565

- we demand a full address from users when they select direct debit as a payment option.
when asking about if they want to have a receipt, they need to say yes (give address),
so we have to disable the "no" option.
- respectively the DirectDebit option should be disabled when "no" got selected first

- lift the tooltip message above other neighboring elements that updated dynamically

this fixes https://phabricator.wikimedia.org/T379565
@moiikana
Copy link
Contributor Author

Copy link
Member

@Abban Abban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working well, just one small fix for the casting in the computed property

@@ -121,4 +132,14 @@ useAddressTypeFromReceiptSetter( props.receiptModel.receiptNeeded, toRef( props.

onBeforeMount( initializeDataFromStore );

const disabledReceiptNeededOptions = computed<string[]>( () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is typed as a string[] but the map is returning a boolean[] which I guess is why you cast the CheckboxFormOption to Object. You can simplify this logic by changing it to:

const disabledReceiptNeededOptions = computed<boolean[]>( () => {
    return props.isDirectDebitPayment ? [ false ] : [];
} );

You can also then move the options back into the template.

@moiikana
Copy link
Contributor Author

should allow an implicit "email only" type on the ap=1 form

@moiikana moiikana closed this Nov 13, 2024
@moiikana moiikana deleted the disable-anonymous-ap1-option branch November 13, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants