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

chore: [IOBP-1020] Using optimistic UI for remove payment method action #6446

Conversation

LeleDallas
Copy link
Contributor

Short description

This pull request introduces several changes to include an optimistic UI logic for the handling of deleted wallet cards in the wallet management system

List of changes proposed in this pull request

  • Introduced a new DeletedCard type and updated the WalletCardsState type to include an optional deletedCard property.
  • Added logic to handle the paymentsDeleteMethodAction request, cancel, and failure actions, ensuring that deleted cards can be restored if necessary.
  • Modified the selectWalletCards selector to exclude the deletedCard from the list of wallet cards.
  • Removed the call to walletRemoveCards and added logic to dispatch a failure action with network error details if the deletion fails

How to test

  • Try to remove a payment method with a backend error (add a delay to the dev-server addPaymentWalletHandler delete function with 400 response)
  • Check if the deleted method is coming back at its original position

Preview

Screen.Recording.2024-11-22.at.10.25.31.mov

@LeleDallas LeleDallas added the IO-Bonus e pagamenti IO - Bonus e pagamenti label Nov 22, 2024
@LeleDallas LeleDallas changed the title Iobp 1020 using optimistic UI for remove payment method action refactor: [IOBP-1020] Using optimistic UI for remove payment method action Nov 22, 2024
@pagopa-github-bot pagopa-github-bot changed the title refactor: [IOBP-1020] Using optimistic UI for remove payment method action chore: [IOBP-1020] Using optimistic UI for remove payment method action Nov 22, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Nov 22, 2024

Affected stories

  • ⚙️ IOBP-1020: [FE] Implementazione optimistic UI alla rimozione di un metodo di pagamento
    subtask of
    • IOBP-701: Evolutive flusso di on-boarding/pagamento

Generated by 🚫 dangerJS against a474bb5

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.

Project coverage is 48.41%. Comparing base (4f204b4) to head (a474bb5).
Report is 838 commits behind head on master.

Files with missing lines Patch % Lines
...payments/details/saga/handleDeleteWalletDetails.ts 0.00% 2 Missing ⚠️
ts/features/wallet/store/reducers/cards.ts 84.61% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6446      +/-   ##
==========================================
- Coverage   48.42%   48.41%   -0.01%     
==========================================
  Files        1488     1577      +89     
  Lines       31617    32183     +566     
  Branches     7669     7331     -338     
==========================================
+ Hits        15311    15583     +272     
- Misses      16238    16547     +309     
+ Partials       68       53      -15     
Files with missing lines Coverage Δ
ts/features/wallet/store/selectors/index.ts 87.50% <100.00%> (ø)
...payments/details/saga/handleDeleteWalletDetails.ts 0.00% <0.00%> (ø)
ts/features/wallet/store/reducers/cards.ts 93.93% <84.61%> (ø)

... and 1712 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

Copy link
Contributor

@Hantex9 Hantex9 left a comment

Choose a reason for hiding this comment

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

Good job! Tested on iOS simulator and Android emulator with different cases and it works as expected ✨

LGTM!

@LeleDallas LeleDallas merged commit 274fa6f into master Dec 5, 2024
12 checks passed
@LeleDallas LeleDallas deleted the IOBP-1020-using-optimistic-ui-for-remove-payment-method-action branch December 5, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO-Bonus e pagamenti IO - Bonus e pagamenti
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants