Skip to content

Commit

Permalink
Merge branch 'master' into IOBP-1047-add-store-review-when-payment-co…
Browse files Browse the repository at this point in the history
…mpleted
  • Loading branch information
Hantex9 authored Dec 4, 2024
2 parents e1636a4 + 74fc6eb commit afdbc2b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 21 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
27 changes: 19 additions & 8 deletions ts/features/wallet/screens/WalletHomeScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { IOStyles, IOToast } from "@pagopa/io-app-design-system";
import { useFocusEffect } from "@react-navigation/native";
import React from "react";
import { ScrollView } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
import { IOScrollView } from "../../../components/ui/IOScrollView";
import { useTabItemPressWhenScreenActive } from "../../../hooks/useTabItemPressWhenScreenActive";
import I18n from "../../../i18n";
import {
IOStackNavigationRouteProps,
useIONavigation
} from "../../../navigation/params/AppParamsList";
import { MainTabParamsList } from "../../../navigation/params/MainTabParamsList";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { cgnDetails } from "../../bonus/cgn/store/actions/details";
import { idPayWalletGet } from "../../idpay/wallet/store/actions";
import {
trackOpenWalletScreen,
trackWalletAdd
} from "../../itwallet/analytics";
import { ITW_ROUTES } from "../../itwallet/navigation/routes";
import { getPaymentsWalletUserMethods } from "../../payments/wallet/store/actions";
import { WalletCardsContainer } from "../components/WalletCardsContainer";
import { WalletCategoryFilterTabs } from "../components/WalletCategoryFilterTabs";
import { walletToggleLoadingState } from "../store/actions/placeholders";
import { selectWalletCards } from "../store/selectors";
import {
trackOpenWalletScreen,
trackWalletAdd
} from "../../itwallet/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";

export type WalletHomeNavigationParams = Readonly<{
newMethodAdded: boolean;
Expand Down Expand Up @@ -70,6 +71,7 @@ const WalletHomeScreen = ({ route }: Props) => {
};

const WalletScrollView = ({ children }: React.PropsWithChildren<any>) => {
const animatedScrollViewRef = useAnimatedRef<Animated.ScrollView>();
const navigation = useIONavigation();
const cards = useIOSelector(selectWalletCards);

Expand All @@ -80,21 +82,30 @@ const WalletScrollView = ({ children }: React.PropsWithChildren<any>) => {
});
};

useTabItemPressWhenScreenActive(
React.useCallback(() => {
animatedScrollViewRef.current?.scrollTo({ y: 0, animated: true });
}, [animatedScrollViewRef]),
false
);

if (cards.length === 0) {
return (
<ScrollView
<Animated.ScrollView
ref={animatedScrollViewRef}
contentContainerStyle={[
IOStyles.flex,
IOStyles.horizontalContentPadding
]}
>
{children}
</ScrollView>
</Animated.ScrollView>
);
}

return (
<IOScrollView
animatedRef={animatedScrollViewRef}
actions={{
type: "SingleButton",
primary: {
Expand Down

0 comments on commit afdbc2b

Please sign in to comment.