Skip to content

Commit

Permalink
Merge branch 'master' into IOPID-2634-io-login-zendesk-faq-banner
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMattew authored Feb 13, 2025
2 parents ede65a1 + 6e60dc2 commit e9a20ab
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 34 deletions.
3 changes: 2 additions & 1 deletion locales/de/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3207,7 +3207,8 @@ transaction:
debtor: "Schuldner"
iuv: "IUV"
subject: "Zahlungsgrund"
noticeCode: "Kodex der Zahlungsmitteilung"
noticeCode: "Kodex der Zahlungsmitteilung/IUV"
noticeCodeAccessible: Codice avviso/Identificativo Univoco Versamento
taxCode: "Steuernummer Körperschaft"
FIMS:
updateApp:
Expand Down
12 changes: 9 additions & 3 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3554,8 +3554,13 @@ features:
walletInactiveScreen:
title: Attiva Documenti su IO per continuare
subtitle: Per accedere con IT Wallet ai servizi online è necessario prima attivare la funzionalità Documenti su IO.
continue: Inizia
close: Non ora
primaryAction: Inizia
secondaryAction: Non ora
missingCredentialsScreen:
title: Mancano i dati contenuti in {{credentialName}}
subtitle: Aggiungi il documento al Portafoglio prima di continuare e poi riprova.
primaryAction: Aggiungi documento al Portafoglio
secondaryAction: Annulla
trustmark:
description: Mostra il QR Code per attestare l’autenticità del documento quando ti viene richiesto.
qrCode: QR code autenticità credenziale
Expand Down Expand Up @@ -4216,7 +4221,8 @@ transaction:
debtor: Debitore
iuv: IUV
subject: Oggetto del pagamento
noticeCode: Codice avviso
noticeCode: Codice avviso/IUV
noticeCodeAccessible: Codice avviso/Identificativo Univoco Versamento
taxCode: Codice Fiscale Ente
FIMS:
updateApp:
Expand Down
12 changes: 9 additions & 3 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3554,8 +3554,13 @@ features:
walletInactiveScreen:
title: Attiva Documenti su IO per continuare
subtitle: Per accedere con IT Wallet ai servizi online è necessario prima attivare la funzionalità Documenti su IO.
continue: Inizia
close: Non ora
primaryAction: Inizia
secondaryAction: Non ora
missingCredentialsScreen:
title: Mancano i dati contenuti in {{credentialName}}
subtitle: Aggiungi il documento al Portafoglio prima di continuare e poi riprova.
primaryAction: Aggiungi documento al Portafoglio
secondaryAction: Annulla
trustmark:
description: Mostra il QR Code per attestare l’autenticità del documento quando ti viene richiesto.
qrCode: QR code autenticità credenziale
Expand Down Expand Up @@ -4216,7 +4221,8 @@ transaction:
debtor: Debitore
iuv: IUV
subject: Oggetto del pagamento
noticeCode: Codice avviso
noticeCode: Codice avviso/IUV
noticeCodeAccessible: Codice avviso/Identificativo Univoco Versamento
taxCode: Codice Fiscale Ente
FIMS:
updateApp:
Expand Down
4 changes: 2 additions & 2 deletions ts/components/screens/OperationResultScreenContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ type OperationResultScreenContentProps = WithTestID<{
subtitleProps?: Pick<BodyProps, "textBreakStrategy" | "lineBreakStrategyIOS">;
action?: Pick<
ButtonSolidProps,
"label" | "accessibilityLabel" | "onPress" | "testID"
"label" | "accessibilityLabel" | "onPress" | "testID" | "icon"
>;
secondaryAction?: Pick<
ButtonLinkProps,
"label" | "accessibilityLabel" | "onPress" | "testID"
"label" | "accessibilityLabel" | "onPress" | "testID" | "icon"
>;
isHeaderVisible?: boolean;
}>;
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 @@ -17,10 +17,7 @@ import {
IOStackNavigationProp
} from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import {
barcodesScannerConfigSelector,
isIdPayEnabledSelector
} from "../../../store/reducers/backendStatus/remoteConfig";
import { barcodesScannerConfigSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { emptyContextualHelp } from "../../../utils/emptyContextualHelp";
import { useIOBottomSheetAutoresizableModal } from "../../../utils/hooks/bottomSheet";
import { IdPayPaymentRoutes } from "../../idpay/payment/navigation/routes";
Expand All @@ -46,11 +43,12 @@ 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";

const BarcodeScanScreen = () => {
const navigation = useNavigation<IOStackNavigationProp<AppParamsList>>();
const openDeepLink = useOpenDeepLink();
const isIdPayEnabled = useIOSelector(isIdPayEnabledSelector);
const isIdPayEnabled = useIOSelector(isIdPayLocallyEnabledSelector);
const paymentAnalyticsData = useIOSelector(paymentAnalyticsDataSelector);

const { startPaymentFlowWithRptId } = usePagoPaPayment();
Expand Down
26 changes: 21 additions & 5 deletions ts/features/itwallet/presentation/remote/machine/failure.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
import { RemoteEvents } from "./events.ts";

export enum RemoteFailureType {
UNEXPECTED = "UNEXPECTED",
WALLET_INACTIVE = "WALLET_INACTIVE"
WALLET_INACTIVE = "WALLET_INACTIVE",
MISSING_CREDENTIALS = "MISSING_CREDENTIALS",
UNEXPECTED = "UNEXPECTED"
}

export type RemoteFailure = {
type: RemoteFailureType;
reason: unknown;
/**
* Type that maps known reasons with the corresponding failure, in order to avoid unknowns as much as possible.
*/
export type ReasonTypeByFailure = {
[RemoteFailureType.WALLET_INACTIVE]: string;
[RemoteFailureType.MISSING_CREDENTIALS]: {
missingCredentials: Array<string>;
};
[RemoteFailureType.UNEXPECTED]: unknown;
};

type TypedRemoteFailures = {
[K in RemoteFailureType]: { type: K; reason: ReasonTypeByFailure[K] };
};

/*
* Union type of failures with the reason properly typed.
*/
export type RemoteFailure = TypedRemoteFailures[keyof TypedRemoteFailures];

/**
* Maps an event dispatched by the remote presentation machine to a failure object.
* If the event contains an error, it is mapped to an unexpected failure.
Expand Down
6 changes: 5 additions & 1 deletion ts/features/itwallet/presentation/remote/machine/guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ export const createRemoteGuardsImplementation = (
) => ({
isWalletActive: () =>
itwLifecycleIsValidSelector(store.getState()) &&
isItwEnabledSelector(store.getState())
isItwEnabledSelector(store.getState()),

areRequiredCredentialsAvailable: () =>
// TODO: implementation depends on the remote presentation request
true
});
3 changes: 2 additions & 1 deletion ts/features/itwallet/presentation/remote/machine/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const itwRemoteMachine = setup({
},
actors: {},
guards: {
isWalletActive: notImplemented
isWalletActive: notImplemented,
areRequiredCredentialsAvailable: notImplemented
}
}).createMachine({
id: "itwRemoteMachine",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { RemoteFailure, RemoteFailureType } from "../machine/failure.ts";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton.ts";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo.ts";
import I18n from "../../../../../i18n.ts";
import { getCredentialNameFromType } from "../../../common/utils/itwCredentialUtils.ts";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { ITW_ROUTES } from "../../../navigation/routes.ts";

export const ItwRemoteFailureScreen = () => {
const failureOption =
Expand All @@ -30,6 +33,7 @@ type ContentViewProps = { failure: RemoteFailure };

const ContentView = ({ failure }: ContentViewProps) => {
const machineRef = ItwRemoteMachineContext.useActorRef();
const navigation = useIONavigation();

useDebugInfo({
failure: serializeFailureReason(failure)
Expand Down Expand Up @@ -59,18 +63,46 @@ const ContentView = ({ failure }: ContentViewProps) => {
pictogram: "itWallet",
action: {
label: I18n.t(
"features.itWallet.presentation.remote.walletInactiveScreen.continue"
"features.itWallet.presentation.remote.walletInactiveScreen.primaryAction"
),
onPress: () =>
machineRef.send({ type: "go-to-wallet-activation" })
},
secondaryAction: {
label: I18n.t(
"features.itWallet.presentation.remote.walletInactiveScreen.close"
"features.itWallet.presentation.remote.walletInactiveScreen.secondaryAction"
),
onPress: () => machineRef.send({ type: "go-to-wallet" })
}
};
case RemoteFailureType.MISSING_CREDENTIALS: {
const [missingCredential] = failure.reason.missingCredentials; // Only consider one credential for now
return {
title: I18n.t(
"features.itWallet.presentation.remote.missingCredentialsScreen.title",
{ credentialName: getCredentialNameFromType(missingCredential) }
),
subtitle: I18n.t(
"features.itWallet.presentation.remote.missingCredentialsScreen.subtitle"
),
pictogram: "emptyWallet",
action: {
label: I18n.t(
"features.itWallet.presentation.remote.missingCredentialsScreen.primaryAction"
),
onPress: () =>
navigation.navigate(ITW_ROUTES.MAIN, {
screen: ITW_ROUTES.ONBOARDING
})
},
secondaryAction: {
label: I18n.t(
"features.itWallet.presentation.remote.missingCredentialsScreen.secondaryAction"
),
onPress: () => machineRef.send({ type: "go-to-wallet" })
}
};
}
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const WalletPaymentFailureDetail = ({ failure }: Props) => {
accessibilityLabel: I18n.t(
"wallet.payment.failure.PAYMENT_CANCELED.action"
),
icon: "categLearning",
onPress: handleDiscoverMore
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const ReceiptCartItemDetailsScreen = () => {
}
label={I18n.t("transaction.details.operation.noticeCode")}
accessibilityLabel={I18n.t(
"transaction.details.operation.noticeCode"
"transaction.details.operation.noticeCodeAccessible"
)}
value={cartItem.refNumberValue}
/>
Expand Down
6 changes: 3 additions & 3 deletions ts/screens/profile/DeveloperModeSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
} from "../../store/reducers/authentication";
import { isDebugModeEnabledSelector } from "../../store/reducers/debug";
import {
isIdPayTestEnabledSelector,
isIdPayLocallyEnabledSelector,
isIOMarkdownEnabledLocallySelector,
isPagoPATestEnabledSelector,
isPnTestEnabledSelector
Expand Down Expand Up @@ -349,7 +349,7 @@ const DesignSystemSection = () => {

const PlaygroundsSection = () => {
const navigation = useIONavigation();
const isIdPayTestEnabled = useIOSelector(isIdPayTestEnabledSelector);
const isIdPayTestEnabled = useIOSelector(isIdPayLocallyEnabledSelector);

const playgroundsNavListItems: ReadonlyArray<PlaygroundsNavListItem> = [
{
Expand Down Expand Up @@ -453,7 +453,7 @@ const DeveloperTestEnvironmentSection = ({
const dispatch = useIODispatch();
const isPagoPATestEnabled = useIOSelector(isPagoPATestEnabledSelector);
const isPnTestEnabled = useIOSelector(isPnTestEnabledSelector);
const isIdPayTestEnabled = useIOSelector(isIdPayTestEnabledSelector);
const isIdPayTestEnabled = useIOSelector(isIdPayLocallyEnabledSelector);

const onPagoPAEnvironmentToggle = (enabled: boolean) => {
if (enabled) {
Expand Down
8 changes: 5 additions & 3 deletions ts/screens/profile/SecurityScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ import ROUTES from "../../navigation/routes";
import { identificationRequest } from "../../store/actions/identification";
import { preferenceFingerprintIsEnabledSaveSuccess } from "../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../store/hooks";
import { isIdPayEnabledSelector } from "../../store/reducers/backendStatus/remoteConfig";
import { isFingerprintEnabledSelector } from "../../store/reducers/persistedPreferences";
import {
isFingerprintEnabledSelector,
isIdPayLocallyEnabledSelector
} from "../../store/reducers/persistedPreferences";
import { getFlowType } from "../../utils/analytics";
import {
biometricAuthenticationRequest,
Expand Down Expand Up @@ -51,7 +53,7 @@ const SecurityScreen = (): ReactElement => {
const dispatch = useIODispatch();
const isFingerprintEnabled = useIOSelector(isFingerprintEnabledSelector);
const isIdPayCodeOnboarded = useIOSelector(isIdPayCodeOnboardedSelector);
const isIdPayEnabled = useIOSelector(isIdPayEnabledSelector);
const isIdPayEnabled = useIOSelector(isIdPayLocallyEnabledSelector);
const isFimsHistoryEnabled = useIOSelector(fimsIsHistoryEnabledSelector);
const navigation = useIONavigation();
const [isBiometricDataAvailable, setIsBiometricDataAvailable] =
Expand Down
4 changes: 2 additions & 2 deletions ts/store/reducers/backendStatus/remoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { getAppVersion, isVersionSupported } from "../../../utils/appVersion";
import { backendStatusLoadSuccess } from "../../actions/backendStatus";
import { Action } from "../../actions/types";
import { isPropertyWithMinAppVersionEnabled } from "../featureFlagWithMinAppVersionStatus";
import { isIdPayTestEnabledSelector } from "../persistedPreferences";
import { isIdPayLocallyEnabledSelector } from "../persistedPreferences";
import { GlobalState } from "../types";

export type RemoteConfigState = O.Option<BackendStatus["config"]>;
Expand Down Expand Up @@ -279,7 +279,7 @@ export const isFciEnabledSelector = createSelector(

export const isIdPayEnabledSelector = createSelector(
remoteConfigSelector,
isIdPayTestEnabledSelector,
isIdPayLocallyEnabledSelector,
(remoteConfig, isIdPayTestEnabled): boolean =>
isIdPayTestEnabled ||
pipe(
Expand Down
4 changes: 2 additions & 2 deletions ts/store/reducers/persistedPreferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ export const isMixpanelEnabled = (state: GlobalState): boolean | null =>
export const isPnTestEnabledSelector = (state: GlobalState) =>
state.persistedPreferences.isPnTestEnabled;

export const isIdPayTestEnabledSelector = (state: GlobalState) =>
!!state.persistedPreferences?.isIdPayTestEnabled;
export const isIdPayLocallyEnabledSelector = (state: GlobalState) =>
state.persistedPreferences?.isIdPayTestEnabled;

// 'isDesignSystemEnabled' has been introduced without a migration
// (PR https://github.com/pagopa/io-app/pull/4427) so there are cases
Expand Down

0 comments on commit e9a20ab

Please sign in to comment.