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

feat(Bonus Pagamenti Digitali): [#174847319] Iban insertion screen #2259

Merged
merged 41 commits into from
Oct 7, 2020

Conversation

fabriziofff
Copy link
Contributor

@fabriziofff fabriziofff commented Oct 2, 2020

This pr depends on #2252

Short description

This pr adds the IbanInsertionScreen.

List of changes proposed in this pull request

  • Added IbanInsertionComponent, the graphical component that allows the insertion of an IBAN.
    Before trying to register the Iban and have the remote result, it is checked that the text entered is decodable according to the Iban type. The maximum size is set to 34 (maximum length of an IBAN) although an Italian iban has a maximum length of 27
  • Changed FooterTwoButtons.tsx in order to support a left text for the button.

How to test

  • The screen is reachable from everywhere, just need to dispatch the action bpdIbanInsertionStart()

fabriziofff and others added 28 commits September 29, 2020 17:35
@pagopa-github-bot pagopa-github-bot changed the title [#174847319] Iban insertion screen feat(Bonus Pagamenti Digitali): [#174847319] Iban insertion screen Oct 2, 2020
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Oct 2, 2020

Affected stories

  • 🌟 #174847319: Creare la schermata di inserimento IBAN

Generated by 🚫 dangerJS against f011eaf

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2020

Codecov Report

Merging #2259 into master will increase coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2259      +/-   ##
==========================================
+ Coverage   47.83%   47.84%   +0.01%     
==========================================
  Files         539      540       +1     
  Lines       15640    15656      +16     
  Branches     3136     3140       +4     
==========================================
+ Hits         7481     7491      +10     
- Misses       8118     8124       +6     
  Partials       41       41              
Impacted Files Coverage Δ
...usVacanze/components/markdown/FooterTwoButtons.tsx 57.14% <0.00%> (ø)
...tivation/request/ActivateBonusRequestComponent.tsx 68.00% <ø> (ø)
...ures/bonus/bpd/screens/iban/IbanKOCannotVerify.tsx 87.50% <ø> (ø)
...features/bonus/bpd/screens/iban/IbanKONotOwned.tsx 87.50% <ø> (ø)
ts/features/bonus/bpd/screens/iban/IbanKOWrong.tsx 81.25% <ø> (ø)
...ns/onboarding/declaration/DeclarationComponent.tsx 56.25% <ø> (ø)
.../screens/iban/insertion/IbanInsertionComponent.tsx 68.18% <68.18%> (ø)
...bpd/screens/iban/insertion/IbanInsertionScreen.tsx 72.72% <72.72%> (ø)
...features/bonus/bpd/screens/iban/MainIbanScreen.tsx 45.94% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a06825f...05e5ba8. Read the comment docs.

@codecov-io
Copy link

Codecov Report

Merging #2259 into master will increase coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2259      +/-   ##
==========================================
+ Coverage   47.83%   47.84%   +0.01%     
==========================================
  Files         539      540       +1     
  Lines       15640    15656      +16     
  Branches     3138     2885     -253     
==========================================
+ Hits         7481     7491      +10     
- Misses       8118     8124       +6     
  Partials       41       41              
Impacted Files Coverage Δ
...usVacanze/components/markdown/FooterTwoButtons.tsx 57.14% <0.00%> (ø)
...tivation/request/ActivateBonusRequestComponent.tsx 68.00% <ø> (ø)
...ures/bonus/bpd/screens/iban/IbanKOCannotVerify.tsx 87.50% <ø> (ø)
...features/bonus/bpd/screens/iban/IbanKONotOwned.tsx 87.50% <ø> (ø)
ts/features/bonus/bpd/screens/iban/IbanKOWrong.tsx 81.25% <ø> (ø)
...ns/onboarding/declaration/DeclarationComponent.tsx 56.25% <ø> (ø)
.../screens/iban/insertion/IbanInsertionComponent.tsx 68.18% <68.18%> (ø)
...bpd/screens/iban/insertion/IbanInsertionScreen.tsx 72.72% <72.72%> (ø)
...features/bonus/bpd/screens/iban/MainIbanScreen.tsx 45.94% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79f6710...a442da3. Read the comment docs.


export const IbanInsertionComponent: React.FunctionComponent<Props> = props => {
const [iban, setIban] = useState("");
const isInvalidIban = iban.length > 0 && Iban.decode(iban).isLeft();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const isInvalidIban = iban.length > 0 && Iban.decode(iban).isLeft();
const isInvalidIban = Iban.decode(iban).isLeft();

Iban.decode("") -> left

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this to avoid that when the user enter in the screen the first time (iban.length===0) immediately sees the error graphic without having started entering text yet.

What you think?

export const IbanInsertionComponent: React.FunctionComponent<Props> = props => {
const [iban, setIban] = useState("");
const isInvalidIban = iban.length > 0 && Iban.decode(iban).isLeft();
const userCanContinue = !isInvalidIban && iban.length > 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const userCanContinue = !isInvalidIban && iban.length > 0;
const userCanContinue = !isInvalidIban;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same reason as in the previous comment

@fabriziofff fabriziofff requested a review from Undermaken October 7, 2020 10:43
@Undermaken Undermaken merged commit 6351eff into master Oct 7, 2020
@Undermaken Undermaken deleted the 174847319-IbanInsertionScreen branch October 7, 2020 10:52
@Undermaken Undermaken restored the 174847319-IbanInsertionScreen branch October 7, 2020 10:54
@fabriziofff fabriziofff deleted the 174847319-IbanInsertionScreen branch January 21, 2022 11:46
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.

5 participants