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

refactor: [PE-921] CGN remove legacy and deprecated code #6642

Merged
merged 12 commits into from
Jan 28, 2025

Conversation

LeleDallas
Copy link
Contributor

@LeleDallas LeleDallas commented Jan 27, 2025

Short description

This pull request removes unused CGN components, updates the navigation, and improves the merchant list screen

List of changes proposed in this pull request

  • Removed the entire CgnMerchantsFilters, CategoryCheckbox and DistanceSlider components as they were unused.
  • Removed the unused TABS route from the CgnDetailsParamsList type
  • Refactored the merchant list screen to use the new navigation approach and handle loading/error states more effectively
  • Updated the onPressShowCgnDiscounts function to use the new navigation approach and removed unused dispatch actions
  • Replace LoadingErrorComponent with OperationResultScreenContent
  • Removed fixed background color styling for theming purpose
  • Replace BaseScreenComponent with useHeaderSecondLevel for CgnMerchantLandingWebview

How to test

Ensure that all CGN functionality works without regressions

Preview

Old New
Screen.Recording.2025-01-27.at.16.00.32.mov
Screen.Recording.2025-01-27.at.15.59.50.mov
Screenshot 2025-01-27 at 16 08 42 Screenshot 2025-01-27 at 16 10 08
Screenshot 2025-01-28 at 09 08 10 Screenshot 2025-01-28 at 09 07 41

This PR is also fixing some dark mode background issue

🌑 🌑
Screenshot 2025-01-27 at 15 52 14 Screenshot 2025-01-27 at 15 50 46

Copy link
Contributor

github-actions bot commented Jan 27, 2025

Jira Pull Request Link

This Pull Request refers to Jira issues:

Copy link
Contributor

PR Title Validation for conventional commit type

All good! PR title follows the conventional commit type.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 8.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 49.61%. Comparing base (47e46f3) to head (7a177dd).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...s/cgn/screens/merchants/CgnMerchantsListScreen.tsx 0.00% 8 Missing ⚠️
ts/features/bonus/cgn/screens/CgnDetailScreen.tsx 0.00% 2 Missing ⚠️
...gn/screens/merchants/CgnMerchantLandingWebview.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6642      +/-   ##
==========================================
+ Coverage   49.54%   49.61%   +0.06%     
==========================================
  Files        1547     1543       -4     
  Lines       32179    32119      -60     
  Branches     7286     7277       -9     
==========================================
- Hits        15944    15936       -8     
+ Misses      16197    16132      -65     
- Partials       38       51      +13     
Files with missing lines Coverage Δ
ts/features/bonus/cgn/navigation/navigator.tsx 70.00% <ø> (ø)
...s/cgn/screens/discount/CgnDiscountDetailScreen.tsx 69.30% <ø> (ø)
...n/screens/merchants/CgnMerchantsListByCategory.tsx 1.53% <ø> (ø)
...gn/screens/merchants/CgnMerchantLandingWebview.tsx 16.66% <50.00%> (ø)
ts/features/bonus/cgn/screens/CgnDetailScreen.tsx 4.83% <0.00%> (+0.29%) ⬆️
...s/cgn/screens/merchants/CgnMerchantsListScreen.tsx 10.34% <0.00%> (+0.66%) ⬆️

... and 13 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 47e46f3...7a177dd. Read the comment docs.

@dmnplb
Copy link
Contributor

dmnplb commented Jan 27, 2025

@LeleDallas Just run npx knip to see if there are any unused components. There is RNavScreenWithLargeHeader which is no longer used. I think we could just delete it. What do you think?

@dmnplb dmnplb added the 💀 Dead matter Graphic assets or chunks of code that are no longer referenced or needed label Jan 27, 2025
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.

LGTM! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Carta Giovani Nazionale Dark mode 🌝 💀 Dead matter Graphic assets or chunks of code that are no longer referenced or needed IO-Bonus e pagamenti IO - Bonus e pagamenti
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants