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-1937] Improve wallet category filters #6570

Merged
merged 16 commits into from
Dec 20, 2024

Conversation

mastro993
Copy link
Contributor

@mastro993 mastro993 commented Dec 18, 2024

Short description

This PR fixes a bug in the wallet screen where users were unable to see any screen content if the category filters were in the wrong state. This PR also improves the debug data overlay and the wallet redux selectors.

Steps to reproduce the addressed bug

  • Navigate to the Wallet screen, ensure you have Documenti su IO enabled and at least one payment method saved
  • Select the "Other" category filter
  • Remove everything but ITW from the wallet, keeping the "Other" filter selected
  • Once you removed everything you should see a blank screen
  • Restarting the app should not fix the issue

List of changes proposed in this pull request

  • Added isWalletCategoryFilteringEnabledSelector selector to check if the category filtering is available: filtering is available only if there is more than one category in the wallet.
  • Added shouldRenderWalletCategorySelector selector to check if a wallet category section should be rendered, based on the currently selected filter and the number of categories available in the wallet
  • Added withWalletCategoryFilter HOC, which display a component based on the given category filter
  • Added selectWalletCardsByCategory and selectWalletCardsByType to select cards based on category or type, removing the need to have dedicated selectors
  • Removed selectWalletCgnCard and selectBonusCards selectors
  • Improved debug data in DebugInfoOverlay
    • Added the ability to display Set objects
    • Added the ability to add data from different components at the same time by merging data using the same key
  • Improved wallet category filtering
  • Refactored WalletCardsContainer with new selectors
  • Added useful/missing debug data
  • Added tests
  • Removed categoryFilter preference persistence from the wallet.preferences feature reducer

How to test

  • Static checks should pass
  • Navigate to the wallet screen and check that everything works fine, especially the category filters
  • Try to reproduce the bug, you should now see the wallet content.

@mastro993 mastro993 self-assigned this Dec 18, 2024
Copy link
Contributor

github-actions bot commented Dec 18, 2024

Jira Pull Request Link

This Pull Request refers to the following Jira issue SIW-1937

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 90.56604% with 5 lines in your changes missing coverage. Please review.

Project coverage is 49.30%. Comparing base (fbe9e87) to head (b52137a).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
ts/features/wallet/store/selectors/index.ts 86.95% 3 Missing ⚠️
...res/wallet/components/WalletCategoryFilterTabs.tsx 83.33% 1 Missing ⚠️
ts/features/wallet/store/reducers/preferences.ts 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6570      +/-   ##
==========================================
+ Coverage   42.85%   49.30%   +6.44%     
==========================================
  Files        1408     1555     +147     
  Lines       29557    32117    +2560     
  Branches     6659     7267     +608     
==========================================
+ Hits        12668    15834    +3166     
+ Misses      16860    16245     -615     
- Partials       29       38       +9     
Files with missing lines Coverage Δ
ts/components/debug/utils.ts 93.33% <100.00%> (ø)
ts/components/debug/withDebugEnabled.tsx 100.00% <100.00%> (ø)
.../onboarding/screens/WalletCardOnboardingScreen.tsx 80.43% <ø> (ø)
...eatures/wallet/components/WalletCardsContainer.tsx 100.00% <100.00%> (ø)
ts/features/wallet/saga/index.ts 14.28% <ø> (ø)
ts/features/wallet/utils/index.tsx 87.50% <100.00%> (+9.72%) ⬆️
ts/mixpanelConfig/mixpanelPropertyUtils.ts 97.56% <100.00%> (-0.12%) ⬇️
ts/store/reducers/debug.ts 72.22% <ø> (ø)
...res/wallet/components/WalletCategoryFilterTabs.tsx 94.73% <83.33%> (+39.18%) ⬆️
ts/features/wallet/store/reducers/preferences.ts 92.30% <66.66%> (-7.70%) ⬇️
... and 1 more

... and 349 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 a835a70...b52137a. Read the comment docs.

Copy link
Collaborator

@gispada gispada 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 added this pull request to the merge queue Dec 20, 2024
Merged via the queue into master with commit 9321272 Dec 20, 2024
21 checks passed
@mastro993 mastro993 deleted the SIW-1937-improve-wallet-category-filter branch December 20, 2024 14:21
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