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(IT Wallet): [SIW-1047] Add loading states to wallet screen #5707

Merged
merged 18 commits into from
Apr 29, 2024

Conversation

mastro993
Copy link
Contributor

@mastro993 mastro993 commented Apr 19, 2024

Short description

This PR adds the loading skeleton to the wallet screen. The loading logics handles the asynchronous mutation of wallet credentials and allows to show a loading skeleton for credentials that may be added to the wallet.

List of changes proposed in this pull request

  • Added state, sagas and actions to handle wallet loading state mutations
  • Added withWalletCardBaseComponent HOC to WalletCardSkeleton component
  • Added WalletCardsCategoryContainerSkeleton component, which displays a skeleton for a wallet category.
  • Added loading logics to WalletCardsContainer
  • Refactored WalletHomeScreen to improve code readibility and to handle loading logics
  • Added tests

How to test

With the io-dev-api-server, enable the New wallet section FF from the profile screen. Navigate to the new wallet section and check that the loading state works as expected:

  • First time you visit, you should see a single card skeleton which disappears as soon new cards are added to the wollet
  • Following visits should display previous cards placeholder skeletons

Previews

Loading with empty state (no cards in wallet yet) Loading with cards Loading with placeholders
loading_empty.mp4
loading_no_placeholders.mp4
loading_placeholders.mp4

@mastro993 mastro993 changed the title Siw 1047 add loading skeleton to wallet screen [SIW-1047] Add loading states to wallet screen Apr 19, 2024
@pagopa-github-bot pagopa-github-bot changed the title [SIW-1047] Add loading states to wallet screen chore(IT Wallet): [SIW-1047] Add loading states to wallet screen Apr 19, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Apr 19, 2024

Affected stories

  • ⚙️ SIW-1047: Visualizzare skeleton card durante il caricamento della sezione portafoglio
    subtask of
    • 🌟 SIW-1009: Inserire stato loading in sezione portafoglio

Generated by 🚫 dangerJS against e8b8bb8

@mastro993 mastro993 force-pushed the SIW-1047-add-loading-skeleton-to-wallet-screen branch from b1f76fc to f2f8b9b Compare April 20, 2024 13:20
@mastro993 mastro993 marked this pull request as ready for review April 22, 2024 09:48
@mastro993 mastro993 requested a review from a team as a code owner April 22, 2024 09:48
Copy link
Contributor

@hevelius hevelius left a comment

Choose a reason for hiding this comment

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

LGTM

@mastro993 mastro993 merged commit a6ed63b into master Apr 29, 2024
11 checks passed
@mastro993 mastro993 deleted the SIW-1047-add-loading-skeleton-to-wallet-screen branch April 29, 2024 07:22
mastro993 added a commit that referenced this pull request Apr 29, 2024
> [!WARNING]
> This PR depends on #5707

## Short description
This PR adds a timeout for wallet card placeholder which are taking too
long to load or will never be added again to the wallet. This allows to
remove pending placeholders animation from the wallet section

## List of changes proposed in this pull request
- Added `walletResetPlaceholders` action, reducer and sagas

## How to test
You can test this PR easily with the `io-dev-api-server`, just add a new
CGN card then restart the dev server. The app will wait for a CGN card
to come but the server will never return any.

## Previews

| Before | After | 
| --- | --- | 
| <video
src="https://github.com/pagopa/io-app/assets/6160324/286361e8-3603-4b70-9c27-2ff6ff40ac0e"
/> | <video
src="https://github.com/pagopa/io-app/assets/6160324/b6885e40-f9dd-4ed8-ba9e-4883ad2df4a0"
/> |

---------

Co-authored-by: Mario Perrotta <mario.perrotta@pagopa.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants