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(IT Wallet): [SIW-1090] Add NFC enable instructions screen #5733

Merged
merged 48 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5b96fc1
feat: add auth mode selection screen
mastro993 Apr 29, 2024
c01284c
chore: add locales
mastro993 Apr 29, 2024
ed8fba1
chore: add CIE support check
mastro993 Apr 30, 2024
0dc21ee
chore: add NFC enabled check
mastro993 Apr 30, 2024
b311859
chore: rename folder
mastro993 Apr 30, 2024
cbe6a71
feat: add NFC instructions screen
mastro993 Apr 30, 2024
2348b35
chore: add instructions
mastro993 Apr 30, 2024
737fedb
chore: update DS
mastro993 May 2, 2024
e212a97
Merge branch 'master' into SIW-979-add-issuing-authentication-mode-se…
mastro993 May 2, 2024
d9a8dd4
chore: add translations and handlers
mastro993 May 3, 2024
af15d93
fix: locales
mastro993 May 3, 2024
79fbd38
Merge branch 'SIW-979-add-issuing-authentication-mode-selection-scree…
mastro993 May 3, 2024
669049c
Merge branch 'master' into SIW-1090-add-nfc-instructions-screen
mastro993 May 3, 2024
1af220d
Merge branch 'master' into SIW-979-add-issuing-authentication-mode-se…
mastro993 May 3, 2024
db12b86
chore: add loading state in screen
mastro993 May 6, 2024
7d2d460
feat: add itw and itwAuthentication reducers
mastro993 May 6, 2024
07d9a02
chore: add sagas and selector
mastro993 May 6, 2024
80ee820
chore: add foce app reload on itw enable
mastro993 May 6, 2024
bb2a046
chore: add tests
mastro993 May 6, 2024
013f1a1
Merge branch 'SIW-1089-add-nfc-enabled-state-check' into SIW-1090-add…
mastro993 May 6, 2024
08dc678
chore: use own saga
mastro993 May 6, 2024
3dbf9f0
Merge branch 'master' into SIW-1089-add-nfc-enabled-state-check
mastro993 May 6, 2024
b86846c
Update index.yml
thisisjp May 6, 2024
22901eb
Update index.yml
thisisjp May 6, 2024
b4b4bd4
Merge branch 'master' into SIW-979-add-issuing-authentication-mode-se…
mastro993 May 7, 2024
4b9032d
chore: rename feature
mastro993 May 7, 2024
81ae2b4
chore: rename function
mastro993 May 7, 2024
4b8ca02
chore: rename comment
mastro993 May 7, 2024
fb29583
Merge branch 'master' into SIW-979-add-issuing-authentication-mode-se…
mastro993 May 7, 2024
7bad573
Merge branch 'SIW-979-add-issuing-authentication-mode-selection-scree…
mastro993 May 7, 2024
84842e9
chore: rename feature
mastro993 May 7, 2024
c3e7f38
Merge branch 'master' into SIW-1089-add-nfc-enabled-state-check
mastro993 May 7, 2024
a04a7f8
Merge branch 'master' into SIW-1089-add-nfc-enabled-state-check
mastro993 May 7, 2024
094a208
Merge branch 'master' into SIW-1089-add-nfc-enabled-state-check
mastro993 May 8, 2024
e1b7fb5
Merge branch 'master' into SIW-1089-add-nfc-enabled-state-check
mastro993 May 8, 2024
566d3f4
Merge branch 'master' into SIW-1090-add-nfc-instructions-screen
mastro993 May 8, 2024
0f347dc
chore: move screen
mastro993 May 8, 2024
86b60cd
Merge branch 'SIW-1089-add-nfc-enabled-state-check' into SIW-1090-add…
mastro993 May 8, 2024
7b1b3e4
chore: add navigation
mastro993 May 8, 2024
eee8dc7
Merge branch 'master' into SIW-1090-add-nfc-instructions-screen
mastro993 May 8, 2024
737c2b0
Merge branch 'master' into SIW-1090-add-nfc-instructions-screen
mastro993 May 9, 2024
6542478
chore: added correct action call
mastro993 May 9, 2024
9112824
chore: add step label locale keys
mastro993 May 9, 2024
242f664
chore: use correct selector
mastro993 May 9, 2024
80592f0
chore: open OS settings
mastro993 May 10, 2024
341dcc7
fix: settings url in iOS
mastro993 May 10, 2024
6294773
chore: add NFC open function
mastro993 May 10, 2024
d7463e1
Merge branch 'master' into SIW-1090-add-nfc-instructions-screen
mastro993 May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3037,6 +3037,17 @@ features:
cieId:
title: CieID
subtitle: Usa credenziali e app CieID
nfc:
title: Attiva l'NFC per continuare
description: La funzionalità NFC permette al dispositivo di leggere la tua CIE.
header: "Ecco come:"
steps:
label: Step {{value}}
1: Vai alle impostazioni
2: Cerca "NFC"
3: Attivalo
primaryAction: Vai alle impostazioni
secondaryAction: Ho fatto
webView:
error:
missingParams: Not all information necessary to access this page are available
Expand Down
11 changes: 11 additions & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3037,6 +3037,17 @@ features:
cieId:
title: CieID
subtitle: Usa credenziali e app CieID
nfc:
title: Attiva l'NFC per continuare
description: La funzionalità NFC permette al dispositivo di leggere la tua CIE.
header: "Ecco come:"
steps:
label: Step {{value}}
1: Vai alle impostazioni
2: Cerca "NFC"
3: Attivalo
primaryAction: Vai alle impostazioni
secondaryAction: Ho fatto
webView:
error:
missingParams: Non sono presenti le informazioni necessarie per accedere a questa pagina
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,25 @@ import React from "react";
import { Alert } from "react-native";
import { RNavScreenWithLargeHeader } from "../../../../components/ui/RNavScreenWithLargeHeader";
import I18n from "../../../../i18n";
import { nfcIsEnabled } from "../../../../store/actions/cie";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
isCieSupportedSelector,
isNfcEnabledSelector
} from "../../../../store/reducers/cie";
import { cieFlowForDevServerEnabled } from "../../../cieLogin/utils";
import { ITW_ROUTES } from "../../navigation/routes";
import { itwNfcIsEnabled } from "../store/actions";

export const ItwIdentificationModeSelectionScreen = () => {
const navigation = useIONavigation();
const dispatch = useIODispatch();
const isCieSupportedPot = useIOSelector(isCieSupportedSelector);
const isNfcEnabledPot = useIOSelector(isNfcEnabledSelector);

useFocusEffect(
React.useCallback(() => {
dispatch(nfcIsEnabled.request());
dispatch(itwNfcIsEnabled.request());
}, [dispatch])
);

Expand All @@ -45,9 +48,11 @@ export const ItwIdentificationModeSelectionScreen = () => {

const handleCiePinPress = () => {
if (isNfcEnabled) {
Alert.alert("NFC not enabled");
} else {
Alert.alert("Not implemented");
} else {
navigation.navigate(ITW_ROUTES.MAIN, {
screen: ITW_ROUTES.IDENTIFICATION.NFC_INSTRUCTIONS
});
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import {
ContentWrapper,
Divider,
ListItemHeader,
ListItemInfo
} from "@pagopa/io-app-design-system";
import React from "react";
import { Linking } from "react-native";
import { RNavScreenWithLargeHeader } from "../../../../components/ui/RNavScreenWithLargeHeader";
import I18n from "../../../../i18n";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { FooterStackButton } from "../../common/components/FooterStackButton";

export const ItwIdentificationNfcInstructionsScreen = () => {
const navigation = useIONavigation();

const handleOpenSettingsPress = async () => {
await Linking.openSettings();
};

const handleClosePress = () => {
navigation.pop();
};

return (
<RNavScreenWithLargeHeader
title={{ label: I18n.t("features.itWallet.identification.nfc.title") }}
description={I18n.t("features.itWallet.identification.nfc.description")}
fixedBottomSlot={
<FooterStackButton
primaryActionProps={{
label: I18n.t("features.itWallet.identification.nfc.primaryAction"),
onPress: handleOpenSettingsPress
}}
secondaryActionProps={{
label: I18n.t(
"features.itWallet.identification.nfc.secondaryAction"
),
onPress: handleClosePress
}}
/>
}
>
<ContentWrapper>
<ListItemHeader
label={I18n.t("features.itWallet.identification.nfc.header")}
/>
<ListItemInfo
label={I18n.t("features.itWallet.identification.nfc.steps.label", {
value: 1
})}
value={I18n.t("features.itWallet.identification.nfc.steps.1")}
icon="systemSettingsAndroid"
/>
<Divider />
<ListItemInfo
label={I18n.t("features.itWallet.identification.nfc.steps.label", {
value: 2
})}
value={I18n.t("features.itWallet.identification.nfc.steps.2")}
icon="systemAppsAndroid"
/>
<Divider />
<ListItemInfo
label={I18n.t("features.itWallet.identification.nfc.steps.label", {
value: 3
})}
value={I18n.t("features.itWallet.identification.nfc.steps.3")}
icon="systemToggleInstructions"
/>
</ContentWrapper>
</RNavScreenWithLargeHeader>
);
};
1 change: 1 addition & 0 deletions ts/features/itwallet/navigation/ItwParamsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export type ItwParamsList = {
[ITW_ROUTES.DISCOVERY.INFO]: undefined;
// IDENTIFICATION
[ITW_ROUTES.IDENTIFICATION.MODE_SELECTION]: undefined;
[ITW_ROUTES.IDENTIFICATION.NFC_INSTRUCTIONS]: undefined;
};
9 changes: 7 additions & 2 deletions ts/features/itwallet/navigation/ItwStackNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as React from "react";
import { createStackNavigator } from "@react-navigation/stack";
import { ItwDiscoveryInfoScreen } from "../discovery/screens/ItwDiscoveryInfoScreen";
import * as React from "react";
import { isGestureEnabled } from "../../../utils/navigation";
import { ItwIdentificationModeSelectionScreen } from "../identification/screens/ItwIdentificationModeSelectionScreen";
import { ItwDiscoveryInfoScreen } from "../discovery/screens/ItwDiscoveryInfoScreen";
import { ItwIdentificationNfcInstructionsScreen } from "../identification/screens/ItwIdentificationNfcInstructionsScreen";
import { ItwParamsList } from "./ItwParamsList";
import { ITW_ROUTES } from "./routes";

Expand All @@ -23,5 +24,9 @@ export const ItwStackNavigator = () => (
name={ITW_ROUTES.IDENTIFICATION.MODE_SELECTION}
component={ItwIdentificationModeSelectionScreen}
/>
<Stack.Screen
name={ITW_ROUTES.IDENTIFICATION.NFC_INSTRUCTIONS}
component={ItwIdentificationNfcInstructionsScreen}
/>
</Stack.Navigator>
);
3 changes: 2 additions & 1 deletion ts/features/itwallet/navigation/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const ITW_ROUTES = {
INFO: "ITW_DISCOVERY_INFO"
} as const,
IDENTIFICATION: {
MODE_SELECTION: "ITW_IDENTIFICATION_MODE_SELECTION"
MODE_SELECTION: "ITW_IDENTIFICATION_MODE_SELECTION",
NFC_INSTRUCTIONS: "ITW_IDENTIFICATION_NFC_INSTRUCTIONS"
} as const
};
Loading