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(IT Wallet): [SIW-722] Add verifyAndParseCredential phase to credential issuing #5310

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

LazyAfternoons
Copy link
Contributor

@LazyAfternoons LazyAfternoons commented Dec 6, 2023

Short description

Depends on this PR.

This PR introduces the verifyAndParseCredential phase to the credential issuing flow.

List of changes proposed in this pull request

  • Replaces the manual verify and parse phase in ItwIssuanceSaga.ts with the library verifyAndParseCredential function which already returns a Record of claims;
  • Adjusts ItwCredentialClaimsList.tsx to get the claims from the new Record structure. There's no need to use the credentialConfigurationSchema anymore.

How to test

Reset the wallet. Test a credential issuing flow, the claims should be displayed just as before.

@pagopa-github-bot pagopa-github-bot changed the title [SIW-722] Add verifyAndParseCredential phase to credential issuing chore(IT Wallet): [SIW-722] Add verifyAndParseCredential phase to credential issuing Dec 6, 2023
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Dec 6, 2023

Affected stories

  • ⚙️ SIW-722: [APP] Aggiungere fase VerificationAndParseCredential durante l'ottenimento di una credenziale
    subtask of
    • SIW-165: Ottenimento Credenziale

Generated by 🚫 dangerJS against d68eaf2

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Merging #5310 (d68eaf2) into bundle/it-wallet (15b6a49) will decrease coverage by 0.01%.
Report is 5 commits behind head on bundle/it-wallet.
The diff coverage is 15.38%.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                  @@
##           bundle/it-wallet    #5310      +/-   ##
====================================================
- Coverage             46.36%   46.36%   -0.01%     
====================================================
  Files                  1637     1637              
  Lines                 33976    33982       +6     
  Branches               8237     8241       +4     
====================================================
+ Hits                  15754    15755       +1     
- Misses                18171    18176       +5     
  Partials                 51       51              
Files Coverage Δ
.../it-wallet/store/reducers/itwCredentialsReducer.ts 34.61% <ø> (ø)
ts/features/it-wallet/saga/new/itwIssuanceSaga.ts 0.00% <0.00%> (ø)
...it-wallet/screens/presentation/ItwPrPidDetails.tsx 4.76% <0.00%> (ø)
ts/features/it-wallet/utils/pid.ts 26.66% <0.00%> (ø)
...eatures/it-wallet/components/ItwCredentialCard.tsx 35.48% <0.00%> (ø)
ts/features/it-wallet/utils/mocks.ts 37.50% <0.00%> (-5.36%) ⬇️
...s/it-wallet/components/ItwCredentialClaimsList.tsx 11.90% <23.52%> (+1.37%) ⬆️

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 727e5c9...d68eaf2. Read the comment docs.

@hevelius
Copy link
Contributor

hevelius commented Dec 14, 2023

@LazyAfternoons this PR can be reviewed? What's missing?

@LazyAfternoons
Copy link
Contributor Author

@LazyAfternoons this PR can be reviewed? What's missing?

It needs this fix in io-react-native-wallet, otherwise it won't work properly.

@LazyAfternoons LazyAfternoons marked this pull request as ready for review December 15, 2023 09:38
@LazyAfternoons LazyAfternoons requested a review from a team as a code owner December 15, 2023 09:38
Copy link
Contributor

@hevelius hevelius left a comment

Choose a reason for hiding this comment

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

LGTM

@hevelius hevelius merged commit 84e55db into bundle/it-wallet Dec 18, 2023
6 checks passed
@hevelius hevelius deleted the SIW-722-verification-and-parse-credential branch December 18, 2023 09:44
hevelius added a commit that referenced this pull request Dec 18, 2023
## Short description
Depends on #5310, #5315 and #5321.

This PR introduces a refactors in how we render the claims list. The
general idea behind this refactor is that we are parsing the `unknown`
value of a claim with io-ts decoders to known which kind of claim we are
manipulating, thus rendering an appropriate component to display it.

## List of changes proposed in this pull request
- Defines a set of decoders for our claims; 
- Adds a `itwCredentialClaim.tsx` which decodes the claim and renders
the appropriate component;
- Align `ItwCredentialClaimsList.tsx` to the new changes;
- Moves every claim related util to `ItwClaimsUtils`.

## How to test
Test the available credentials, each claim should be render properly
formatted.

---------

Co-authored-by: Mario Perrotta <mario.perrotta@pagopa.it>
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.

None yet

3 participants