-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(IT Wallet): [SIW-1022] Add PIN/biometric authorization for eID s…
…tore action (#5792) > [!WARNING] > This PR depends on #5780 ## Short description This PR adds the PIN/biometric authorization request before proceeding to the eID store. ## List of changes proposed in this pull request - Added `useItwDismissalDialog` hook which shows a confirmation dialog for the dismissal of the current procedure - Added `ItwIssuanceEidResultScreen` screen and routes - Added required locales - Within the `ItwIssuanceEidPreviewScreen` screen, it now show the PIN/biometric auth request when tapping the "Store" button. ## How to test Navigate to **Profile > Playgrounds > IT Wallet > eID > SPID**, select an IDP. In the eID preview screen, tap on "Store to wallet" button. You should be able to see the PIN/biometric authorization request. ## Preview https://github.com/pagopa/io-app/assets/6160324/5ef9a8a6-400a-4c17-8428-10fd2b28e37b --------- Co-authored-by: Damiano Plebani <[email protected]> Co-authored-by: Mario Perrotta <[email protected]>
- Loading branch information
1 parent
0bb9606
commit f3bebba
Showing
9 changed files
with
121 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
ts/features/itwallet/common/hooks/useItwDismissalDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Alert } from "react-native"; | ||
import { useIONavigation } from "../../../../navigation/params/AppParamsList"; | ||
import I18n from "../../../../i18n"; | ||
|
||
/** | ||
* Allows to show a dismissal dialog in which the user must confirm the desire to close the current flow | ||
* @returns a function that show the dialog | ||
*/ | ||
export const useItwDismissalDialog = () => { | ||
const navigation = useIONavigation(); | ||
|
||
const handleDismiss = () => { | ||
navigation.popToTop(); | ||
navigation.pop(); | ||
}; | ||
|
||
const show = () => | ||
Alert.alert(I18n.t("features.itWallet.generic.alert.title"), undefined, [ | ||
{ | ||
text: I18n.t("features.itWallet.generic.alert.confirm"), | ||
style: "destructive", | ||
onPress: handleDismiss | ||
}, | ||
{ | ||
text: I18n.t("features.itWallet.generic.alert.cancel"), | ||
style: "cancel" | ||
} | ||
]); | ||
|
||
return { show }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
ts/features/itwallet/issuance/screens/ItwIssuanceEidResultScreen.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from "react"; | ||
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent"; | ||
import I18n from "../../../../i18n"; | ||
import { useItwDismissalDialog } from "../../common/hooks/useItwDismissalDialog"; | ||
|
||
export const ItwIssuanceEidResultScreen = () => { | ||
const dismissalDialog = useItwDismissalDialog(); | ||
|
||
const handleContinue = () => { | ||
// TODO continue through the credential issuing | ||
}; | ||
|
||
return ( | ||
<OperationResultScreenContent | ||
pictogram="success" | ||
title={I18n.t("features.itWallet.issuance.success.title")} | ||
subtitle={I18n.t("features.itWallet.issuance.success.subtitle", { | ||
credentialName: "{Credential.name}" | ||
})} | ||
action={{ | ||
label: I18n.t("global.buttons.continue"), | ||
onPress: handleContinue | ||
}} | ||
secondaryAction={{ | ||
label: I18n.t("global.buttons.close"), | ||
onPress: dismissalDialog.show | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters