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: [PE-553] CGN discount screen revamp #6087

Merged
merged 48 commits into from
Oct 11, 2024
Merged

Conversation

Hantex9
Copy link
Contributor

@Hantex9 Hantex9 commented Aug 2, 2024

Short description

This PR adds new screens and refactors the previous ones related to the detailed discount screens with another screen where the discount code might appear or show the webview with the discount landing page.

Designed Figma

https://www.figma.com/design/yOoBGDr1MJpa0LY5lDUFSd/IOapp_CartaGiovaniNazionale?node-id=6102-36816&t=ek5UqE6BwEaiVSgb-4

List of changes proposed in this pull request

  • Removed older components about the discount sub-feature of CGN;
  • Refactored the CgnMerchantDiscountItem component removing the older hook that was used to show a bottom sheet with the discount details;
  • Added two new screens with its navigator:
    • CgnDiscountDetailScreen: It's used to show the discount details
    • CgnDiscountCodeScreen: It's used to show the discount code if the provided discount is any type of api, staticCode or bucketCode;
  • Added a new selectMerchantDiscount action used to pick the discount details when the user tap on its details;
  • Added a new setMerchantDiscountCode action used to set the discount code to show in the CgnDiscountCodeScreen when the user taps on the Generate/Show discount code CTA;
  • Added locales

N.B: Tests of these pages will follow in another PR with another jira ticket

How to test

  • With the CGN card onboarded, open any merchant details page and you should see the behaviour showed in the following videos
Landing Page Static code
LANDING-PAGE.mov
static-code.mov
Bucket Code API Code
bucket-code.mov
api.mov

@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Aug 2, 2024

Affected stories

  • 🌟 PE-553: [FE] Modifica schermata dettaglio agevolazione
    subtask of
    • PE-511: CGN - Adeguamento flussi/schermate a nuovo DS 2.0

Generated by 🚫 dangerJS against bbdb8f8

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 9.00474% with 192 lines in your changes missing coverage. Please review.

Project coverage is 47.16%. Comparing base (4f204b4) to head (bbdb8f8).
Report is 579 commits behind head on master.

Files with missing lines Patch % Lines
...s/cgn/screens/discount/CgnDiscountDetailScreen.tsx 3.00% 97 Missing ⚠️
...nus/cgn/screens/discount/CgnDiscountCodeScreen.tsx 12.12% 29 Missing ⚠️
...omponents/merchants/discount/CgnDiscountHeader.tsx 10.52% 17 Missing ⚠️
...erchants/discount/CgnDiscountExpireProgressBar.tsx 13.33% 13 Missing ⚠️
...features/bonus/cgn/saga/networking/bucket/index.ts 0.00% 9 Missing ⚠️
ts/features/bonus/cgn/store/reducers/merchants.ts 20.00% 8 Missing ⚠️
...mponents/merchants/discount/CgnDiscountContent.tsx 12.50% 7 Missing ⚠️
ts/features/bonus/cgn/saga/networking/otp/index.ts 0.00% 6 Missing ⚠️
.../components/merchants/CgnMerchantsDiscountItem.tsx 16.66% 5 Missing ⚠️
.../cgn/screens/merchants/CgnMerchantDetailScreen.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6087      +/-   ##
==========================================
- Coverage   48.42%   47.16%   -1.27%     
==========================================
  Files        1488     1790     +302     
  Lines       31617    36156    +4539     
  Branches     7669     8698    +1029     
==========================================
+ Hits        15311    17052    +1741     
- Misses      16238    19038    +2800     
+ Partials       68       66       -2     
Files with missing lines Coverage Δ
...nus/cgn/components/merchants/CgnModuleDiscount.tsx 9.67% <100.00%> (ø)
ts/features/bonus/cgn/navigation/navigator.tsx 70.00% <ø> (ø)
ts/features/bonus/cgn/navigation/routes.ts 100.00% <ø> (ø)
ts/features/bonus/cgn/store/actions/bucket.ts 100.00% <ø> (ø)
ts/features/bonus/cgn/store/actions/merchants.ts 100.00% <100.00%> (ø)
ts/features/bonus/cgn/store/actions/otp.ts 100.00% <ø> (ø)
ts/features/design-system/core/DSListItems.tsx 55.55% <ø> (+28.88%) ⬆️
.../cgn/screens/merchants/CgnMerchantDetailScreen.tsx 12.12% <0.00%> (-0.70%) ⬇️
.../components/merchants/CgnMerchantsDiscountItem.tsx 22.22% <16.66%> (-17.78%) ⬇️
ts/features/bonus/cgn/saga/networking/otp/index.ts 0.00% <0.00%> (ø)
... and 7 more

... and 1388 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 3c3b14f...bbdb8f8. Read the comment docs.

@Hantex9 Hantex9 marked this pull request as ready for review August 2, 2024 11:10
@Hantex9 Hantex9 requested review from dmnplb, a team and thisisjp as code owners August 2, 2024 11:10
@thisisjp
Copy link
Contributor

thisisjp commented Aug 2, 2024

@Hantex9 few general questions:

  1. Why aren't we using the custom-tabs approach for webviews, same we did for the payment flow?
  2. Can we change the height of the bottom sheet according to the actual inner content?

@Hantex9
Copy link
Contributor Author

Hantex9 commented Aug 2, 2024

@Hantex9 few general questions:

  1. Why aren't we using the custom-tabs approach for webviews, same we did for the payment flow?
  2. Can we change the height of the bottom sheet according to the actual inner content?
  1. Because CGN merchants need to inject a header into the sites opened within our app, this header ensures that the user accessed the page through our app and not through another channel. This requirement cannot be met using the "custom tab" approach.
  2. Nope, that screen with the discount code inside isn't a bottom sheet, it's a modal

@Hantex9
Copy link
Contributor Author

Hantex9 commented Oct 8, 2024

are there any dead translation labels? (text we do not use anymore)

Removed unused translation labels in the following commit: 61156f0

@Hantex9
Copy link
Contributor Author

Hantex9 commented Oct 8, 2024

is this implemented? https://www.figma.com/design/yOoBGDr1MJpa0LY5lDUFSd/IOapp_CartaGiovaniNazionale?node-id=6102-36903&t=GUegOJgTBvvmBRMv-4

Thank you for pointing that out. Based on the comment left on Figma, it seems to be a design oversight, as with the current attributes provided by the backend, we are not able to determine when to display that banner.

Copy link
Member

@shadowsheep1 shadowsheep1 left a comment

Choose a reason for hiding this comment

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

LGTM

@Hantex9 Hantex9 merged commit 2f841bc into master Oct 11, 2024
13 checks passed
@Hantex9 Hantex9 deleted the PE-553-cgn-discount-revamp branch October 11, 2024 09:16
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.

5 participants