Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [IOPID-1714] IOS crashes on EIC malformed URLs #5660

Merged
merged 12 commits into from
Apr 4, 2024
Merged
1 change: 1 addition & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ authentication:
cardLocked: CIE card locked
wrongPin1AttemptLeft: Wrong PIN, you still have 1 attempt
wrongPin2AttemptLeft: Wrong PIN, you still have 2 attempts
genericError: Something went wrong! Please try again.
error:
readerCardLostTitle: Hold the card again for a few seconds
readerCardLostTitleiOS: You removed the card too soon.
Expand Down
1 change: 1 addition & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ authentication:
cardLocked: Carta CIE bloccata
wrongPin1AttemptLeft: PIN errato, hai ancora 1 tentativo
wrongPin2AttemptLeft: PIN errato, hai ancora 2 tentativi
genericError: Si è verificato un errore imprevisto. Riprova.
error:
readerCardLostTitle: Avvicina nuovamente la carta
readerCardLostTitleiOS: Hai rimosso la carta troppo presto
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"@pagopa/io-react-native-http-client": "^0.1.3",
"@pagopa/io-react-native-login-utils": "^1.0.0",
"@pagopa/io-react-native-zendesk": "^0.3.29",
"@pagopa/react-native-cie": "1.2.0",
"@pagopa/react-native-cie": "^1.2.1",
"@pagopa/ts-commons": "^10.15.0",
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-camera-roll/camera-roll": "5.6.1",
Expand Down
78 changes: 31 additions & 47 deletions ts/components/LoadingSpinnerOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import {
hexToRgba
} from "@pagopa/io-app-design-system";
import I18n from "../i18n";
import { useIOSelector } from "../store/hooks";
import { isDesignSystemEnabledSelector } from "../store/reducers/persistedPreferences";
import ButtonDefaultOpacity from "./ButtonDefaultOpacity";
import { Overlay } from "./ui/Overlay";
import { IOStyles } from "./core/variables/IOStyles";
import { Body } from "./core/typography/Body";
Expand Down Expand Up @@ -37,50 +34,37 @@ const LoadingSpinnerOverlay = ({
loadingCaption,
loadingOpacity = 0.7,
onCancel
}: Props) => {
const isDesignSystemEnabled = useIOSelector(isDesignSystemEnabledSelector);
return (
<Overlay
backgroundColor={hexToRgba(IOColors.white, loadingOpacity)}
foreground={
isLoading && (
<BoxedRefreshIndicator
caption={
<View style={styles.textCaption}>
<Body accessible={true} style={{ textAlign: "center" }}>
{loadingCaption || I18n.t("global.remoteStates.wait")}
</Body>
}: Props) => (
<Overlay
backgroundColor={hexToRgba(IOColors.white, loadingOpacity)}
foreground={
isLoading && (
<BoxedRefreshIndicator
caption={
<View style={styles.textCaption}>
<Body accessible={true} style={{ textAlign: "center" }}>
{loadingCaption || I18n.t("global.remoteStates.wait")}
</Body>
</View>
}
action={
onCancel && (
<View style={IOStyles.selfCenter}>
<ButtonOutline
accessibilityLabel={I18n.t("global.buttons.cancel")}
onPress={onCancel}
testID="loadingSpinnerOverlayCancelButton"
label={I18n.t("global.buttons.cancel")}
/>
</View>
}
action={
onCancel && (
<View style={IOStyles.selfCenter}>
{isDesignSystemEnabled ? (
<ButtonOutline
accessibilityLabel={I18n.t("global.buttons.cancel")}
onPress={onCancel}
testID="loadingSpinnerOverlayCancelButton"
label={I18n.t("global.buttons.cancel")}
/>
) : (
<ButtonDefaultOpacity
onPress={onCancel}
cancel={true}
testID={"loadingSpinnerOverlayCancelButton"}
>
<Body>{I18n.t("global.buttons.cancel")}</Body>
</ButtonDefaultOpacity>
)}
</View>
)
}
/>
)
}
>
{children}
</Overlay>
);
};
)
}
/>
)
}
>
{children}
</Overlay>
);

export default LoadingSpinnerOverlay;
3 changes: 2 additions & 1 deletion ts/screens/authentication/cie/CieCardReaderScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ class CieCardReaderScreen extends React.PureComponent<Props, State> {
),
wrongPin2AttemptLeft: I18n.t(
"authentication.cie.card.iosAlert.wrongPin2AttemptLeft"
)
),
genericError: I18n.t("authentication.cie.card.iosAlert.genericError")
})
.then(async () => {
await cieManager.startListeningNFC();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3343,10 +3343,10 @@
write-yaml-file "^4.1.3"
yargs "^15.0.1"

"@pagopa/react-native-cie@1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@pagopa/react-native-cie/-/react-native-cie-1.2.0.tgz#7c664e810dfb4ea4e86c2a1a9e7c92ce481781a2"
integrity sha512-Dge9dKfsyqNvdc6cn/kEKoAGRQtvsVkO7zNz/oK/CgBGnw9V0h0A1PlogjvN1gsFpGMVuCOC3UiZocxMK95/0A==
"@pagopa/react-native-cie@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@pagopa/react-native-cie/-/react-native-cie-1.2.1.tgz#f38ca7c714c4943da839d232a4c076cc78f0d833"
integrity sha512-6v5DAzy5aTTBag+1idSyClTWRBhZ66kPoh5WXGxZsbKQQSolWhcTyl7pmWDeVG69UnkhIuy8ggXLGQnkrfOSOw==

"@pagopa/ts-commons@^10.15.0":
version "10.15.0"
Expand Down
Loading