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

fix: [IOPID-2169] Fix toast messages behavior in the PrivacyMainScreen #6526

Merged
merged 16 commits into from
Dec 12, 2024

Conversation

ChrisMattew
Copy link
Collaborator

@ChrisMattew ChrisMattew commented Dec 10, 2024

Short description

This PR fixes the double toast message displayed when navigating to the PrivacyMainScreen and retrieving information regarding the potential state of profile data download and/or account deletion is not possible. A single, less detailed toast message has been chosen instead of the previous two, which will be shown in case of an error in retrieving one or both pieces of information.

List of changes proposed in this pull request

  • checkUpdate now takes a list of choices and manages the logic for displaying the toast message and both alerts internally.

Demo

Before After
before-privacy-toast-message.mp4
after-privacy-toast-message.mp4

How to test

There are several ways to test this scenario. Personally, I tested it locally on the simulator by turning off the dev server or using a proxy tool (e.g., Proxyman) to manipulate the responses of the relevant requests before opening the screen. Simply put, on a physical device (or on a simulator in a production environment), you can replicate it by disabling the connection just before opening the screen. The choice is yours.

@ChrisMattew ChrisMattew self-assigned this Dec 10, 2024
@pagopa-github-bot pagopa-github-bot changed the title [IOPID-2169] Fix toast messages behavior in the PrivacyMainScreen fix: [IOPID-2169] Fix toast messages behavior in the PrivacyMainScreen Dec 10, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Dec 10, 2024

Affected stories

  • 🐞 IOPID-2169: [APP] Doppio toast di errore nella schermata dell'informativa Privacy
    subtask of

Generated by 🚫 dangerJS against e504670

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 61.29032% with 12 lines in your changes missing coverage. Please review.

Project coverage is 49.15%. Comparing base (4f204b4) to head (e504670).
Report is 871 commits behind head on master.

Files with missing lines Patch % Lines
ts/screens/profile/PrivacyMainScreen.tsx 61.29% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6526      +/-   ##
==========================================
+ Coverage   48.42%   49.15%   +0.72%     
==========================================
  Files        1488     1550      +62     
  Lines       31617    31972     +355     
  Branches     7669     7233     -436     
==========================================
+ Hits        15311    15716     +405     
+ Misses      16238    16217      -21     
+ Partials       68       39      -29     
Files with missing lines Coverage Δ
ts/screens/profile/PrivacyMainScreen.tsx 77.65% <61.29%> (-10.35%) ⬇️

... and 1720 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 3118440...e504670. Read the comment docs.

@ChrisMattew
Copy link
Collaborator Author

@mariateresaventura copy review needed! 🙏🏻

@mariateresaventura
Copy link
Contributor

@mariateresaventura copy review needed! 🙏🏻

Done!

Comment on lines 241 to 252
if (pot.isError(userDataProcessing.DOWNLOAD)) {
// eslint-disable-next-line functional/immutable-data
canShowTooltipRef.current = true;
setRequestProcess(true);
dispatch(
loadUserDataProcessing.request(
UserDataProcessingChoiceEnum.DOWNLOAD
)
);
} else {
handleUserDataRequestAlert(UserDataProcessingChoiceEnum.DOWNLOAD);
}
Copy link
Member

Choose a reason for hiding this comment

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

What about wrapping this login inside a function having as parameter the UserDataProcessingChoiceEnum. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the hint!

Copy link
Collaborator Author

@ChrisMattew ChrisMattew Dec 11, 2024

Choose a reason for hiding this comment

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

Addressed here

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

@ChrisMattew ChrisMattew merged commit 9232798 into master Dec 12, 2024
12 checks passed
@ChrisMattew ChrisMattew deleted the IOPID-2169-fix-duplicated-toast-message branch December 12, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 IO-A&I IO - Autenticazione e Identità
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants