Skip to content

Commit

Permalink
Merge branch 'master' into IOAPPX-485-add-details-to-DS-section-README
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnplb authored Feb 19, 2025
2 parents 32432a8 + 0fc1157 commit 9922a20
Show file tree
Hide file tree
Showing 34 changed files with 693 additions and 149 deletions.
Binary file modified img/features/itWallet/discovery/itw_hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/features/itWallet/discovery/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/features/itWallet/discovery/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4189,6 +4189,13 @@ fastLogin:
whatsNew:
title: Logging into IO just got easier!
subtitle: From now on, to log into the app you'll have to use your SPID or CIE only once a year. After that you can just use your unlock code, fingerprint or face.
loginFeatures:
loginPreferences:
expirationBanner:
title: Quick access is about to expire.
content: On {{date}} you will need to log in again with SPID or CIE
action:
label: Read more
whatsNew:
title: What's changed?
bonusCard:
Expand Down
9 changes: 8 additions & 1 deletion locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3321,7 +3321,7 @@ features:
content: Attiva Documenti su IO per aggiungere al Portafoglio la versione digitale dei tuoi documenti!
action: Inizia
title: La versione digitale dei tuoi documenti, su IO
content: "###### Documenti su IO: come funziona \n Da oggi puoi aggiungere al Portafoglio di IO **la versione digitale dei tuoi documenti** personali, come la Patente di guida e la Tessera Sanitaria. \n\n Attiva la funzionalità **Documenti su IO** per averli sempre a portata di mano sul tuo dispositivo. \n\n ###### È facile e veloce \n Avrai bisogno delle credenziali **SPID** o **CIE** (Carta d’Identità Elettronica) per completare l’attivazione: è un passaggio di sicurezza necessario per garantire la sicurezza dei tuoi dati."
content: "Aggiungi la versione digitale dei tuoi documenti personali al Portafoglio dell'app! \n\n Hanno lo **stesso valore legale** di quelli fisici, in specifici contesti d'uso. \n\n ###### È facile e veloce \n Continua per attivare la nuova funzionalità in meno di 3 minuti: oltre **4 Milioni** di persone stanno già usando i **Documenti su IO**!"
tos: Premendo **Continua** dichiari di aver letto e compreso l’[Informativa Privacy e i Termini e Condizioni d’uso]({{privacyAndTosUrl}}).
upcomingWalletBanner:
title: "Novità in arrivo: i tuoi Documenti su IO"
Expand Down Expand Up @@ -4189,6 +4189,13 @@ fastLogin:
whatsNew:
title: Abbiamo migliorato l’accesso a IO!
subtitle: Ora puoi accedere all'app utilizzando il tuo SPID o la tua CIE solo una volta all'anno. Ti basterà poi utilizzare il tuo codice di sblocco o il biometrico per entrare.
loginFeatures:
loginPreferences:
expirationBanner:
title: Accesso rapido in scadenza
content: Il {{date}} dovrai accedere di nuovo con SPID o CIE
action:
label: Leggi come fare
whatsNew:
title: Cosa cambia?
bonusCard:
Expand Down
10 changes: 6 additions & 4 deletions scripts/generate-api-models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

IO_BACKEND_VERSION=v16.7.4-RELEASE
# need to change after merge on io-services-metadata
IO_SERVICES_METADATA_VERSION=1.0.57
IO_SERVICES_METADATA_VERSION=1.0.59
# Session manager version
IO_SESSION_MANAGER_VERSION=1.4.0

declare -a apis=(
# Backend APIs
Expand Down Expand Up @@ -30,8 +32,8 @@ declare -a apis=(
# CDN APIs
"./definitions/content https://raw.githubusercontent.com/pagopa/io-services-metadata/$IO_SERVICES_METADATA_VERSION/definitions.yml"
# Session Manager APIs
"./definitions/session_manager https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@1.0.0/apps/io-session-manager/api/internal.yaml"
"./definitions/fast_login https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@1.0.0/apps/io-session-manager/api/fast-login.yaml"
"./definitions/session_manager https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@$IO_SESSION_MANAGER_VERSION/apps/io-session-manager/api/internal.yaml"
"./definitions/fast_login https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@$IO_SESSION_MANAGER_VERSION/apps/io-session-manager/api/fast-login.yaml"
# CGN APIs
"./definitions/cgn https://raw.githubusercontent.com/pagopa/io-backend/$IO_BACKEND_VERSION/api_cgn.yaml"
"./definitions/cgn/merchants https://raw.githubusercontent.com/pagopa/io-backend/$IO_BACKEND_VERSION/api_cgn_operator_search.yaml"
Expand All @@ -49,7 +51,7 @@ wait

declare -a apisNoClient=(
"./definitions/backend https://raw.githubusercontent.com/pagopa/io-backend/$IO_BACKEND_VERSION/api_public.yaml"
"./definitions/session_manager https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@1.0.0/apps/io-session-manager/api/public.yaml"
"./definitions/session_manager https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@$IO_SESSION_MANAGER_VERSION/apps/io-session-manager/api/public.yaml"
"./definitions/pn https://raw.githubusercontent.com/pagopa/io-backend/$IO_BACKEND_VERSION/openapi/consumed/api-piattaforma-notifiche.yaml"
)

Expand Down
8 changes: 3 additions & 5 deletions ts/features/barcode/screens/BarcodeScanScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ import { useHardwareBackButton } from "../../../hooks/useHardwareBackButton";
import { usePagoPaPayment } from "../../payments/checkout/hooks/usePagoPaPayment";
import { FCI_ROUTES } from "../../fci/navigation/routes";
import { paymentAnalyticsDataSelector } from "../../payments/history/store/selectors";
import { ITW_REMOTE_ROUTES } from "../../itwallet/presentation/remote/navigation/routes.ts";
import { isIdPayLocallyEnabledSelector } from "../../../store/reducers/persistedPreferences.ts";
import { ITW_REMOTE_ROUTES } from "../../itwallet/presentation/remote/navigation/routes.ts";

const BarcodeScanScreen = () => {
const navigation = useNavigation<IOStackNavigationProp<AppParamsList>>();
Expand Down Expand Up @@ -156,10 +156,8 @@ const BarcodeScanScreen = () => {
break;
case "ITW_REMOTE":
navigation.navigate(ITW_REMOTE_ROUTES.MAIN, {
screen: ITW_REMOTE_ROUTES.CLAIMS_DISCLOSURE,
params: {
itwRemoteRequestPayload: barcode.itwRemoteRequestPayload
}
screen: ITW_REMOTE_ROUTES.REQUEST_VALIDATION,
params: barcode.itwRemoteRequestPayload
});
break;
}
Expand Down
12 changes: 6 additions & 6 deletions ts/features/barcode/types/__tests__/decoders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ describe("test decodeIOBarcode function", () => {
O.some({
type: "ITW_REMOTE",
itwRemoteRequestPayload: {
clientId: "abc123xy",
requestUri: "https://example.com/callback",
client_id: "abc123xy",
request_uri: "https://example.com/callback",
state: "hyqizm592",
requestUriMethod: "GET"
request_uri_method: "GET"
}
})
);
Expand All @@ -117,10 +117,10 @@ describe("test decodeIOBarcode function", () => {
O.some({
type: "ITW_REMOTE",
itwRemoteRequestPayload: {
clientId: "abc123xy",
requestUri: "https://example.com/callback",
client_id: "abc123xy",
request_uri: "https://example.com/callback",
state: "hyqizm592",
requestUriMethod: "POST"
request_uri_method: "POST"
}
})
);
Expand Down
29 changes: 10 additions & 19 deletions ts/features/barcode/types/decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import * as A from "fp-ts/lib/Array";
import * as E from "fp-ts/lib/Either";
import * as O from "fp-ts/lib/Option";
import { pipe } from "fp-ts/lib/function";
import { sequenceS } from "fp-ts/lib/Apply";
import { decodePosteDataMatrix } from "../../../utils/payment";
import { SignatureRequestDetailView } from "../../../../definitions/fci/SignatureRequestDetailView";
import { decodePosteDataMatrix } from "../../../utils/payment";
import { ItwRemoteRequestPayload } from "../../itwallet/presentation/remote/Utils/itwRemoteTypeUtils.ts";
import { getUrlParam } from "../../itwallet/common/utils/itwUrlUtils.ts";
import { IOBarcodeType } from "./IOBarcode";

// Discriminated barcode type
Expand Down Expand Up @@ -119,25 +117,18 @@ const decodeItwRemoteBarcode: IOBarcodeDecoderFn = (data: string) =>
O.fromNullable(
data.match(/^https:\/\/continua\.io\.pagopa\.it\/itw\/auth\?(.*)$/)
),
O.chain(([url]) =>
sequenceS(O.Monad)({
clientId: getUrlParam(url, "client_id"),
requestUri: getUrlParam(url, "request_uri"),
state: getUrlParam(url, "state"),
requestUriMethod: pipe(
getUrlParam(url, "request_uri_method"),
O.alt(() => O.some("GET"))
)
O.map(match => new URLSearchParams(match[1])),
O.chainEitherK(params =>
ItwRemoteRequestPayload.decode({
client_id: params.get("client_id"),
request_uri: params.get("request_uri"),
state: params.get("state"),
request_uri_method: params.get("request_uri_method") ?? "GET"
})
),
O.map(({ clientId, requestUri, state, requestUriMethod }) => ({
O.map(itwRemoteRequestPayload => ({
type: "ITW_REMOTE",
itwRemoteRequestPayload: {
clientId,
requestUri,
state,
requestUriMethod
}
itwRemoteRequestPayload
}))
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ exports[`featuresPersistor should match snapshot 1`] = `
},
"landingBanners": {
"ITW_DISCOVERY": true,
"LV_EXPIRATION_REMINDER": true,
"PUSH_NOTIFICATIONS_REMINDER": true,
"SETTINGS_DISCOVERY": true,
},
Expand Down Expand Up @@ -169,6 +170,9 @@ exports[`featuresPersistor should match snapshot 1`] = `
"loginInfo": {
"userFromSuccessLogin": false,
},
"loginPreferences": {
"showSessionExpirationBanner": true,
},
"nativeLogin": {
"enabled": true,
},
Expand Down
8 changes: 7 additions & 1 deletion ts/features/common/store/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ import {
import { GlobalState } from "../../../../store/reducers/types";
import { isIOMarkdownDisabledForMessagesAndServices } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isIOMarkdownEnabledLocallySelector } from "../../../../store/reducers/persistedPreferences";
import {
loginPreferencesPersistor,
LoginPreferencesState
} from "../../../login/preferences/store/reducers";

type LoginFeaturesState = {
testLogin: TestLoginState;
Expand All @@ -71,6 +75,7 @@ type LoginFeaturesState = {
cieLogin: CieLoginState & PersistPartial;
loginInfo: LoginInfoState;
spidLogin: SpidLoginState;
loginPreferences: LoginPreferencesState & PersistPartial;
};

export type FeaturesState = {
Expand Down Expand Up @@ -105,7 +110,8 @@ const rootReducer = combineReducers<FeaturesState, Action>({
fastLogin: fastLoginReducer,
cieLogin: cieLoginPersistor,
loginInfo: loginInfoReducer,
spidLogin: spidLoginReducer
spidLogin: spidLoginReducer,
loginPreferences: loginPreferencesPersistor
}),
wallet: walletReducer,
fims: fimsReducer,
Expand Down
38 changes: 16 additions & 22 deletions ts/features/itwallet/discovery/screens/ItwDiscoveryInfoScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
ContentWrapper,
FooterActions,
ForceScrollDownView,
H1,
VSpacer
} from "@pagopa/io-app-design-system";
import { ContentWrapper, H1, VSpacer } from "@pagopa/io-app-design-system";
import { useFocusEffect } from "@react-navigation/native";
import { StyleSheet } from "react-native";
import { AnimatedImage } from "../../../../components/AnimatedImage";
Expand All @@ -24,6 +18,7 @@ import { itwIsActivationDisabledSelector } from "../../common/store/selectors/re
import { selectIsLoading } from "../../machine/eid/selectors";
import { ItwEidIssuanceMachineContext } from "../../machine/provider";
import { generateLinkRuleWithCallback } from "../../common/utils/markdown";
import { IOScrollView } from "../../../../components/ui/IOScrollView.tsx";

/**
* This is the screen that shows the information about the discovery process
Expand Down Expand Up @@ -56,7 +51,19 @@ const ItwDiscoveryInfoScreen = () => {
});

return (
<ForceScrollDownView threshold={50}>
<IOScrollView
includeContentMargins={false}
actions={{
type: "SingleButton",
primary: {
loading: isLoading,
disabled: itwActivationDisabled,
label: I18n.t("global.buttons.continue"),
accessibilityLabel: I18n.t("global.buttons.continue"),
onPress: handleContinuePress
}
}}
>
<AnimatedImage
source={require("../../../../../img/features/itWallet/discovery/itw_hero.png")}
style={styles.hero}
Expand All @@ -74,20 +81,7 @@ const ItwDiscoveryInfoScreen = () => {
rules={generateLinkRuleWithCallback(trackOpenItwTos)}
/>
</ContentWrapper>
<FooterActions
fixed={false}
actions={{
type: "SingleButton",
primary: {
loading: isLoading,
disabled: itwActivationDisabled,
label: I18n.t("global.buttons.continue"),
accessibilityLabel: I18n.t("global.buttons.continue"),
onPress: handleContinuePress
}
}}
/>
</ForceScrollDownView>
</IOScrollView>
);
};

Expand Down
9 changes: 9 additions & 0 deletions ts/features/itwallet/navigation/useItwLinkingOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AppParamsList } from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import { isItwEnabledSelector } from "../common/store/selectors/remoteConfig";
import { itwLifecycleIsValidSelector } from "../lifecycle/store/selectors";
import { ITW_REMOTE_ROUTES } from "../presentation/remote/navigation/routes.ts";
import { ITW_ROUTES } from "./routes";

/**
Expand Down Expand Up @@ -30,6 +31,14 @@ export const useItwLinkingOptions = (): PathConfigMap<AppParamsList> => {
}
})
}
},
[ITW_REMOTE_ROUTES.MAIN]: {
path: "itw/auth",
screens: {
[ITW_REMOTE_ROUTES.REQUEST_VALIDATION]: {
path: ""
}
}
}
};
};
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import * as t from "io-ts";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";

// TODO: This will be imported from io-react-native-wallet, when the type will be available
// Remote presentation QR code data
export type ItwRemoteRequestPayload = {
clientId: string;
requestUri: string;
state: string;
requestUriMethod?: string;
};
export const ItwRemoteRequestPayload = t.intersection([
t.type({
client_id: NonEmptyString,
request_uri: NonEmptyString,
state: NonEmptyString
}),
t.partial({
request_uri_method: t.union([t.string, t.null, t.undefined])
})
]);

export type ItwRemoteRequestPayload = t.TypeOf<typeof ItwRemoteRequestPayload>;
Loading

0 comments on commit 9922a20

Please sign in to comment.