-
Notifications
You must be signed in to change notification settings - Fork 105
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(IT Wallet): [SIW-1824] Show alert if wallet instance is revoked #6547
base: master
Are you sure you want to change the base?
Conversation
…d in itwUpdateWalletInstanceStatus
…use a constant itwMinIntergityReqUrl
…onReason instead enum
…-alert-after-wi-revocation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6547 +/- ##
===========================================
- Coverage 48.42% 25.99% -22.44%
===========================================
Files 1488 1309 -179
Lines 31617 27745 -3872
Branches 7669 6204 -1465
===========================================
- Hits 15311 7212 -8099
- Misses 16238 20519 +4281
+ Partials 68 14 -54
... and 1810 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
|
||
/** | ||
* Hook to monitor wallet instance status and display alerts if revoked. | ||
* @param walletInstanceStatus - The status of the wallet instance, including whether it is revoked and the reason for revocation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param walletInstanceStatus - The status of the wallet instance, including whether it is revoked and the reason for revocation. |
@@ -27,10 +28,18 @@ const reducer = ( | |||
switch (action.type) { | |||
case getType(itwWalletInstanceAttestationStore): { | |||
return { | |||
...state, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...state, |
I think it's correct to reset the state when we save a new WI: if there is already a status
stored, it is for sure referred to a past WI.
What do you think?
export const itwWalletInstanceStatusSelector = createSelector( | ||
(state: GlobalState) => state.features.itWallet.walletInstance.status, | ||
status => status | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified as follows
export const itwWalletInstanceStatusSelector = createSelector( | |
(state: GlobalState) => state.features.itWallet.walletInstance.status, | |
status => status | |
); | |
export const itwWalletInstanceStatusSelector = (state: GlobalState) => state.features.itWallet.walletInstance.status; |
Short description
This PR adds functionality to display an alert in the wallet section when the Wallet Instance has been revoked. The alerts are displayed based on the revocation reason.
List of changes proposed in this pull request
itwUpdateWalletInstanceStatus
ingetStatusOrResetWalletInstance
to update the wallet instance statusitwWalletInstanceStatusSelector
to retrieve WI statususeItwWalletInstanceRevocationAlert
to displayAlert
in based on the revocation reasonHow to test
Simulate or revoked via Web the wallet instance revocation and navigate to wallet section
CERTIFICATE_REVOKED_BY_ISSUER
https://github.com/user-attachments/assets/9aa867fb-f690-4da4-8e19-a1e53298e6de
REVOKED_BY_USER
https://github.com/user-attachments/assets/24899e8b-0110-4228-8edc-8f2b6da3e7e3