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-2566] Refactor AuthErrorComponent #6565

Merged
merged 13 commits into from
Jan 7, 2025
Merged

Conversation

ChrisMattew
Copy link
Collaborator

@ChrisMattew ChrisMattew commented Dec 18, 2024

Short description

This PR removes the onRetry function from the AuthErrorScreen navigation params in order to suppress the warning related to it. The retry logic is now handled in a dedicated redux reducer.

Important

In the ts/screens/authentication/IdpLoginScreen.tsx component the navigate method has been replaced with the replace. This change gives us the possibility to skip the retryLollipopLogin step because the replace unmounts the route and in a further navigation on the ts/screens/authentication/IdpLoginScreen.tsx the useLollipopLoginSource hook will be executed from start.

List of changes proposed in this pull request

  • Removed onRetry from the AuthErrorScreen navigation params
  • Added isNativeLogin param into the AuthErrorScreen navigation params
  • Moved the ts/screens/authentication/IdpLoginScreen.tsx and ts/screens/authentication/idpAuthSessionHandler.tsx retry logic in a dedicated redux reducer
  • Replaced the navigate function with the replace function in the ts/screens/authentication/IdpLoginScreen.tsx

Demo

iOS

Standard login

Before After
ios-standard-login-before.mp4
ios-standard-login-after.mp4

Native login

Before After
ios-native-login-before.mp4
ios-native-login-after.mp4
Android

Standard login

Before After
android-standard-login-before.mp4
android-standard-login-after.mp4

Native login

Before After
android-native-login-before.mp4
android-native-login-after.mp4

How to test

Replicate what is shown in the demos. By default, the standard login flow is enabled. To test the native login, ensure that the local feature flag is enabled in the environment variables and that the remote one is enabled on the dev-server.

… params and move spid request states on redux
Copy link
Contributor

github-actions bot commented Dec 18, 2024

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOPID-2566

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 31.91489% with 32 lines in your changes missing coverage. Please review.

Project coverage is 49.28%. Comparing base (80d7bd5) to head (664ab04).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
ts/features/spidLogin/store/reducers/index.ts 41.17% 10 Missing ⚠️
ts/screens/authentication/AuthErrorScreen.tsx 0.00% 7 Missing ⚠️
ts/screens/authentication/IdpLoginScreen.tsx 0.00% 7 Missing ⚠️
...s/screens/authentication/idpAuthSessionHandler.tsx 0.00% 5 Missing ⚠️
ts/features/spidLogin/store/selectors/index.ts 50.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6565      +/-   ##
==========================================
- Coverage   49.29%   49.28%   -0.01%     
==========================================
  Files        1555     1558       +3     
  Lines       32122    32156      +34     
  Branches     7267     7330      +63     
==========================================
+ Hits        15834    15849      +15     
- Misses      16250    16258       +8     
- Partials       38       49      +11     
Files with missing lines Coverage Δ
ts/features/common/store/reducers/index.ts 100.00% <ø> (ø)
ts/features/spidLogin/store/actions/index.ts 100.00% <100.00%> (ø)
ts/features/spidLogin/store/selectors/index.ts 50.00% <50.00%> (ø)
...s/screens/authentication/idpAuthSessionHandler.tsx 4.38% <0.00%> (-0.04%) ⬇️
ts/screens/authentication/AuthErrorScreen.tsx 9.52% <0.00%> (-2.98%) ⬇️
ts/screens/authentication/IdpLoginScreen.tsx 1.86% <0.00%> (ø)
ts/features/spidLogin/store/reducers/index.ts 41.17% <41.17%> (ø)

... and 11 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 80d7bd5...664ab04. Read the comment docs.

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

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! 🚀

@Ladirico Ladirico added this pull request to the merge queue Jan 7, 2025
Merged via the queue into master with commit ecd87bc Jan 7, 2025
21 checks passed
@Ladirico Ladirico deleted the IOPID-2566-auth-error-screen branch January 7, 2025 16:02
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