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

Add DirectDebitField Component #464

Merged
merged 5 commits into from
Sep 10, 2024
Merged

Add DirectDebitField Component #464

merged 5 commits into from
Sep 10, 2024

Conversation

Abban
Copy link
Member

@Abban Abban commented Aug 15, 2024

This is drop in replacement for the PaymentBankData component
that is more accessible and integrated with our form fields
components.

Refactored the bankdata store

  • Added accountNumber and bankCode fields, as the direct debit
    field will accept both IBAN and account numbers making the
    naming confusing.
  • Added getters actions and mutations for the new fields.
  • Updated the typescript interfaces to reflect the new structure.

Added an API resource

This makes the API calls that validate the bank data more
consistent with our other API resources

Added a BankFields component

The pattern for our form fields is that they take in model
values and do not access the store directly, We then use
wrapper components to manage store access. That's what this
component is for.

Added a DirectDebitField

This handles visibility of labels, and formatting values
when fields receive input.

Added TextValueField

As we're formatting the value in the input box we need
a field similar to TextField that uses a prop as the value
rather than take in a model.

Ticket: https://phabricator.wikimedia.org/T364953

@Abban Abban force-pushed the iban-accessibility branch 8 times, most recently from c8c5937 to f098189 Compare August 23, 2024 13:07
@Abban Abban force-pushed the iban-accessibility branch from f098189 to de1eb6d Compare August 27, 2024 13:53
@Abban Abban changed the title Create new Bank Data components Add DirectDebitField Component Aug 27, 2024
@Abban Abban force-pushed the iban-accessibility branch from de1eb6d to 4f8c58c Compare August 27, 2024 14:11
@Abban Abban marked this pull request as ready for review August 27, 2024 14:35
@Abban Abban force-pushed the iban-accessibility branch 2 times, most recently from 9790c1c to 92263b3 Compare August 27, 2024 14:43
Copy link
Member

@gbirke gbirke left a comment

Choose a reason for hiding this comment

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

Thank you for splitting the commits, using very descriptive commit messages and having a well-structured explanation text in the PR. This has already helped me understand the ESLint changes and will prove very valuable in the future.

I'm approving this because my user tests did not reveal mistakes, it's more accessible and most of my comments are suggestions and questions. You can choose which ones you address and how.

src/components/shared/BankFields.vue Outdated Show resolved Hide resolved
src/components/shared/form_fields/TextValueField.vue Outdated Show resolved Hide resolved
src/store/bankdata/getters.ts Show resolved Hide resolved
src/store/bankdata/getters.ts Show resolved Hide resolved
src/api/BankValidationResource.ts Outdated Show resolved Hide resolved
src/api/BankValidationResource.ts Outdated Show resolved Hide resolved
src/components/shared/form_fields/DirectDebitField.vue Outdated Show resolved Hide resolved
src/store/bankdata/actions.ts Outdated Show resolved Hide resolved
This is drop in replacement for the PaymentBankData component
that is more accessible and integrated with our form fields
components.

- Added accountNumber and bankCode fields, as the direct debit
  field will accept both IBAN and account numbers making the
  naming confusing.
- Added getters actions and mutations for the new fields.
- Updated the typescript interfaces to reflect the new structure.

This makes the API calls that validate the bank data more
consistent with our other API resources

The pattern for our form fields is that they take in model
values and do not access the store directly, We then use
wrapper components to manage store access. That's what this
component is for.

This handles visibility of labels, and formatting values
when fields receive input.

As we're formatting the value in the input box we need
a field similar to TextField that uses a prop as the value
rather than take in a model.

Ticket: https://phabricator.wikimedia.org/T364953
- Swap the PaymentBankData component for the new field
- Remove old store injection with key
- Update tests

Ticket: https://phabricator.wikimedia.org/T364953
Now the donation and membership forms use the new
components the old ones can be deleted.

Ticket: https://phabricator.wikimedia.org/T364953
We use try catch blocks to handle rejected promises in
async await functions. Eslint forces us to have the error
variable but the typescript linter throws an error that
they're unused.
Now the bank data values are all part of the store
we can restore them on refresh.

Ticket: https://phabricator.wikimedia.org/T364953
@Abban Abban force-pushed the iban-accessibility branch from 471f0d4 to cb47bf6 Compare September 5, 2024 08:33
@Abban Abban requested a review from gbirke September 5, 2024 08:33
src/store/bankdata/getters.ts Show resolved Hide resolved
@Abban Abban merged commit 6859ba7 into main Sep 10, 2024
3 checks passed
@Abban Abban deleted the iban-accessibility branch September 10, 2024 11:09
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