Skip to content

Commit

Permalink
Merge branch 'master' into SIW-1960-scan-qr-code-remote-presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoMolinari95 authored Feb 5, 2025
2 parents b2316b4 + 94eab6a commit bb3467e
Show file tree
Hide file tree
Showing 31 changed files with 658 additions and 1,217 deletions.
13 changes: 10 additions & 3 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ authentication:
nospid-nocie: Don't have SPID or CIE? Find out more
card0-title: Welcome to IO!
card0-content: Swipe left to see what you can do in the app
card0-content-accessibility: Select the previous item to open a chat with the IO team if something is not working as it should.
card0-content-accessibility: Select the previous item to open a chat with the IO team if something is not working as it should.
card1-title: Keep your personal documents safe
card1-content: With Documenti su IO you always have the digital version of your documents, such as driving licence and health card, at your fingertips
card2-title: Receive communications, also with legal value
Expand Down Expand Up @@ -880,6 +880,13 @@ authentication:
recoverDescription: If you're missing your password, you can recover it by tapping on the following button.
dualRecoverDescription: If you're missing your credentials, you can recover them by tapping on the following buttons.
recoverPassword: Recover the password
poste_id:
bottom_sheet:
title: Log in without a password!
description: "If you have the Poste ID app, follow these steps:"
feature_1: Tap on **‘Accedi più rapidamente** in the grey band in the middle of the screen
feature_2: Enter your PosteID code or use biometric
feature_3: When you see **Autorizzazione concessa** appear, go back to IO and press **Acconsento**
idp_login_success:
contentTitle: Hi, {{name}}!
errors:
Expand Down Expand Up @@ -2904,7 +2911,7 @@ bonus:
one: 1 second
other: "{{seconds}} seconds"
cdc:
serviceEntryPoint:
serviceEntryPoint:
notAvailable: "The service is not available at this time. Try later."
features:
messages:
Expand Down Expand Up @@ -3306,7 +3313,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 ###### È 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: "###### 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."
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
9 changes: 8 additions & 1 deletion locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,13 @@ authentication:
dualRecoverDescription: Se hai dimenticato le tue credenziali, ti consigliamo di procedere cliccando sui bottoni qui di seguito.
recoverUsername: Recupera il nome utente
recoverPassword: Recupera la password
poste_id:
bottom_sheet:
title: Accedi senza password!
description: "Se hai l’app Poste ID, segui questi passaggi:"
feature_1: Tocca su **"Accedi più rapidamente"** nella fascia grigia al centro della schermata
feature_2: Inserisci il codice PosteID o usa il biometrico
feature_3: Quando vedrai apparire **Autorizzazione concessa**, torna su IO e premi **Acconsento**
idp_login_success:
contentTitle: Ciao {{name}}!
errors:
Expand Down Expand Up @@ -3306,7 +3313,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 ###### È 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: "###### 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."
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
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ const IdPayInitiativeDetailsScreen = () => {
value: formatNumberCentsToAmount(accruedAmount, true, "right")
}
];
default:
return [];
}
}
)
Expand Down Expand Up @@ -294,6 +296,8 @@ const IdPayInitiativeDetailsScreen = () => {
<VSpacer size={32} />
</ContentWrapper>
);
default:
return undefined;
}
}
)
Expand Down
6 changes: 6 additions & 0 deletions ts/features/idpay/onboarding/machine/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export const createActionsImplementation = (
navigation.navigate(IdPayOnboardingRoutes.IDPAY_ONBOARDING_MAIN, {
screen: IdPayOnboardingRoutes.IDPAY_ONBOARDING_MULTI_SELF_DECLARATIONS
});
const navigateToInputFormScreen = () =>
navigation.navigate(IdPayOnboardingRoutes.IDPAY_ONBOARDING_MAIN, {
screen: IdPayOnboardingRoutes.IDPAY_ONBOARDING_INPUT_FORM
});

const navigateToCompletionScreen = () =>
navigation.navigate(IdPayOnboardingRoutes.IDPAY_ONBOARDING_MAIN, {
screen: IdPayOnboardingRoutes.IDPAY_ONBOARDING_COMPLETION
Expand Down Expand Up @@ -76,6 +81,7 @@ export const createActionsImplementation = (
navigateToCompletionScreen,
navigateToFailureScreen,
navigateToInitiativeMonitoringScreen,
navigateToInputFormScreen,
closeOnboarding,
handleSessionExpired
};
Expand Down
11 changes: 8 additions & 3 deletions ts/features/idpay/onboarding/machine/actors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ export const createActorsImplementation = (

const acceptRequiredCriteria = fromPromise<undefined, Context.Context>(
async params => {
const { initiative, requiredCriteria, selfDeclarationsMultiAnwsers } =
params.input;
const {
initiative,
requiredCriteria,
selfDeclarationsMultiAnwsers,
selfDeclarationsTextAnswers
} = params.input;

if (O.isNone(initiative) || O.isNone(requiredCriteria)) {
return Promise.reject(OnboardingFailureEnum.GENERIC);
Expand All @@ -191,7 +195,8 @@ export const createActorsImplementation = (
code: _.code,
accepted: true
})),
...Object.values(selfDeclarationsMultiAnwsers)
...Object.values(selfDeclarationsMultiAnwsers),
...Object.values(selfDeclarationsTextAnswers)
] as Array<SelfConsentDTO>;

const response = await client.consentOnboarding({
Expand Down
7 changes: 6 additions & 1 deletion ts/features/idpay/onboarding/machine/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { StatusEnum } from "../../../../../definitions/idpay/OnboardingStatusDTO
import { RequiredCriteriaDTO } from "../../../../../definitions/idpay/RequiredCriteriaDTO";
import { SelfConsentMultiDTO } from "../../../../../definitions/idpay/SelfConsentMultiDTO";
import { OnboardingFailure } from "../types/OnboardingFailure";
import { SelfDeclarationTextDTO } from "../../../../../definitions/idpay/SelfDeclarationTextDTO";

export type Context = {
readonly serviceId: string;
Expand All @@ -14,6 +15,8 @@ export type Context = {
readonly selfDeclarationsMultiAnwsers: Record<number, SelfConsentMultiDTO>;
readonly selfDeclarationsBoolAnswers: Record<string, boolean>;
readonly failure: O.Option<OnboardingFailure>;
readonly activeTextConsentPage: number;
readonly selfDeclarationsTextAnswers: Record<string, SelfDeclarationTextDTO>;
};

export const InitialContext: Context = {
Expand All @@ -24,5 +27,7 @@ export const InitialContext: Context = {
selfDeclarationsMultiPage: 0,
selfDeclarationsMultiAnwsers: {},
selfDeclarationsBoolAnswers: {},
failure: O.none
failure: O.none,
activeTextConsentPage: 0,
selfDeclarationsTextAnswers: {}
};
7 changes: 7 additions & 0 deletions ts/features/idpay/onboarding/machine/events.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SelfConsentMultiDTO } from "../../../../../definitions/idpay/SelfConsentMultiDTO";
import { SelfDeclarationBoolDTO } from "../../../../../definitions/idpay/SelfDeclarationBoolDTO";
import { SelfDeclarationTextDTO } from "../../../../../definitions/idpay/SelfDeclarationTextDTO";

export type StartOnboarding = {
readonly type: "start-onboarding";
Expand All @@ -16,6 +17,11 @@ export type SelectMultiConsent = {
readonly data: SelfConsentMultiDTO;
};

export type InputTextCriteria = {
readonly type: "input-text-criteria";
readonly criteria: SelfDeclarationTextDTO;
};

export type Next = {
readonly type: "next";
};
Expand All @@ -32,6 +38,7 @@ export type IdPayOnboardingEvents =
| StartOnboarding
| SelectMultiConsent
| ToggleBoolCriteria
| InputTextCriteria
| Next
| Back
| Close;
89 changes: 88 additions & 1 deletion ts/features/idpay/onboarding/machine/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Context, InitialContext } from "./context";
import { IdPayOnboardingEvents } from "./events";
import {
getBooleanSelfDeclarationListFromContext,
getInputFormSelfDeclarationFromContext,
getMultiSelfDeclarationListFromContext
} from "./selectors";

Expand All @@ -33,7 +34,8 @@ export const idPayOnboardingMachine = setup({
navigateToFailureScreen: notImplementedStub,
navigateToInitiativeMonitoringScreen: notImplementedStub,
closeOnboarding: notImplementedStub,
handleSessionExpired: notImplementedStub
handleSessionExpired: notImplementedStub,
navigateToInputFormScreen: notImplementedStub
},
actors: {
getInitiativeInfo: fromPromise<InitiativeDataDTO, string>(
Expand Down Expand Up @@ -71,11 +73,18 @@ export const idPayOnboardingMachine = setup({
getBooleanSelfDeclarationListFromContext(context).length > 0,
hasMultiSelfDeclarationList: ({ context }) =>
getMultiSelfDeclarationListFromContext(context).length > 0,
hasInputFormDeclaration: ({ context }) =>
getInputFormSelfDeclarationFromContext(context).length > 0,
isFirstMultiConsentPage: ({ context }) =>
context.selfDeclarationsMultiPage === 0,
isLastMultiConsent: ({ context }) =>
context.selfDeclarationsMultiPage >=
getMultiSelfDeclarationListFromContext(context).length - 1,
isFirstMultiTextConsent: ({ context }) =>
context.activeTextConsentPage === 0,
isLastTextConsent: ({ context }) =>
context.activeTextConsentPage >=
getInputFormSelfDeclarationFromContext(context).length - 1,
isSessionExpired: ({ event }: { event: IdPayOnboardingEvents }) =>
"error" in event && event.error === InitiativeFailureType.SESSION_EXPIRED
}
Expand Down Expand Up @@ -266,6 +275,10 @@ export const idPayOnboardingMachine = setup({
{
guard: "hasMultiSelfDeclarationList",
target: "DisplayingMultiSelfDeclarationList"
},
{
guard: "hasInputFormDeclaration",
target: "DisplayingInputForm"
}
]
},
Expand Down Expand Up @@ -295,6 +308,10 @@ export const idPayOnboardingMachine = setup({
guard: "hasMultiSelfDeclarationList",
target: "DisplayingMultiSelfDeclarationList"
},
{
guard: "hasInputFormDeclaration",
target: "DisplayingInputForm"
},
{
target: "#idpay-onboarding.AcceptingCriteria"
}
Expand Down Expand Up @@ -345,6 +362,11 @@ export const idPayOnboardingMachine = setup({
},
EvaluatingMultiSelfDeclarationList: {
always: [
{
guard: "hasInputFormDeclaration",
target:
"#idpay-onboarding.DisplayingSelfDeclarationList.DisplayingInputForm"
},
{
guard: "isLastMultiConsent",
target: "#idpay-onboarding.AcceptingCriteria"
Expand All @@ -359,6 +381,71 @@ export const idPayOnboardingMachine = setup({
]
}
}
},

DisplayingInputForm: {
initial: "DisplayingInputFormScreen",
states: {
DisplayingInputFormScreen: {
entry: "navigateToInputFormScreen",
on: {
"input-text-criteria": {
actions: assign(({ context, event }) => ({
selfDeclarationsTextAnswers: {
...context.selfDeclarationsTextAnswers,
[context.activeTextConsentPage]: event.criteria
}
})),
target: "EvaluatingInputForm"
},
back: [
{
guard: and([
"isFirstMultiTextConsent",
"hasMultiSelfDeclarationList"
]),
target:
"#idpay-onboarding.DisplayingSelfDeclarationList.DisplayingMultiSelfDeclarationList"
},
{
guard: and([
"isFirstMultiTextConsent",
"hasBooleanSelfDeclarationList"
]),
target:
"#idpay-onboarding.DisplayingSelfDeclarationList.DisplayingBooleanSelfDeclarationList"
},
{
guard: and(["isFirstMultiConsentPage", "hasPdndCriteria"]),
target: "#idpay-onboarding.DisplayingPdndCriteria"
},
{
guard: "isFirstMultiTextConsent",
target: "#idpay-onboarding.DisplayingInitiativeInfo"
},
{
actions: assign(({ context }) => ({
activeTextConsentPage: +context.activeTextConsentPage - 1
}))
}
]
}
},
EvaluatingInputForm: {
always: [
{
guard: "isLastTextConsent",
target: "#idpay-onboarding.AcceptingCriteria"
},
{
actions: assign(({ context }) => ({
activeTextConsentPage: +context.activeTextConsentPage + 1
})),
target: "DisplayingInputFormScreen"
}
]
}
}
}
}
},
Expand Down
26 changes: 25 additions & 1 deletion ts/features/idpay/onboarding/machine/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { RequiredCriteriaDTO } from "../../../../../definitions/idpay/RequiredCr
import { SelfDeclarationBoolDTO } from "../../../../../definitions/idpay/SelfDeclarationBoolDTO";
import { SelfDeclarationDTO } from "../../../../../definitions/idpay/SelfDeclarationDTO";
import { SelfDeclarationMultiDTO } from "../../../../../definitions/idpay/SelfDeclarationMultiDTO";
import { SelfDeclarationTextDTO } from "../../../../../definitions/idpay/SelfDeclarationTextDTO";
import * as Context from "./context";
import { IdPayOnboardingMachine } from "./machine";

Expand All @@ -24,6 +25,9 @@ export const selectCurrentMultiSelfDeclarationPage = (
snapshot: MachineSnapshot
) => snapshot.context.selfDeclarationsMultiPage;

export const selectCurrentInputTextNumber = (snapshot: MachineSnapshot) =>
snapshot.context.activeTextConsentPage;

export const selectInitiative = (snapshot: MachineSnapshot) =>
snapshot.context.initiative;

Expand All @@ -32,7 +36,10 @@ export const selectServiceId = (snapshot: MachineSnapshot) =>

const filterCriteria = <T extends SelfDeclarationDTO>(
criteria: O.Option<RequiredCriteriaDTO>,
filterFunc: typeof SelfDeclarationMultiDTO | typeof SelfDeclarationBoolDTO
filterFunc:
| typeof SelfDeclarationMultiDTO
| typeof SelfDeclarationBoolDTO
| typeof SelfDeclarationTextDTO
) =>
pipe(
criteria,
Expand Down Expand Up @@ -72,6 +79,15 @@ export const pdndCriteriaSelector = createSelector(
)
);

export const textRequiredCriteriaSelector = createSelector(
selectRequiredCriteria,
requiredCriteria =>
filterCriteria<SelfDeclarationTextDTO>(
requiredCriteria,
SelfDeclarationTextDTO
)
);

export const getMultiSelfDeclarationListFromContext = (
context: Context.Context
) =>
Expand All @@ -88,6 +104,14 @@ export const getBooleanSelfDeclarationListFromContext = (
SelfDeclarationBoolDTO
);

export const getInputFormSelfDeclarationFromContext = (
context: Context.Context
) =>
filterCriteria<SelfDeclarationTextDTO>(
context.requiredCriteria,
SelfDeclarationTextDTO
);

export const areAllSelfDeclarationsToggledSelector = createSelector(
boolRequiredCriteriaSelector,
selectSelfDeclarationBoolAnswers,
Expand Down
Loading

0 comments on commit bb3467e

Please sign in to comment.