Skip to content

Commit

Permalink
Merge branch 'master' into IOCOM-1949
Browse files Browse the repository at this point in the history
  • Loading branch information
Vangaorth authored Dec 4, 2024
2 parents e11a898 + 74fc6eb commit 085946a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4193,7 +4193,7 @@ FIMS:
title: "C’è un problema temporaneo"
body: "Qui puoi consultare la cronologia dei tuoi accessi a servizi esterni tramite IO e richiederne una copia via email."
toast: C’è un problema nel caricamento della lista. Riprova
emptyBody: "Qui troverai la lista degli accessi ogni volta che usi un servizio di terza parte tramite IO."
emptyBody: "Non hai ancora effettuato alcun accesso a servizi di terze parti"
exportData:
alerts:
areYouSure: "Vuoi davvero esportare una copia di tutti gli accessi?"
Expand Down
2 changes: 1 addition & 1 deletion locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4193,7 +4193,7 @@ FIMS:
title: "C’è un problema temporaneo"
body: "Qui puoi consultare la cronologia dei tuoi accessi a servizi esterni tramite IO e richiederne una copia via email."
toast: C’è un problema nel caricamento della lista. Riprova
emptyBody: "Qui troverai la lista degli accessi ogni volta che usi un servizio di terza parte tramite IO."
emptyBody: "Non hai ancora effettuato alcun accesso a servizi di terze parti"
exportData:
alerts:
areYouSure: "Vuoi davvero esportare una copia di tutti gli accessi?"
Expand Down
19 changes: 13 additions & 6 deletions ts/features/fims/singleSignOn/components/FimsFullScreenErrors.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
import { useNavigation } from "@react-navigation/native";
import * as React from "react";
import {
OperationResultScreenContent,
OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import I18n from "../../../../i18n";
import { useIOSelector } from "../../../../store/hooks";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
fimsAuthenticationErrorTagSelector,
fimsDebugDataSelector
} from "../store/selectors";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { fimsCancelOrAbortAction } from "../store/actions";

export const FimsSSOFullScreenError = () => {
const navigation = useNavigation();
const dispatch = useIODispatch();
const errorTag = useIOSelector(fimsAuthenticationErrorTagSelector);
const debugData = useIOSelector(fimsDebugDataSelector);

const debugInfo = React.useMemo(
() => ({
fimsFailure: `${errorTag}: ${debugData}`
}),
[debugData, errorTag]
);
useDebugInfo(debugInfo);

const handleClose = React.useCallback(
() => dispatch(fimsCancelOrAbortAction()),
[dispatch]
);

const getErrorComponentProps = (): OperationResultScreenContentProps => {
switch (errorTag) {
case "AUTHENTICATION":
Expand All @@ -35,7 +42,7 @@ export const FimsSSOFullScreenError = () => {
pictogram: "umbrellaNew",
action: {
label: I18n.t("global.buttons.close"),
onPress: navigation.goBack
onPress: handleClose
}
};
case "MISSING_INAPP_BROWSER":
Expand All @@ -50,7 +57,7 @@ export const FimsSSOFullScreenError = () => {
pictogram: "updateOS",
action: {
label: I18n.t("global.buttons.close"),
onPress: navigation.goBack
onPress: handleClose
}
};
default:
Expand All @@ -61,7 +68,7 @@ export const FimsSSOFullScreenError = () => {
pictogram: "umbrellaNew",
action: {
label: I18n.t("global.buttons.close"),
onPress: navigation.goBack
onPress: handleClose
}
};
}
Expand Down
12 changes: 7 additions & 5 deletions ts/features/fims/singleSignOn/screens/FimsFlowHandlerScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Body, IOStyles } from "@pagopa/io-app-design-system";
import * as pot from "@pagopa/ts-commons/lib/pot";
import { pipe } from "fp-ts/lib/function";
import { constTrue, pipe } from "fp-ts/lib/function";
import * as O from "fp-ts/Option";
import * as React from "react";
import { View } from "react-native";
Expand Down Expand Up @@ -64,10 +64,12 @@ export const FimsFlowHandlerScreen = (
goBack: handleCancelOrAbort
});

useHardwareBackButton(() => {
handleCancelOrAbort();
return true;
});
// Force users on Android to use UI buttons to go back, since
// there are cases where a modal may be displayed on top of
// the screen (like the assistance one) and the hardware back
// button event is not stopped by such screen but is instead
// propagated to this UI, causing a back loop
useHardwareBackButton(constTrue);

React.useEffect(() => {
if (ctaUrl && !requiresAppUpdate) {
Expand Down

0 comments on commit 085946a

Please sign in to comment.