JoinColony / colonyCDapp

An iteration of the Colony Dapp sporting both a fully decentralized operating mode, as well as a mode enhanced by a metadata caching layer
5 stars 14 forks source link

[C2F] Formatting on IBAN input and correct error validation UX #2961

Closed melyndav closed 2 days ago

melyndav commented 2 months ago

Description

There is no validation on incorrect formatting for the IBAN input field when the CTA button is selected, and only shows after it's been selected with a toast, which is inconsistent with the rest of the validation UX and does not indicate to the user what specifically the issue is and how to resolve it.

Example: When I enter (dummy data for screenshot purposes) IBAN details in that follow the format from my bank which includes spacing, no validation is shown upon selecting the CTA:

image

Toast with generic error:

image

However, if I input the incorrect SWIFT format, validation is provided.

image

Scope:

Add validation to match the accepted IBAN format from the API (no spacing between numbers and digits). Add inline to the form when the CTA is selected to ensure consistency in the error state UX.

Remove the toast validation.

All updates should be made across all responsive sizes.

melyndav commented 2 months ago

Related issue: #2963

rdig commented 2 months ago

Two things here:

melyndav commented 2 months ago

@rdig good point. We will confirm with the API what the validation for the spec.

arrenv commented 2 months ago

I have run a couple of tests on the API, and it seems as though the API requirements are:

This seems only relevant for iban.account_number and iban.bic. Spaces did not seem to be an issue for US accounts.

rdig commented 2 months ago

There's 3 things to consider here:

Because in the end it only matters what we want to validate against, since we can have a setup like this:

  1. validate IBAN using our spec (let's say something more complex, five groups of four chars, first group needs to contain letters at position 0 and 1 -- country, followed by two numbers, then the remaining four groups must include only numbers)
  2. after we validate the above, we can format it in a format that bridge accepts (in this case, basically just remove the spaces)

As long as we come up with specs for validation, we're all good to go

arrenv commented 2 months ago

@rdig Great, that gives us more freedom on our side. He is the spec.

rdig commented 2 months ago

Just a small heads up that ISO 13616-1:2007 is the old, deprecated version, the current one is ISO 13616-1:2020 (the one I linked to above)

As far as I can tell the actual IBAN format hasn't changed between the revisions, but better to use the current one to avoid confusion

arrenv commented 2 months ago

Good pickup, I have updated it.

jakubcolony commented 5 days ago

@arrenv Spotted this while testing #3474, shouldn't both the account and routing numbers be digits only? From my research letters are not allowed.

arrenv commented 4 days ago

Thanks @jakubcolony, looks like a fell victim to some lazy copy and paste. Fixed now.

I have also added the SWIFT one.