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

[IOPID-1139] Refactored home dashboard & added profile custom configuration for email validation #321

Merged
merged 9 commits into from
Nov 24, 2023

Conversation

sabontech
Copy link
Contributor

@sabontech sabontech commented Nov 22, 2023

Short description

This pr:

  • adds new management of the dev server home to be able to insert configurations in a modular way.
  • adds the configuration for email validation.
  • refactor the way the profile is managed.
  • updates the README accordingly.
Details of the new dashboard section

image

List of changes proposed in this pull request

  • assets/html/homeDashboard.html: new home.
  • assets/html/mail.html: new mail configuration option.
  • src/persistence/profile.ts: logic to manage the profile data.
  • src/routers/configHomeDashboard/configHomeDashboard.ts: logic to add configuration component to the dev server home.
  • src/routers/profile.ts: added the logic to enable the profile custom config.
  • src/routers/profileCustomConfig/mailDashboardConfig.ts: added logic to handle the custom email configuration.
  • src/routers/walletsV2/configDashboard.ts: removed the handler that shows the wallet configuration in home.
  • src/server.ts: added new routers.
  • README.md: updated accordingly.

How to test

  • Try creating new "html components" and adding them to the homeDashboard file with the tag.
  • Try modifying the email validation configuration and verify that the payload of the get and post profile calls responds as you expect.

@sabontech sabontech added the IO-A&I IO - Autenticazione e Identità label Nov 22, 2023
Sabino Picariello added 2 commits November 22, 2023 11:29
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #321 (756d3d6) into master (cafc36d) will decrease coverage by 0.09%.
Report is 1 commits behind head on master.
The diff coverage is 74.17%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #321      +/-   ##
==========================================
- Coverage   67.73%   67.65%   -0.09%     
==========================================
  Files         144      147       +3     
  Lines        5009     5086      +77     
  Branches      587      599      +12     
==========================================
+ Hits         3393     3441      +48     
- Misses       1615     1644      +29     
  Partials        1        1              
Files Coverage Δ
src/routers/profile.ts 100.00% <100.00%> (+8.69%) ⬆️
src/routers/walletsV2/configDashboard.ts 30.00% <ø> (-1.82%) ⬇️
src/server.ts 100.00% <100.00%> (ø)
src/persistence/profile/userMetadata.ts 94.11% <94.11%> (ø)
src/persistence/profile/profile.ts 80.00% <80.00%> (ø)
src/routers/public.ts 68.00% <23.07%> (-5.22%) ⬇️
...routers/configHomeDashboard/configHomeDashboard.ts 23.80% <23.80%> (ø)

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 3009999...756d3d6. Read the comment docs.

@shadowsheep1 shadowsheep1 marked this pull request as ready for review November 24, 2023 12:04
Copy link
Contributor

@Ladirico Ladirico left a comment

Choose a reason for hiding this comment

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

LGTM! 💎

@sabontech sabontech merged commit 7db8657 into master Nov 24, 2023
6 checks passed
@sabontech sabontech deleted the IOPID-1139-email-validation branch November 24, 2023 13:53
Ladirico added a commit to pagopa/io-app that referenced this pull request Nov 28, 2023
…rding flow and profile preferences flow (#5206)

## 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](https://pagopa.atlassian.net/wiki/spaces/IAEI/pages/792166441/RFC+-+2013+Gestione+Errore+GET+e+POST+della+chiamata+API+profile+nell+UI+dell+app+IO)
`ProfileErrorType.ts`
- integration of the new openapi [in this PR
](pagopa/io-backend#1068)
- fix accessibilityLabel on `NewOptInScreen.tsx `

## Onboarding Flow


https://github.com/pagopa/io-app/assets/83651704/4bfeab28-b01e-4ffb-af23-dd861f9f26e8

## How to test
1. in [this
line](https://github.com/pagopa/io-app/blob/8d955e2a92223c0dd1baee255df383ee84ca1545/.env.local#L101)
change the value to YES
2. make sure [this
branch](pagopa/io-dev-api-server#317) and[ this
branch](pagopa/io-dev-api-server#321) are merged
into master in
[io-dev-api-server](https://github.com/pagopa/io-dev-api-server)
3. in io-dev-api-server [in this
line](https://github.com/pagopa/io-dev-api-server/blob/284edc21086fe0cfae39462958c8e8114d762f04/src/config.ts#L67C4-L67C28)
set `firstOnboarding: true`
4. in io-dev-api-server [at this
line](https://github.com/pagopa/io-dev-api-server/blob/284edc21086fe0cfae39462958c8e8114d762f04/src/payloads/profile.ts#L49)
and [at this
line](https://github.com/pagopa/io-dev-api-server/blob/284edc21086fe0cfae39462958c8e8114d762f04/src/payloads/profile.ts#L74)
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](https://www.figma.com/file/oLJMcWd0SbRHDtj7WRvu7N/Univocit%C3%A0-indirizzi-email?type=design&node-id=7-10909&mode=design&t=f1xmwaHUSRRROj50-0),
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


https://github.com/pagopa/io-app/assets/83651704/e7cbaede-9fa6-4e2b-87de-5e7d3a8edd59

## 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)

---------

Co-authored-by: Alice Azzolini <[email protected]>
Co-authored-by: Fabio Bombardi <[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.

3 participants