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: [IOPID-1724,IOPID-1726,IOPID-1727] Revamp CieCardReaderScreen #5773

Merged

Conversation

shadowsheep1
Copy link
Member

@shadowsheep1 shadowsheep1 commented May 15, 2024

Short description

This PR revamps the CieCardReaderScreen with the new DS.

Warning

In this PR there's a descoping tracked with this JIRA task.

Demo

Flow

🤖 🤖 Errors 🤖 Extended APDU Error
-.cie.login.mp4
-.cie.login.mp4
-.extended.adpu.mp4
🍏 🍏 Errors
-.cie.login.MP4.MP4
-.cie.login.MP4

a11y

🤖 🍏
-.cie.login.-.a11y.mp4
-.cie.login.-.a11y.MP4.MP4

List of changes proposed in this pull request

Removals

Additions

Note

CieUnexpectedErrorScreen is rendered on those EIC SDK events:

"AUTHENTICATION_ERROR" 
"ON_NO_INTERNET_CONNECTION"

and CieWrongCardScreen is shown when we have those events:

"TAG_ERROR_NFC_NOT_SUPPORTED" (iOS - info passed as "Function not supported")
"ON_TAG_DISCOVERED_NOT_CIE" (Android)

while CieExtendedApduNotSupportedScreen is visible for:

"EXTENDED_APDU_NOT_SUPPORTED" (Android)

"you have withdrawn you card, please retry and hold it still..." message, is now only visible during those events:

"Transmission Error"
"ON_TAG_LOST"

Modifications

Tip

The a11y focus on CieCardReaderScreen is handled only for Android, like it is also the a11y announcements (governed by the content state property, which is set only on Android), because iOS handles a11y focus through the system NFC bottom sheet.

How to test

Run the app against physical devices, both Android and iOS, and test the EIC login flow. Try set a wrong EIC PIN, try to withdraw the EIC during the reading process, and so on...

@shadowsheep1 shadowsheep1 self-assigned this May 15, 2024
@shadowsheep1 shadowsheep1 added dont-merge ✋ IO-A&I IO - Autenticazione e Identità labels May 15, 2024
@pagopa-github-bot pagopa-github-bot changed the title [IOPID-1724,IOPID-1726,IOPID-1727] Revamp CieCardReaderScreen feat: [IOPID-1724,IOPID-1726,IOPID-1727] Revamp CieCardReaderScreen May 15, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented May 15, 2024

Warnings
⚠️

Multiple stories with different types are associated with this Pull request.
Only one tag will be added, following the order: feature > bug > chore

Affected stories

  • 🌟 IOPID-1724: [DS-CIE] [APP] Lettura carta KO (Common iOS/Android)
    subtask of
  • 🌟 IOPID-1726: [DS-CIE][APP] Lettura carta iOS
    subtask of
  • 🌟 IOPID-1727: [DS-CIE][APP] Lettura carta Android
    subtask of

Generated by 🚫 dangerJS against 3ff4f34

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 10.00000% with 72 lines in your changes are missing coverage. Please review.

Project coverage is 49.74%. Comparing base (4f204b4) to head (3ff4f34).
Report is 106 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5773      +/-   ##
==========================================
+ Coverage   48.42%   49.74%   +1.31%     
==========================================
  Files        1488     1629     +141     
  Lines       31617    32383     +766     
  Branches     7669     7888     +219     
==========================================
+ Hits        15311    16108     +797     
+ Misses      16238    16212      -26     
+ Partials       68       63       -5     
Files Coverage Δ
ts/features/design-system/navigation/navigator.tsx 18.75% <ø> (-4.11%) ⬇️
ts/navigation/AuthenticationNavigator.tsx 40.00% <ø> (ø)
ts/navigation/routes.ts 100.00% <ø> (ø)
...s/authentication/cie/CieConsentDataUsageScreen.tsx 3.33% <0.00%> (-3.81%) ⬇️
ts/components/cie/CieReadingCardAnimation.tsx 6.89% <40.00%> (-1.04%) ⬇️
.../authentication/cie/CieCardReaderScreenWrapper.tsx 20.00% <20.00%> (ø)
...tication/cie/CieExtendedApduNotSupportedScreen.tsx 16.66% <16.66%> (ø)
ts/screens/authentication/cie/CiePinScreen.tsx 7.69% <0.00%> (-4.08%) ⬇️
...ns/authentication/cie/CieUnexpectedErrorScreen.tsx 11.11% <11.11%> (ø)
.../screens/authentication/cie/CieWrongCardScreen.tsx 11.11% <11.11%> (ø)
... and 1 more

... and 557 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 7344fab...3ff4f34. Read the comment docs.

@mariateresaventura
Copy link
Contributor

@mariateresaventura copy review needed! 🙏

Done!

@Ladirico
Copy link
Contributor

Hi @shadowsheep1
I noticed two little bugs:

  1. In the screen recording of Android errors (seconds 32 to 34) a pictogram for a frame can be seen. (img. 1)
  2. On iOS it looks to me like the errors displayed in the bottomsheet are different from figma. (img.2)

Img 1 Img 2
img 1 img 2

}, [navigation]);

const navigateToAuthenticationScreen = React.useCallback(() => {
navigation.reset({
Copy link
Contributor

Choose a reason for hiding this comment

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

In app there are few occurrences of navigation.reset (even in similar situations) do you think it is appropriate to use this feature and also ask other developers to make it a best practice?

Copy link
Member Author

Choose a reason for hiding this comment

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

do you think it is appropriate to use this feature

Using reset depends on the specific flow/use case. Here I only extracted the navigation we actually have from the deprecated use of NavigationService in a JSX Component, where we should use navigation, coming from useNavigation(), instead.

ask other developers to make it a best practice

I don't. As I said before using reset instead of other kind of navigations depends on the specific use case/flow. Remember that we also have an architecture with multiple navigation stack, where the main stack changes according to some conditions, so I don't think that reset would be applicable in a more generic way, but in this specific case, reset works great.

I don't know if I've answered your doubts. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, thanks!

@shadowsheep1
Copy link
Member Author

shadowsheep1 commented May 28, 2024

Hi @shadowsheep1 I noticed two little bugs:

  1. In the screen recording of Android errors (seconds 32 to 34) a pictogram for a frame can be seen. (img. 1)
  2. On iOS it looks to me like the errors displayed in the bottomsheet are different from figma. (img.2)
Img 1 Img 2
img 1 img 2

Good catch 🚀!

For the Android part it's a race condition with the modal presentation transition and the virtual keyboard opening. I guess we'll have this kind of behavior in other situations if we leave things like they are.

I suggest to remove the modal transition for Android:

<Stack.Group
      screenOptions={{
        gestureEnabled: false,
        headerShown: false,
        ...Platform.select({
          ios: TransitionPresets.ModalSlideFromBottomIOS,
          default: undefined
        })
      }}
    >
Android.mp4

What do you think?

For the iOS part, this kind of message is hardcoded in the cie-ios-sdk, and we cannot configure it from RN side. A more structural refactoring of the EIC SDK, should be done. This is not subject of this PR and, as you know, a total refactor of this SDK is in waiting to be sure not to do the same work in multiple stream.
What you see on Figma has been addressed only for AUTHENTICATION_ERROR.

@Ladirico
Copy link
Contributor

Hi @shadowsheep1 I noticed two little bugs:

  1. In the screen recording of Android errors (seconds 32 to 34) a pictogram for a frame can be seen. (img. 1)
  2. On iOS it looks to me like the errors displayed in the bottomsheet are different from figma. (img.2)

Img 1
Img 2

img 1 img 2

Good catch 🚀!

For the Android part it's a race condition with the modal presentation transition and the virtual keyboard opening. I guess we'll have this kind of behavior in other situations if we leave things like they are.

I suggest to remove the modal transition for Android:

<Stack.Group
      screenOptions={{
        gestureEnabled: false,
        headerShown: false,
        ...Platform.select({
          ios: TransitionPresets.ModalSlideFromBottomIOS,
          default: undefined
        })
      }}
    >

Android.mp4
What do you think?

For the iOS part, this kind of message is hardcoded in the cie-ios-sdk, and we cannot configure it from RN side. A more structural refactoring of the EIC SDK, should be done. This is not subject of this PR and, as you know, a total refactor of this SDK is in waiting to be sure not to do the same work in multiple stream. What you see on Figma has been addressed only for AUTHENTICATION_ERROR.

Yes, the change for Android works for me! We can proceed!

@shadowsheep1
Copy link
Member Author

shadowsheep1 commented May 28, 2024

[...]
Yes, the change for Android works for me! We can proceed!

@Ladirico Done 801ec00 ! Thanks!

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!

@shadowsheep1 shadowsheep1 merged commit a001580 into master May 29, 2024
13 checks passed
@shadowsheep1 shadowsheep1 deleted the IOPID-1724-1726-1727-revamp-cie-card-reader-screen branch May 29, 2024 07:30
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.

None yet

4 participants