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: [IOPID-991] Integration of email validation logic in the onboarding flow and profile preferences flow #5206

Conversation

Ladirico
Copy link
Contributor

@Ladirico Ladirico commented Nov 7, 2023

Short description

In this PR, I integrated business logic that allows the validation of the email within both the onboarding and profile editing screens.

List of changes proposed in this pull request

  • business logic on the modify email in preferences NewEmailInsertScreen.tsx
  • added business logic on NewOnboardingEmailInsertScreen.tsx
  • integration of logic described in solution 2 of this RFC ProfileErrorType.ts
  • integration of the new openapi in this PR
  • fix accessibilityLabel on NewOptInScreen.tsx

Onboarding Flow

Registrazione.schermo.2023-11-22.alle.11.41.15.mov

How to test

  1. in this line change the value to YES
  2. make sure this branch and this branch are merged into master in io-dev-api-server
  3. in io-dev-api-server in this line set firstOnboarding: true
  4. in io-dev-api-server at this line and at this line set is_email_validated: true.
  5. in io-dev-api-server, in the same file as the last point, set is_email_already_taken: true if you need to display the alert on the screen NewEmailInsertScreen.
  6. run the application on io-dev-api-server
  7. To check for error 412 you can enter the e-mail [email protected].
  8. when you get to the verification screen, navigate to the browser at: http://localhost:3000/ and in the "email configuration" section press the "validate email" button
  9. continue the flow.

Change preferences flow

Registrazione.schermo.2023-11-22.alle.12.04.29.mov

How to test

Once logged in, go to your profile and select 'your data'. From here you can edit your email. The flow is almost the same as explained above (from point 7)

@Ladirico Ladirico added the IO-A&I IO - Autenticazione e Identità label Nov 7, 2023
@Ladirico Ladirico requested a review from shadowsheep1 November 7, 2023 16:54
@Ladirico Ladirico changed the title [IOPID-991] integration of email validation logic in the onboarding step [IOPID-991] integration of email validation logic in the onboarding flow and profile preferences flow Nov 7, 2023
@pagopa-github-bot pagopa-github-bot changed the title [IOPID-991] integration of email validation logic in the onboarding flow and profile preferences flow chore: [IOPID-991] Integration of email validation logic in the onboarding flow and profile preferences flow Nov 8, 2023
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Nov 8, 2023

Affected stories

  • ⚙️ IOPID-991: [APP] Integrazione schermata modifica email nelle preferenze
    subtask of
    • IOPID-62: Univocità indirizzi email

Generated by 🚫 dangerJS against dcb94a0

Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Merging #5206 (9437cb9) into master (ef78c16) will decrease coverage by 0.14%.
The diff coverage is 30.00%.

❗ Current head 9437cb9 differs from pull request most recent head dcb94a0. Consider uploading reports for the commit dcb94a0 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5206      +/-   ##
==========================================
- Coverage   48.00%   47.86%   -0.14%     
==========================================
  Files        1565     1567       +2     
  Lines       32398    32494      +96     
  Branches     7947     7979      +32     
==========================================
+ Hits        15553    15554       +1     
- Misses      16795    16890      +95     
  Partials       50       50              
Files Coverage Δ
ts/screens/authentication/NewOptInScreen.tsx 85.71% <ø> (ø)
ts/store/actions/profile.ts 100.00% <ø> (ø)
ts/navigation/ProfileNavigator.tsx 33.33% <0.00%> (-4.17%) ⬇️
ts/store/reducers/profile.ts 59.09% <66.66%> (-2.09%) ⬇️
ts/hooks/useValidateEmailModal.tsx 7.69% <0.00%> (+1.44%) ⬆️
ts/navigation/OnboardingNavigator.tsx 33.33% <0.00%> (-33.34%) ⬇️
ts/screens/profile/ProfileDataScreen.tsx 65.00% <50.00%> (-7.23%) ⬇️
ts/sagas/profile.ts 21.13% <0.00%> (-0.72%) ⬇️
ts/components/NewRemindEmailValidationOverlay.tsx 81.08% <45.45%> (-0.08%) ⬇️
ts/store/reducers/profileErrorType.ts 0.00% <0.00%> (ø)
... and 2 more

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 ef78c16...dcb94a0. Read the comment docs.

locales/en/index.yml Outdated Show resolved Hide resolved
locales/en/index.yml Outdated Show resolved Hide resolved
locales/en/index.yml Outdated Show resolved Hide resolved
locales/en/index.yml Outdated Show resolved Hide resolved
sabontech and others added 5 commits November 15, 2023 09:45
## Short description
This pr adds the logic that allows the app not to show the biometric
activation request if it has already been activated in a previous login
and adds, in the case of FACE_ID, the prompt requesting permissions upon
activation.

## List of changes proposed in this pull request
-
ts/sagas/startup/onboarding/biometric/checkAcknowledgedFingerprintSaga.ts:
added check to see if it had been activated in the last login.
- [ts/screens/onboarding/biometric&securityChecks/FingerprintScreen.tsx
, ts/screens/profile/SecurityScreen.tsx] : added permission request
prompt in case of faceid.
- ts/store/reducers/index.ts: biometric preference persisted to get it
also after the end of a session.
- ts/store/reducers/onboarding.ts: added reset of biometric control also
after session expired.
- ts/store/reducers/persistedPreferences.ts: added cross session
control.
- ts/utils/biometrics.ts: added function that handles the biometric
activation.

## How to test
With a new installation, try activating biometrics during onboarding:
- If the biometric is not FaceID, it should activate (or not) the
feature without prompting.
- If the biometric is FaceID, when the active button is pressed, it
should present the request for permissions:
- If you give permissions and the authentication fails, it should not
proceed.
- If you give permissions and the authentication is successful, it
should proceed and enable the feature.
- If you don't give permissions, it should proceed and not activate the
feature.
    
After logout or session expired, if the biometric has been activated
during last session, it should not ask you for activation again after
login, unless this is done with a different account than the previous
one.

---------

Co-authored-by: Fabio Bombardi <[email protected]>
Co-authored-by: Cristiano Tofani <[email protected]>
…ils screen (#5209)

## Short description
This PR fixes the ID Pay initiative rules info bottom sheet height for
shorter contents.



https://github.com/pagopa/io-app/assets/6160324/7ffc63cf-82d8-4349-a55a-651157537887


## List of changes proposed in this pull request
-
[ts/features/idpay/details/components/InitiativeRulesInfoBox.tsx](https://github.com/pagopa/io-app/compare/IOBP-361-fix-idpay-rules-bottom-sheet?expand=1#diff-aec7df12aad70c4276336c3813019b4655fac37dc09eb456b93208f7c6b8b302):
increased bottom padding to `170` for the rules bottom sheet
-
[ts/features/idpay/details/components/BeneficiaryDetailsContent.tsx](https://github.com/pagopa/io-app/compare/IOBP-361-fix-idpay-rules-bottom-sheet?expand=1#diff-763f13f0b9f72e4763aa758664939937121a62cc637c86ff29bfe6f41ab7d56c):
component props refactoring

## How to test
Navigate to the ID Pay initiative details screen and check that the
rules bottom sheet is correctly displayed.

Co-authored-by: Alessandro Izzo <[email protected]>
Copy link

dpulls bot commented Nov 20, 2023

🎉 All dependencies have been resolved !

@Ladirico Ladirico marked this pull request as ready for review November 24, 2023 13:39
@Ladirico Ladirico requested review from thisisjp and a team as code owners November 24, 2023 13:39
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

@Ladirico Ladirico merged commit 1aeee14 into master Nov 28, 2023
5 checks passed
@Ladirico Ladirico deleted the IOPID-991-app-integrazione-schermata-modifica-email-nelle-preferenze branch November 28, 2023 13:33
Ladirico added a commit that referenced this pull request Dec 4, 2023
## ⚠️ Depends on #5206 ⚠️ ##

## Short description
This PR blocks the user if their email is not verified or is already
taken, forcing them to validate or change it. The flow is described in
this
[Figma](https://www.figma.com/file/oLJMcWd0SbRHDtj7WRvu7N/Univocit%C3%A0-indirizzi-email?type=design&node-id=31-12161&mode=design&t=np5Q8HLkqXhrq6ey-4).

## List of changes proposed in this pull request
- The two modal `ValidateEmailModal` and `EmailAlreadyUsedModal` has
been changed to their sibling screen component `ValidateEmailScreen` and
`EmailAlreadyTakenScreen` to use the navigation capabilities.
- A new redux state has been added to `EmailValidationState` to know if
we are landing to `EmailInsertScreen` from the standard flow or because
the user has been block during the startup process.

## How to test
Enable the `new CDU flow` and using the `io-dev-api-server` try to:
- Enter the app as a new user (firstOnboardig: true) and see that you
are blocked until you have validated your email. Even if you reload the
app.
- Change your email in the profile section and see that you are blocked
until you have validated your email, even if you reload the app.
- Try to invalidate the email and set it as "already taken", and restart
the app. You should see that you are blocked until you have changed and
successfully validated the new email, even if you reload the app.

> At app startup if `isEmailValidated=true` the user can continue
without problems, otherwise if `isEmailValidated=false` the user sees
`ValidateEmailScreen` or `EmailAlreadyTakenScreen` based on the value of
`isEmailAlreadyTaken`.

<details open><summary>Details</summary>
<p>

<video
src="https://github.com/pagopa/io-app/assets/16268789/6aa4156e-71e0-4cc1-9071-19fafbe8bbc8"
/>

</p>
</details>

---------

Co-authored-by: Alice Di Rico <[email protected]>
Co-authored-by: Alice Azzolini <[email protected]>
Co-authored-by: Sabino <[email protected]>
Co-authored-by: Cristiano Tofani <[email protected]>
Co-authored-by: Andrea Piai <[email protected]>
Co-authored-by: Federico Mastrini <[email protected]>
Co-authored-by: Alessandro Izzo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO-A&I IO - Autenticazione e Identità
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants