Skip to content

Commit

Permalink
Merge branch 'master' into wip-react-redux
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisTofani committed May 21, 2024
2 parents 9420b66 + 8164a03 commit eac403b
Show file tree
Hide file tree
Showing 86 changed files with 18,208 additions and 2,248 deletions.
3,809 changes: 3,809 additions & 0 deletions img/features/itWallet/eid_card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,809 changes: 3,809 additions & 0 deletions img/features/itWallet/eid_card_invalid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions locales/de/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,7 @@ authentication:
card5-title: "Willkommen in IO!"
card5-content: "Lass uns gemeinsam herausfinden, was du machen kannst"
card5-content-accessibility: "Wähle das vorherige Element, um einen Chat mit dem IO-Team zu beginnen, wenn etwas nicht so funktioniert, wie es sollte."
expiredCardTitle: "Karte abgelaufen oder nicht mehr gültig"
expiredCardHeaderTitle: "Anmeldung mit CIE"
expiredCardContent: "Die verwendete Karte ist nicht mehr gültig oder abgelaufen.\nWenn du dich anmelden und auf die IO zugreifen möchtest, musst du SPID verwenden."
expiredCardHelp: "Wie erneuert man seine elektronische Identitätskarte?"
cie:
genericTitle: "Anmeldung mit CIE"
Expand Down
14 changes: 11 additions & 3 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ authentication:
card5-title: Welcome to IO!
card5-content: What can you do?
card5-content-accessibility: Select previous item to open a chat with the IO team if something is not working.
expiredCardTitle: Card expired or no longer valid
expiredCardTitle: The CIE verification failed
expiredCardHeaderTitle: Login with CIE
expiredCardContent: "The card used is no longer valid or has expired.\nIf you want to log in and access IO you must use SPID."
expiredCardContent: The card used is no longer valid or has expired. Use SPID to enter the app.
expiredCardHelp: How to renew your Electronic Identity Card?
cie:
genericTitle: Login with CIE
Expand Down Expand Up @@ -1921,7 +1921,8 @@ messageDetails:
contextualHelpContent: !include messages/message_detail.md
headerTitle: Message
emptyMessage: No content
loadingText: Loading message details in progress...
loadingText: Loading message details
pleaseWait: Wait a few moments
errorText: We were unable to load the details of your message
retryText: It's probably a temporary error... please try again!
submitBugText: If the problem is not resolved, report it with the '?' icon at the top right, thank you!
Expand Down Expand Up @@ -2091,6 +2092,7 @@ services:
disableAllMsg: "Remember, on IO you will receive messages only from services having some personalized information to communicate to you. You will not receive spam messages. If you disable all the services, they can no longer contact you through the app (until you enable it again). You can use the services through other channels (front office, website, etc.)"
close: Close
emptyListMessage: There are no services available at this time, pull down to refresh
new: New
home:
institutions:
title: National
Expand Down Expand Up @@ -3024,6 +3026,12 @@ features:
failure: FALLITA
success: ""
itWallet:
card:
eid:
label: Identità digitale
expired: Non valida
pending: In lavorazione
digital: Versione digitale
discovery:
info:
title: Start with your Digital Identity
Expand Down
14 changes: 11 additions & 3 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ authentication:
card5-title: Ti diamo il benvenuto su IO!
card5-content: Vediamo insieme cosa puoi fare
card5-content-accessibility: Seleziona elemento precedente per aprire una chat con il team di IO se qualcosa non funziona come dovrebbe.
expiredCardTitle: Carta scaduta o non più valida
expiredCardTitle: La verifica della CIE non è andata a buon fine
expiredCardHeaderTitle: Entra con CIE
expiredCardContent: "La carta utilizzata non è più valida oppure è scaduta.\nSe vuoi autenticarti ed accedere ad IO devi usare SPID."
expiredCardContent: La carta utilizzata potrebbe essere scaduta o non più valida. Prova ad usare SPID per entrare in app.
expiredCardHelp: Come rinnovare la propria Carta di Identità Elettronica?
cie:
genericTitle: Entra con CIE
Expand Down Expand Up @@ -1921,7 +1921,8 @@ messageDetails:
contextualHelpContent: !include messages/message_detail.md
headerTitle: Messaggio
emptyMessage: Nessun contenuto
loadingText: Caricamento dei dettagli del messaggio in corso...
loadingText: Stiamo caricando il messaggio
pleaseWait: Attendi qualche secondo
errorText: Non siamo riusciti a caricare i dettagli del tuo messaggio
retryText: Probabilmente è un errore temporaneo... riprova per piacere!
submitBugText: Se il problema non si risolve segnalacelo con l'icona '?' in alto a destra, grazie!
Expand Down Expand Up @@ -2091,6 +2092,7 @@ services:
disableAllMsg: "Ricorda che su IO ti scriveranno solo i servizi che effettivamente hanno qualche informazione personalizzata da comunicarti. Non riceverai messaggi di spam. Se disattivi tutti i servizi, questi non potranno più contattarti tramite IO (finché non li riattiverai). Potrai continuare a fruire i servizi attraverso altri canali (sportello, sito, etc.)"
close: Chiudi
emptyListMessage: Non ci sono servizi disponibili al momento, trascina in basso per aggiornare
new: Nuovo
home:
institutions:
title: Nazionali
Expand Down Expand Up @@ -3024,6 +3026,12 @@ features:
failure: FALLITA
success: ""
itWallet:
card:
eid:
label: Identità digitale
expired: Non valida
pending: In lavorazione
digital: Versione digitale
discovery:
info:
title: Inizia dalla tua Identità Digitale
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"dependencies": {
"@babel/plugin-transform-regenerator": "^7.18.6",
"@gorhom/bottom-sheet": "^4.1.5",
"@pagopa/io-app-design-system": "1.36.11",
"@pagopa/io-app-design-system": "1.36.14",
"@pagopa/io-pagopa-commons": "^3.1.0",
"@pagopa/io-react-native-crypto": "^0.3.0",
"@pagopa/io-react-native-http-client": "^0.1.3",
Expand Down Expand Up @@ -149,6 +149,7 @@
"react-native-crypto": "^2.1.0",
"react-native-device-info": "^10.8.0",
"react-native-document-picker": "^9.1.1",
"react-native-easing-gradient": "^1.1.1",
"react-native-exception-handler": "^2.10.8",
"react-native-fingerprint-scanner": "^6.0.0",
"react-native-flag-secure-android": "^1.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Object {
"migration": Object {
"_tag": "None",
},
"shownCategory": "INBOX",
},
"detailsById": Object {},
"downloads": Object {},
Expand Down
14 changes: 10 additions & 4 deletions ts/components/screens/LoadingScreenContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { SafeAreaView } from "react-native-safe-area-context";
import { LoadingIndicator } from "../../components/ui/LoadingIndicator";
import { useOnFirstRender } from "../../utils/hooks/useOnFirstRender";
import { WithTestID } from "../../types/WithTestID";

const styles = StyleSheet.create({
container: {
Expand All @@ -29,13 +30,14 @@ const styles = StyleSheet.create({

const SPACE_BETWEEN_SPINNER_AND_TEXT = 24;

type LoadingScreenContentProps = {
type LoadingScreenContentProps = WithTestID<{
contentTitle: string;
children?: React.ReactNode;
};
headerVisible?: boolean;
}>;

export const LoadingScreenContent = (props: LoadingScreenContentProps) => {
const { contentTitle, children } = props;
const { contentTitle, children, headerVisible, testID } = props;

useOnFirstRender(() => {
// Since the screen is shown for a very short time,
Expand All @@ -50,7 +52,11 @@ export const LoadingScreenContent = (props: LoadingScreenContentProps) => {
});

return (
<SafeAreaView style={styles.container}>
<SafeAreaView
style={styles.container}
edges={headerVisible ? ["bottom"] : undefined}
testID={testID}
>
<ContentWrapper>
<View style={styles.content}>
<View
Expand Down
56 changes: 56 additions & 0 deletions ts/components/screens/__tests__/LoadingScreenContent.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from "react";
import { Text } from "react-native";
import { createStore } from "redux";
import LoadingScreenContent from "../LoadingScreenContent";
import { appReducer } from "../../../store/reducers";
import { applicationChangeState } from "../../../store/actions/application";
import { renderScreenWithNavigationStoreContext } from "../../../utils/testWrapper";
import { GlobalState } from "../../../store/reducers/types";
import { preferencesDesignSystemSetEnabled } from "../../../store/actions/persistedPreferences";

describe("LoadingScreenContent", () => {
it("should match the snapshot with title, no children, header hidden", () => {
const defaultProps = {
contentTitle: "Test Content Title"
} as React.ComponentProps<typeof LoadingScreenContent>;
expect(renderComponent(defaultProps)).toMatchSnapshot();
});
it("should match the snapshot with title, no children, header shown", () => {
const defaultProps = {
contentTitle: "Test Content Title",
headerVisible: true
} as React.ComponentProps<typeof LoadingScreenContent>;
expect(renderComponent(defaultProps)).toMatchSnapshot();
});
it("should match the snapshot with title, a child, header hidden", () => {
const defaultProps = {
contentTitle: "Test Content Title",
children: <Text>{"My test child"}</Text>
} as React.ComponentProps<typeof LoadingScreenContent>;
expect(renderComponent(defaultProps)).toMatchSnapshot();
});
it("should match the snapshot with title, a child, header shown", () => {
const defaultProps = {
contentTitle: "Test Content Title",
children: <Text>{"My test child"}</Text>,
headerVisible: true
} as React.ComponentProps<typeof LoadingScreenContent>;
expect(renderComponent(defaultProps)).toMatchSnapshot();
});
});

function renderComponent(
props: React.ComponentProps<typeof LoadingScreenContent>
) {
const globalState = appReducer(undefined, applicationChangeState("active"));
const designSystemEnabledState = appReducer(
globalState,
preferencesDesignSystemSetEnabled({ isDesignSystemEnabled: true })
);
return renderScreenWithNavigationStoreContext<GlobalState>(
() => <LoadingScreenContent {...props} />,
"DUMMY ROUTE",
{},
createStore(appReducer, designSystemEnabledState as any)
);
}
Loading

0 comments on commit eac403b

Please sign in to comment.