diff --git a/.env.local b/.env.local index 901248d9d24..0760361e8d6 100644 --- a/.env.local +++ b/.env.local @@ -42,8 +42,6 @@ PLAYGROUNDS_ENABLED=YES BONUS_API_URL_PREFIX='http://127.0.0.1:3000/bonus' BONUS_API_SIT_BASEURL='https://api-io.dev.cstar.pagopa.it' BONUS_API_UAT_BASEURL='https://api-io.uat.cstar.pagopa.it' -# EU Covid Certificate -EU_COVID_CERT_ENABLED=YES # Zendesk configuration ZENDESK_ENABLED=YES # CGN new merchants features diff --git a/.env.production b/.env.production index 0984b3a2b76..5c9eaf48248 100644 --- a/.env.production +++ b/.env.production @@ -42,8 +42,6 @@ PLAYGROUNDS_ENABLED=YES BONUS_API_URL_PREFIX=https://api-io.cstar.pagopa.it BONUS_API_SIT_BASEURL='https://api-io.dev.cstar.pagopa.it' BONUS_API_UAT_BASEURL='https://api-io.uat.cstar.pagopa.it' -# EU Covid Certificate -EU_COVID_CERT_ENABLED=YES # Zendesk configuration ZENDESK_ENABLED=YES # CGN new merchants features diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index ee596a8e457..fda3e5a9510 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -72,8 +72,6 @@ jobs: name: "cgn_e2e" - test: "ts/features/messages/__e2e__/" name: "messages_e2e" - - test: "ts/features/euCovidCert/__e2e__/" - name: "eucovidcert_e2e" - test: "ts/features/wallet/onboarding/__e2e__/" name: "wallet_onboarding_e2e" steps: diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ae9f3428b25..dfea2dbe993 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -30,10 +30,6 @@ - - - - diff --git a/android/settings.gradle b/android/settings.gradle index 2f63f80bcde..f6d322ab747 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -3,8 +3,6 @@ include ':react-native-reanimated' project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android') include ':@react-native-community_cookies' project(':@react-native-community_cookies').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/cookies/android') -include ':react-native-view-shot' -project(':react-native-view-shot').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-view-shot/android') include ':jail-monkey' project(':jail-monkey').projectDir = new File(rootProject.projectDir, '../node_modules/jail-monkey/android') include ':react-native-linear-gradient' diff --git a/assets/SiciliaVola.yml b/assets/SiciliaVola.yml deleted file mode 100644 index 3bd440dd50e..00000000000 --- a/assets/SiciliaVola.yml +++ /dev/null @@ -1,1111 +0,0 @@ ---- -swagger: "2.0" -info: - description: "" - version: "1.0.0" - title: "Sicilia vola" - x-ibm-name: "sic" -basePath: "/SICUtenteWS" -tags: -- name: "securedBeneficiario" -- name: "unsecuredGeopoi" -- name: "unsecured" -definitions: - AeroportoSedeBean: - type: "object" - properties: - codIATA: - type: "string" - denominazione: - type: "string" - sigla: - type: "string" - AeroportiAmmessiInputBean: - type: object - properties: - latitudine: - type: number - format: double - longitudine: - type: number - format: double - stato: - type: string - required: - - latitudine - - longitudine - - stato - BeneficiarioBean: - type: "object" - properties: - codErrore: - type: "string" - idBeneficiario: - type: "integer" - format: "int64" - codiceFiscale: - type: "string" - cognome: - type: "string" - nome: - type: "string" - dataNascita: - type: "string" - format: "date-time" - comuneNascita: - type: "string" - listaVoucherAttivi: - type: "array" - items: - $ref: "#/definitions/VoucherBean" - flagRegistrato: - type: "boolean" - strDataNascita: - type: "string" - accessoSpid: - type: "boolean" - flagVisioneNormativa: - type: "boolean" - flagVisioneAutocertificazione: - type: "boolean" - sesso: - type: "string" - email: - type: "string" - primaRichiesta: - type: "boolean" - VoucherCodeInputBean: - type: object - properties: - codiceVoucher: - type: "integer" - format: "int64" - VoucherBean: - type: "object" - properties: - codErrore: - type: "string" - idVoucher: - type: "integer" - format: "int64" - codVoucher: - type: "string" - idBeneficiario: - type: "integer" - format: "int64" - idEsercente: - type: "integer" - format: "int64" - idCategoria: - type: "integer" - format: "int64" - annoRiferimento: - type: "integer" - format: "int32" - annoUtilizzo: - type: "integer" - format: "int32" - importoRichiesto: - type: "number" - importoValidato: - type: "number" - qrCode: - type: "array" - items: - type: "string" - format: "byte" - codeLine: - type: "array" - items: - type: "string" - format: "byte" - dataEmissione: - type: "string" - format: "date-time" - dataScadenza: - type: "string" - format: "date-time" - dataConferma: - type: "string" - format: "date-time" - dataInserimento: - type: "string" - format: "date-time" - strFlagValidatoOnline: - type: "string" - strFlagScaduto: - type: "string" - cognomeBeneficiario: - type: "string" - nomeBeneficiario: - type: "string" - descCategoria: - type: "string" - strDataEmissione: - type: "string" - strDataScadenza: - type: "string" - strDataConferma: - type: "string" - ragioneSocialeEsercente: - type: "string" - formScaduto: - type: "string" - idStato: - type: "integer" - format: "int64" - strStatoVoucher: - type: "string" - strDataVolo: - type: "string" - strDataVoloRitorno: - type: "string" - strFlagAR: - type: "string" - stato: - type: "string" - provincia: - type: "string" - comune: - type: "string" - universita: - type: "string" - cfPivaAzienda: - type: "string" - ragioneSociale: - type: "string" - indicazione: - type: "string" - latitudine: - type: "number" - format: "double" - longitudine: - type: "number" - format: "double" - idRegione: - type: "integer" - format: "int64" - idCategoriaBeneficiario: - type: "integer" - format: "int64" - idAeroportoStart: - type: "integer" - format: "int64" - identificativo: - type: "string" - importoTotale: - type: "number" - importoBiglietto: - type: "number" - strFlagAccompagnatore: - type: "string" - codiceVolo: - type: "string" - codiceVoloRitorno: - type: "string" - aeroportoPart: - type: "string" - aeroportoDest: - type: "string" - aeroportoPartRitorno: - type: "string" - aeroportoDestRitorno: - type: "string" - facolta: - type: "string" - descrCategoriaBeneficiario: - type: "string" - descrRegione: - type: "string" - descrStato: - type: "string" - descrProvincia: - type: "string" - descrSede: - type: "string" - aeroporti: - type: "array" - items: - $ref: "#/definitions/AeroportoSedeBean" - StatoVoucherBean: - type: "object" - properties: - idStato: - type: "integer" - format: "int64" - statoDesc: - type: "string" - StatoVoucherBeanList: - type: "array" - items: - $ref: "#/definitions/StatoVoucherBean" - SimpleResponseBean: - type: "object" - properties: - codErrore: - type: "string" - ProblemBean: - type: "object" - properties: - type: - type: "string" - title: - type: "string" - status: - type: "integer" - format: "int32" - detail: - type: "string" - instance: - type: "string" - ListaVoucherBeneficiarioOutputBean: - type: "object" - properties: - size: - type: "integer" - format: "int32" - listaRisultati: - type: "array" - items: - $ref: "#/definitions/VoucherBeneficiarioOutputBean" - VoucherBeneficiarioOutputBean: - type: "object" - properties: - idVoucher: - type: "integer" - format: "int64" - dataConferma: - type: "string" - format: "date-time" - strConferma: - type: "string" - dataInserimento: - type: "string" - format: "date-time" - idEsercente: - type: "integer" - format: "int64" - importoBiglietto: - type: "number" - dataVolo: - type: "string" - format: "date-time" - importoValidato: - type: "number" - idBeneficiario: - type: "integer" - format: "int64" - codiceVoucher: - type: "string" - statoDesc: - type: "string" - aeroportoPart: - type: "string" - aeroportoDest: - type: "string" - aeroportoPartAR: - type: "string" - aeroportoDestAR: - type: "string" - VoucherBeneficiarioInputBean: - type: "object" - properties: - pagination: - type: "boolean" - pageNum: - type: "integer" - format: "int32" - elementsXPage: - type: "integer" - format: "int32" - strDataDa: - type: "string" - strDataA: - type: "string" - codiceVoucher: - type: "string" - idStato: - type: "integer" - format: "int64" - dataDa: - type: "string" - format: "date-time" - dataA: - type: "string" - format: "date-time" - GeoPoiBean: - type: "object" - properties: - key: - type: "string" - url: - type: "string" - ProvinciaBean: - type: "object" - properties: - sigla: - type: "string" - descrizione: - type: "string" - regione: - type: "string" - area: - type: "string" - idRegione: - type: "integer" - format: "int64" - StatoUEBeanList: - type: "array" - items: - $ref: "#/definitions/StatoUEBean" - ProvinciaBeanList: - type: "array" - items: - $ref: "#/definitions/ProvinciaBean" - ComuneBeanList: - type: "array" - items: - $ref: "#/definitions/ComuneBean" - AeroportoSedeBeanList: - type: "array" - items: - $ref: "#/definitions/AeroportoSedeBean" - StatoUEBean: - type: "object" - properties: - id: - type: "integer" - format: "int64" - iso: - type: "string" - descrizione: - type: "string" - TrattaBean: - type: "object" - properties: - descrTratta: - type: "string" - tipo: - type: "string" - denominazione: - type: "string" - logo: - type: "string" - icao: - type: "string" - idVettore: - type: "integer" - format: "int64" - ComuneBean: - type: "object" - properties: - codiceCatastale: - type: "string" - descrizioneComune: - type: "string" - siglaProvincia: - type: "string" - AtecoBean: - type: "object" - properties: - codiceAteco: - type: "string" - descrizioneAteco: - type: "string" - EsercentePuntoVenditaCategoriaBean: - type: "object" - properties: - idPuntoVendita: - type: "integer" - format: "int64" - denominazione: - type: "string" - indirizzo: - type: "string" - cap: - type: "string" - comune: - type: "string" - codProvincia: - type: "string" - urlSito: - type: "string" - telefonoPrincipale: - type: "string" - telefonoSecondario: - type: "string" - email: - type: "string" - latitudine: - type: "string" - longitudine: - type: "string" - flagFisicoOnline: - type: "boolean" - idEsercente: - type: "integer" - format: "int64" - ragioneSociale: - type: "string" - ListaPuntiVenditaOutputBean: - type: "object" - properties: - size: - type: "integer" - format: "int32" - listaRisultati: - type: "array" - items: - $ref: "#/definitions/EsercentePuntoVenditaCategoriaBean" - CategoriaBean: - type: "object" - properties: - idCategoria: - type: "integer" - format: "int64" - descrizione: - type: "string" - ListaPuntiVenditaInputBean: - type: "object" - properties: - pagination: - type: "boolean" - pageNum: - type: "integer" - format: "int32" - elementsXPage: - type: "integer" - format: "int32" - flagFisicoOnline: - type: "boolean" - orderByAlfabetico: - type: "boolean" - isCrescente: - type: "boolean" - denominazione: - type: "string" - indirizzo: - type: "string" - codProvincia: - type: "string" - capOComune: - type: "string" - listaCategorie: - type: "array" - items: - $ref: "#/definitions/CategoriaBean" - PuntoVenditaCategoriaBean: - type: "object" - properties: - idPuntoVendita: - type: "integer" - format: "int64" - idCategoria: - type: "integer" - format: "int64" - descrizioneCategoria: - type: "string" - percentualeSconto: - type: "number" - idEsercente: - type: "integer" - format: "int64" - codFiscaleSelezionato: - type: "string" - flagOnline: - type: "string" - CategoriaBeneficiarioBean: - type: "object" - properties: - idCategoria: - type: "integer" - format: "int64" - descrizione: - type: "string" - AeroportoBean: - type: "object" - properties: - id: - type: "integer" - format: "int64" - descrizione: - type: "string" - PdfData: - type: "object" - properties: - data: - type: "string" - required: - - data -paths: - /rest/secured/beneficiario/aeroportiAmmessi: - post: - tags: - - securedBeneficiario - operationId: getAeroportiAmmessi - security: - - Bearer: [ ] - OcpApimSubscriptionKey: [ ] - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - description: "voucherBean" - required: true - schema: - $ref: "#/definitions/AeroportiAmmessiInputBean" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/AeroportoSedeBeanList" - "400": - description: "Validazioni non superate" - schema: - $ref: "#/definitions/ProblemBean" - "500": - description: "Errore interno." - /rest/secured/beneficiario/aeroportiSede/{idRegione}: - get: - tags: - - "securedBeneficiario" - operationId: "getAeroportiBeneficiario" - security: - - Bearer: [ ] - OcpApimSubscriptionKey: [ ] - produces: - - "application/json" - parameters: - - name: "idRegione" - in: "path" - description: "idRegione" - required: true - type: "integer" - format: "int64" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/AeroportoSedeBeanList" - 500: - description: "Errore interno." - /rest/secured/beneficiario/aeroportiStato/{idStato}: - get: - tags: - - "securedBeneficiario" - operationId: "getAeroportiStato" - security: - - Bearer: [ ] - OcpApimSubscriptionKey: [ ] - produces: - - "application/json" - parameters: - - name: "idStato" - in: "path" - description: "idStato" - required: true - type: "integer" - format: "int64" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/AeroportoSedeBeanList" - 500: - description: "Errore interno." - /rest/secured/beneficiario/annullaVoucher: - post: - tags: - - "securedBeneficiario" - operationId: "annullaVoucher" - security: - - Bearer: [ ] - OcpApimSubscriptionKey: [ ] - parameters: - - in: "body" - name: "body" - description: "VoucherCodeInputBean" - required: true - schema: - $ref: "#/definitions/VoucherCodeInputBean" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/SimpleResponseBean" - 400: - description: "Validazioni non superate" - content: - application/json: - schema: - $ref: "#/definitions/ProblemBean" - application/problem+json: - schema: - $ref: "#/definitions/ProblemBean" - 500: - description: "Errore interno." - /rest/secured/beneficiario/beneficiario: - get: - tags: - - "securedBeneficiario" - operationId: "getBeneficiario" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/BeneficiarioBean" - 500: - description: "Errore interno." - post: - tags: - - "securedBeneficiario" - operationId: "aggiungiBeneficiario" - consumes: - - "application/json" - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - description: "beneficiarioBean" - required: true - schema: - $ref: "#/definitions/BeneficiarioBean" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/BeneficiarioBean" - 500: - description: "Errore interno." - /rest/secured/beneficiario/dettaglioBeneficiario: - get: - tags: - - "securedBeneficiario" - operationId: "getDettaglioBeneficiario" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/BeneficiarioBean" - 500: - description: "Errore interno." - /rest/secured/beneficiario/dettaglioVoucher: - post: - tags: - - "securedBeneficiario" - operationId: "getDettaglioVoucher" - consumes: - - "application/json" - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - description: "voucherBean" - required: true - schema: - $ref: "#/definitions/VoucherBean" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/VoucherBean" - 500: - description: "Errore interno." - /rest/secured/beneficiario/ricercaVoucher: - post: - tags: - - "securedBeneficiario" - operationId: "getVoucherBeneficiario" - consumes: - - "application/json" - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - description: "voucherBeneficiarioInputBean" - required: true - schema: - $ref: "#/definitions/VoucherBeneficiarioInputBean" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/ListaVoucherBeneficiarioOutputBean" - 500: - description: "Errore interno." - /rest/secured/beneficiario/stampaVoucher: - post: - tags: - - "securedBeneficiario" - operationId: "getPdf" - security: - - Bearer: [ ] - OcpApimSubscriptionKey: [ ] - parameters: - - in: "body" - name: "body" - description: "VoucherCodeInputBean" - required: true - schema: - $ref: "#/definitions/VoucherCodeInputBean" - responses: - 200: - description: "a base64 string representing the image to be shown" - schema: - $ref: "#/definitions/PdfData" - 400: - description: "Validazioni non superate" - schema: - $ref: "#/definitions/ProblemBean" - 500: - description: "Errore interno." - /rest/secured/beneficiario/statiVoucher: - get: - tags: - - "securedBeneficiario" - operationId: "getStatiVoucher" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/StatoVoucherBeanList" - 500: - description: "Errore interno." - /rest/secured/beneficiario/ultimoVoucher: - get: - tags: - - "securedBeneficiario" - operationId: "ultimoVoucher" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/VoucherBean" - 500: - description: "Errore interno." - /rest/secured/beneficiario/voucher: - post: - tags: - - "securedBeneficiario" - operationId: "aggiungiVoucher" - consumes: - - "application/json" - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - description: "voucherBean" - required: true - schema: - $ref: "#/definitions/VoucherBean" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/VoucherBean" - 500: - description: "Errore interno." - /rest/unsecured/RegioniNoSic: - get: - tags: - - "unsecured" - operationId: "getListaRegioniNoSic" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - type: "array" - items: - $ref: "#/definitions/ProvinciaBean" - 500: - description: "Errore interno." - /rest/unsecured/aeroportiPartenza: - get: - tags: - - "unsecured" - operationId: "getListaAeroporti" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - type: "array" - items: - $ref: "#/definitions/AeroportoBean" - 500: - description: "Errore interno." - /rest/unsecured/ateco: - get: - tags: - - "unsecured" - operationId: "getListaAteco" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - type: "array" - items: - $ref: "#/definitions/AtecoBean" - 500: - description: "Errore interno." - /rest/unsecured/categorie: - get: - tags: - - "unsecured" - operationId: "getListaCategorie" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - type: "array" - items: - $ref: "#/definitions/CategoriaBean" - 500: - description: "Errore interno." - /rest/unsecured/categorieBeneficiario: - get: - tags: - - "unsecured" - operationId: "getListaCategorieBeneficiario" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - type: "array" - items: - $ref: "#/definitions/CategoriaBeneficiarioBean" - 500: - description: "Errore interno." - /rest/unsecured/categoriePuntoVendita/{idPuntoVendita}: - get: - tags: - - "unsecured" - operationId: "getListaCategoriePuntoVendita" - produces: - - "application/json" - parameters: - - name: "idPuntoVendita" - in: "path" - description: "idPuntoVendita" - required: true - type: "integer" - format: "int64" - responses: - 200: - description: "Tutto OK" - schema: - type: "array" - items: - $ref: "#/definitions/PuntoVenditaCategoriaBean" - 500: - description: "Errore interno." - /rest/unsecured/comuni/{siglaProvincia}: - get: - tags: - - "unsecured" - operationId: "getListaComuniBySiglaProvincia" - produces: - - "application/json" - parameters: - - name: "siglaProvincia" - in: "path" - description: "siglaProvincia" - required: true - type: "string" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/ComuneBeanList" - 500: - description: "Errore interno." - /rest/unsecured/comuniConsentiti: - get: - tags: - - "unsecured" - operationId: "getListaComuni" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - type: "array" - items: - $ref: "#/definitions/ComuneBean" - 500: - description: "Errore interno." - /rest/unsecured/geopoi/getGeoPoiKey: - get: - tags: - - "unsecuredGeopoi" - operationId: "getGeoPoiKey" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/GeoPoiBean" - 500: - description: "Errore interno." - /rest/unsecured/logout: - get: - tags: - - "unsecured" - operationId: "logout" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/SimpleResponseBean" - 500: - description: "Errore interno." - /rest/unsecured/province/{idRegione}: - get: - tags: - - "unsecured" - operationId: "getListaProvinceByIdRegione" - produces: - - "application/json" - parameters: - - name: "idRegione" - in: "path" - description: "idRegione" - required: true - type: "integer" - format: "int64" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/ProvinciaBeanList" - 500: - description: "Errore interno." - /rest/unsecured/puntiVendita: - post: - tags: - - "unsecured" - operationId: "getListaPuntiVendita" - consumes: - - "application/json" - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - description: "listaPuntiVenditaInputBean" - required: true - schema: - $ref: "#/definitions/ListaPuntiVenditaInputBean" - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/ListaPuntiVenditaOutputBean" - 500: - description: "Errore interno." - /rest/unsecured/regioni: - get: - tags: - - "unsecured" - operationId: "getListaRegioni" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/ProvinciaBeanList" - 500: - description: "Errore interno." - /rest/unsecured/statiUE: - get: - tags: - - "unsecured" - operationId: "getStatiUE" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - $ref: "#/definitions/StatoUEBeanList" - 500: - description: "Errore interno." - /rest/unsecured/tratte: - get: - tags: - - "unsecured" - operationId: "getListaTratte" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "Tutto OK" - schema: - type: "array" - items: - $ref: "#/definitions/TrattaBean" - 500: - description: "Errore interno." - /rest/unsecured/versione: - get: - tags: - - "unsecured" - operationId: "getVersione" - produces: - - "text/plain" - parameters: [] - responses: - 200: - description: "successful operation" - schema: - type: "string" - headers: {} -securityDefinitions: - Bearer: - type: apiKey - name: Authorization - in: header - OcpApimSubscriptionKey: - type: basic diff --git a/img/broken-link.png b/img/broken-link.png deleted file mode 100644 index 2b6f87a6415..00000000000 Binary files a/img/broken-link.png and /dev/null differ diff --git a/img/features/euCovidCert/certificate_expired.png b/img/features/euCovidCert/certificate_expired.png deleted file mode 100644 index 076648608c5..00000000000 Binary files a/img/features/euCovidCert/certificate_expired.png and /dev/null differ diff --git a/img/features/euCovidCert/certificate_not_found.png b/img/features/euCovidCert/certificate_not_found.png deleted file mode 100644 index 2854f56d7b3..00000000000 Binary files a/img/features/euCovidCert/certificate_not_found.png and /dev/null differ diff --git a/img/features/euCovidCert/certificate_revoked.png b/img/features/euCovidCert/certificate_revoked.png deleted file mode 100644 index 2640b9fecca..00000000000 Binary files a/img/features/euCovidCert/certificate_revoked.png and /dev/null differ diff --git a/img/features/euCovidCert/certificate_wrong_format.png b/img/features/euCovidCert/certificate_wrong_format.png deleted file mode 100644 index e4259ce91f1..00000000000 Binary files a/img/features/euCovidCert/certificate_wrong_format.png and /dev/null differ diff --git a/img/features/euCovidCert/eu-flag.png b/img/features/euCovidCert/eu-flag.png deleted file mode 100644 index 7d4fef6e8a8..00000000000 Binary files a/img/features/euCovidCert/eu-flag.png and /dev/null differ diff --git a/img/features/messages/alert_header.svg b/img/features/messages/alert_header.svg deleted file mode 100644 index c69221c91d7..00000000000 --- a/img/features/messages/alert_header.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/img/features/messages/pn_message_badge.svg b/img/features/messages/pn_message_badge.svg deleted file mode 100644 index 7491033b503..00000000000 --- a/img/features/messages/pn_message_badge.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/img/messages/empty-due-date-list-icon.png b/img/messages/empty-due-date-list-icon.png deleted file mode 100644 index 6f5a09e16e9..00000000000 Binary files a/img/messages/empty-due-date-list-icon.png and /dev/null differ diff --git a/img/messages/empty-due-date-list-icon@2x.png b/img/messages/empty-due-date-list-icon@2x.png deleted file mode 100644 index f54b9232d7e..00000000000 Binary files a/img/messages/empty-due-date-list-icon@2x.png and /dev/null differ diff --git a/img/messages/empty-due-date-list-icon@3x.png b/img/messages/empty-due-date-list-icon@3x.png deleted file mode 100644 index 47e34af00a8..00000000000 Binary files a/img/messages/empty-due-date-list-icon@3x.png and /dev/null differ diff --git a/img/messages/empty-transaction-list-icon.png b/img/messages/empty-transaction-list-icon.png deleted file mode 100644 index bb4b63a65db..00000000000 Binary files a/img/messages/empty-transaction-list-icon.png and /dev/null differ diff --git a/img/messages/empty-transaction-list-icon@2x.png b/img/messages/empty-transaction-list-icon@2x.png deleted file mode 100644 index 904aa482dad..00000000000 Binary files a/img/messages/empty-transaction-list-icon@2x.png and /dev/null differ diff --git a/img/messages/empty-transaction-list-icon@3x.png b/img/messages/empty-transaction-list-icon@3x.png deleted file mode 100644 index b236118593a..00000000000 Binary files a/img/messages/empty-transaction-list-icon@3x.png and /dev/null differ diff --git a/img/pictograms/doubt.png b/img/pictograms/doubt.png deleted file mode 100644 index c3185aa1f25..00000000000 Binary files a/img/pictograms/doubt.png and /dev/null differ diff --git a/img/pictograms/payment-completed-2x.png b/img/pictograms/payment-completed-2x.png deleted file mode 100644 index 9fe8e390b53..00000000000 Binary files a/img/pictograms/payment-completed-2x.png and /dev/null differ diff --git a/img/pictograms/payment-completed.png b/img/pictograms/payment-completed.png deleted file mode 100644 index b74829b86e0..00000000000 Binary files a/img/pictograms/payment-completed.png and /dev/null differ diff --git a/img/wallet/cards-icons/abiLogoFallback.png b/img/wallet/cards-icons/abiLogoFallback.png deleted file mode 100644 index 761a8a0ee37..00000000000 Binary files a/img/wallet/cards-icons/abiLogoFallback.png and /dev/null differ diff --git a/img/wallet/errors/generic-error-icon.png b/img/wallet/errors/generic-error-icon.png deleted file mode 100755 index 800dd6426c1..00000000000 Binary files a/img/wallet/errors/generic-error-icon.png and /dev/null differ diff --git a/img/wallet/errors/generic-error-icon.svg b/img/wallet/errors/generic-error-icon.svg deleted file mode 100755 index bec9caf6a4b..00000000000 --- a/img/wallet/errors/generic-error-icon.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - B0D61543-7372-446E-BDAE-142791D292B2 - Created with sketchtool. - - - - - - \ No newline at end of file diff --git a/img/wallet/errors/generic-error-icon@2x.png b/img/wallet/errors/generic-error-icon@2x.png deleted file mode 100755 index 5b20a951a1f..00000000000 Binary files a/img/wallet/errors/generic-error-icon@2x.png and /dev/null differ diff --git a/img/wallet/errors/generic-error-icon@3x.png b/img/wallet/errors/generic-error-icon@3x.png deleted file mode 100755 index 7cf9bca988f..00000000000 Binary files a/img/wallet/errors/generic-error-icon@3x.png and /dev/null differ diff --git a/img/wallet/errors/payment-expired-icon.png b/img/wallet/errors/payment-expired-icon.png deleted file mode 100755 index 011f12c3081..00000000000 Binary files a/img/wallet/errors/payment-expired-icon.png and /dev/null differ diff --git a/img/wallet/errors/payment-expired-icon.svg b/img/wallet/errors/payment-expired-icon.svg deleted file mode 100755 index 0247086b882..00000000000 --- a/img/wallet/errors/payment-expired-icon.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - E4C38C32-2CA4-44F9-965E-37E2911E6F38 - Created with sketchtool. - - - - - - \ No newline at end of file diff --git a/img/wallet/errors/payment-expired-icon@2x.png b/img/wallet/errors/payment-expired-icon@2x.png deleted file mode 100755 index c83ad663fd1..00000000000 Binary files a/img/wallet/errors/payment-expired-icon@2x.png and /dev/null differ diff --git a/img/wallet/errors/payment-expired-icon@3x.png b/img/wallet/errors/payment-expired-icon@3x.png deleted file mode 100755 index 44ee09bdfd8..00000000000 Binary files a/img/wallet/errors/payment-expired-icon@3x.png and /dev/null differ diff --git a/img/wallet/errors/payment-unavailable-icon.png b/img/wallet/errors/payment-unavailable-icon.png deleted file mode 100755 index fd71df56a9c..00000000000 Binary files a/img/wallet/errors/payment-unavailable-icon.png and /dev/null differ diff --git a/img/wallet/errors/payment-unavailable-icon.svg b/img/wallet/errors/payment-unavailable-icon.svg deleted file mode 100755 index 041e9632111..00000000000 --- a/img/wallet/errors/payment-unavailable-icon.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - FFBCB338-3580-4F9B-A1BB-6054E9B1398A - Created with sketchtool. - - - - - - \ No newline at end of file diff --git a/img/wallet/errors/payment-unavailable-icon@2x.png b/img/wallet/errors/payment-unavailable-icon@2x.png deleted file mode 100755 index a7c8d0e6555..00000000000 Binary files a/img/wallet/errors/payment-unavailable-icon@2x.png and /dev/null differ diff --git a/img/wallet/errors/payment-unavailable-icon@3x.png b/img/wallet/errors/payment-unavailable-icon@3x.png deleted file mode 100755 index 52578f6be8d..00000000000 Binary files a/img/wallet/errors/payment-unavailable-icon@3x.png and /dev/null differ diff --git a/img/wallet/errors/payment-unknown-icon.png b/img/wallet/errors/payment-unknown-icon.png deleted file mode 100755 index 6bb5a5219e8..00000000000 Binary files a/img/wallet/errors/payment-unknown-icon.png and /dev/null differ diff --git a/img/wallet/errors/payment-unknown-icon.svg b/img/wallet/errors/payment-unknown-icon.svg deleted file mode 100755 index 2bc9ec61293..00000000000 --- a/img/wallet/errors/payment-unknown-icon.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - 34953C33-1854-4694-8427-EBFA6AD390EE - Created with sketchtool. - - - - - - \ No newline at end of file diff --git a/img/wallet/errors/payment-unknown-icon@2x.png b/img/wallet/errors/payment-unknown-icon@2x.png deleted file mode 100755 index e4cfc3c6ad6..00000000000 Binary files a/img/wallet/errors/payment-unknown-icon@2x.png and /dev/null differ diff --git a/img/wallet/errors/payment-unknown-icon@3x.png b/img/wallet/errors/payment-unknown-icon@3x.png deleted file mode 100755 index bb444203e1f..00000000000 Binary files a/img/wallet/errors/payment-unknown-icon@3x.png and /dev/null differ diff --git a/ios/Podfile.lock b/ios/Podfile.lock index befee524cbd..efb99414ef4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -424,8 +424,6 @@ PODS: - React - react-native-blob-util (0.15.0): - React-Core - - react-native-cameraroll (5.6.1): - - React-Core - react-native-config (1.4.5): - react-native-config/App (= 1.4.5) - react-native-config/App (1.4.5): @@ -468,8 +466,6 @@ PODS: - React - react-native-splash-screen (3.2.0): - React - - react-native-view-shot (3.1.2): - - React - react-native-webview (13.10.3): - RCT-Folly (= 2021.07.22.00) - React-Core @@ -742,7 +738,6 @@ DEPENDENCIES: - React-logger (from `../node_modules/react-native/ReactCommon/logger`) - react-native-background-timer (from `../node_modules/react-native-background-timer`) - react-native-blob-util (from `../node_modules/react-native-blob-util`) - - "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)" - react-native-config (from `../node_modules/react-native-config`) - "react-native-cookies (from `../node_modules/@react-native-cookies/cookies`)" - react-native-document-picker (from `../node_modules/react-native-document-picker`) @@ -761,7 +756,6 @@ DEPENDENCIES: - "react-native-skia (from `../node_modules/@shopify/react-native-skia`)" - "react-native-slider (from `../node_modules/@react-native-community/slider`)" - react-native-splash-screen (from `../node_modules/react-native-splash-screen`) - - react-native-view-shot (from `../node_modules/react-native-view-shot`) - react-native-webview (from `../node_modules/react-native-webview`) - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) @@ -909,8 +903,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-background-timer" react-native-blob-util: :path: "../node_modules/react-native-blob-util" - react-native-cameraroll: - :path: "../node_modules/@react-native-camera-roll/camera-roll" react-native-config: :path: "../node_modules/react-native-config" react-native-cookies: @@ -947,8 +939,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-community/slider" react-native-splash-screen: :path: "../node_modules/react-native-splash-screen" - react-native-view-shot: - :path: "../node_modules/react-native-view-shot" react-native-webview: :path: "../node_modules/react-native-webview" React-NativeModulesApple: @@ -1082,7 +1072,6 @@ SPEC CHECKSUMS: React-logger: 8da4802de77a0eb62512396ad6bb1769904c2f0e react-native-background-timer: 1b6e6b4e10f1b74c367a1fdc3c72b67c619b222b react-native-blob-util: a5d3561045ed98cfb2fb80cbbff600fae0e8edee - react-native-cameraroll: 2f08db1ecc9b73dbc01f89335d6d5179fac2894c react-native-config: 6502b1879f97ed5ac570a029961fc35ea606cd14 react-native-cookies: f54fcded06bb0cda05c11d86788020b43528a26c react-native-document-picker: 3599b238843369026201d2ef466df53f77ae0452 @@ -1101,7 +1090,6 @@ SPEC CHECKSUMS: react-native-skia: 7bfe9c816d6ce75bcda1101ca0d53e221e5598f9 react-native-slider: e99fc201cefe81270fc9d81714a7a0f5e566b168 react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865 - react-native-view-shot: 4475fde003fe8a210053d1f98fb9e06c1d834e1c react-native-webview: 9946090a1cd4add775cf91327f93bc910bf89286 React-NativeModulesApple: 3107f777453f953906d9ba9dc5f8cbd91a6ef913 React-perflogger: daabc494c6328efc1784a4b49b8b74fca305d11c diff --git a/jest-e2e.config.js b/jest-e2e.config.js index 6a2680c8221..1c68f9651d5 100644 --- a/jest-e2e.config.js +++ b/jest-e2e.config.js @@ -1,7 +1,7 @@ module.exports = { preset: "react-native", transformIgnorePatterns: [ - "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@shopify/react-native-skia|lottie-react-native|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|@sentry/react-native)" + "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@shopify/react-native-skia|lottie-react-native|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|@sentry/react-native)" ], moduleNameMapper: { "\\.svg": "/ts/__mocks__/svgMock.js" diff --git a/jest.config.js b/jest.config.js index c5159278a31..79df8177e8f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,7 @@ module.exports = { preset: "react-native", transformIgnorePatterns: [ - "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@shopify/react-native-skia|lottie-react-native|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|uuid|@sentry/react-native)" + "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@shopify/react-native-skia|lottie-react-native|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|uuid|@sentry/react-native)" ], moduleNameMapper: { "\\.svg": "/ts/__mocks__/svgMock.js" diff --git a/jest.config.no.timezone.js b/jest.config.no.timezone.js index 900b0886bd1..afd55c07774 100644 --- a/jest.config.no.timezone.js +++ b/jest.config.no.timezone.js @@ -1,7 +1,7 @@ module.exports = { preset: "react-native", transformIgnorePatterns: [ - "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@shopify/react-native-skia|lottie-react-native|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|uuid|@sentry/react-native)" + "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@shopify/react-native-skia|lottie-react-native|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|uuid|@sentry/react-native)" ], moduleNameMapper: { "\\.svg": "/ts/__mocks__/svgMock.js" diff --git a/jestSetup.js b/jestSetup.js index 8ba76c541fa..bb6ff8384df 100644 --- a/jestSetup.js +++ b/jestSetup.js @@ -9,7 +9,6 @@ import mockClipboard from "@react-native-clipboard/clipboard/jest/clipboard-mock import nodeFetch from "node-fetch"; import { NativeModules, AccessibilityInfo } from "react-native"; import mockRNDeviceInfo from "react-native-device-info/jest/react-native-device-info-mock"; -import mockRNCameraRoll from "@react-native-camera-roll/camera-roll/src/__mocks__/nativeInterface"; import mockZendesk from "./ts/__mocks__/io-react-native-zendesk.ts"; import "react-native-get-random-values"; @@ -20,7 +19,6 @@ jest.mock("@react-native-community/push-notification-ios", () => jest.fn()); jest.mock("@react-native-cookies/cookies", () => jest.fn()); jest.mock("react-native-share", () => jest.fn()); jest.mock("@react-native-clipboard/clipboard", () => mockClipboard); -jest.mock("@react-native-camera-roll/camera-roll", () => mockRNCameraRoll); /** * adds as for documentation suggestion diff --git a/locales/de/index.yml b/locales/de/index.yml index ee4c153456c..e0cf2cb2aa0 100644 --- a/locales/de/index.yml +++ b/locales/de/index.yml @@ -2410,56 +2410,6 @@ features: title: "pagoPA Zahlungsaufforderungen" noticeCode: "Zahlungskodex" pay: "Zahlen" - euCovidCertificate: - save: - album: "IO" - noPermission: "Die IO-App hat vermutlich keine Berechtigung zum Speichern der Bilder. Bitte überprüfe deine Geräteeinstellungen." - ok: "Das Bild wurde auf deinem Smartphone gespeichert" - bottomSheet: - title: "Speichere das Zertifikat" - subTitle: "Auch ohne der IO-App und Internetverbindung kann das Zertifikat angezeigt werden." - saveAsImage: - title: "Bild in Galerie speichern" - subTitle: "Du findest den QR-Code auch als Bild auf deinem Smartphone." - listItem: - cta: "Anzeigen" - common: - title: "Grünes COVID-19-Zertifikat" - subtitle: "EU Digital COVID Certificate" - learnMore: "Erfahre mehr" - authorizationCode: "Autorisierungscode" - messageIdentifier: "Identifizierung der Nachricht" - loading: - title: "Herunterladen der Zertifikatsdaten von der nationalen Plattform des Gesundheitsministeriums" - subtitle: "Bitte warten" - valid: - accessibility: - qrCode: "QR-Code" - hint: "QR-Code als Vollbild anzeigen" - markdownDetails: - headerTitle: "Zertifikats-Details" - save: "Details speichern" - revoked: - title: "Dieses Zertifikat ist nicht mehr gültig" - expired: - title: "Dieses Zertifikat ist abgelaufen" - ko: - genericError: - title: "Deine Zertifikatsdaten konnten nicht abgerufen werden: Bitte versuche es erneut" - subtitle: "Dies kann ein vorübergehendes Problem sein." - notFound: - title: "Das Zertifikat existiert anscheinend nicht: Kontaktiere den Support" - subtitle: "Nützliche Informationen für den Support:" - cta: "Support kontaktieren" - notOperational: - title: "Das Grüne COVID-19-Zertifikat funktioniert derzeit nicht" - temporarilyNotAvailable: - title: "Der Dienst ist vorübergehend nicht verfügbar" - subtitle: "Bitte versuche es später erneut" - wrongFormat: - title: "Dieses Zertifikat kann nicht wiederhergestellt werden: Kontaktiere den Support" - subtitle: "Nützliche Informationen um Support zu erhalten:" - cta: "Support kontaktieren" pn: service: activate: "Aktiviere den Dienst" diff --git a/locales/en/index.yml b/locales/en/index.yml index 31eaa692c85..cb42670278c 100644 --- a/locales/en/index.yml +++ b/locales/en/index.yml @@ -2954,57 +2954,10 @@ features: title: "pagoPA notices" noticeCode: "Notice code" pay: "Pay" - euCovidCertificate: - save: - album: "IO" - noPermission: "It seems that the app does not have permissions to save images. Please check your device settings." - ok: "Image saved in your device gallery" - bottomSheet: - title: "Save the certificate" - subTitle: "You will be able to show the QR code of the certificate without opening IO app, even when you're offline." - saveAsImage: - title: "Save as an image in the gallery" - subTitle: "You will find the QR code in your device gallery" - listItem: - cta: "View" - common: - title: "Certificazione verde COVID-19" - subtitle: "EU Digital COVID Certificate" - learnMore: "Learn more" - authorizationCode: "Authorization code" - messageIdentifier: "Message identifier" - loading: - title: "We are loading your certificate data from the National Platform of the Ministry of Health" - subtitle: "Please wait" - valid: - accessibility: - qrCode: "QR Code" - hint: "Display the QR Code in full screen" - markdownDetails: - headerTitle: "Certificate Details" - save: "Save details" - revoked: - title: "This certificate is not valid" - expired: - title: "This certificate has expired" - ko: - genericError: - title: "Your certificate data could not be retrieved: please try again" - subtitle: "This could be due to a temporary problem." - notFound: - title: "It seems that the certificate does not \nexist: contact support" - subtitle: "Details to receive support:" - cta: "Get support" - notOperational: - title: "The EU Digital COVID Certificate is not currently operational" - subtitle: "TMP" - temporarilyNotAvailable: - title: "The service is temporarily unavailable" - subtitle: "Please try again later" - wrongFormat: - title: "This certificate cannot be retrieved" - subtitle: "Details to receive support:" - cta: "Get support" + greenPass: + button: "Indietro" + description: "Puoi accedere alla tua Certificazione verde COVID-19 dal Fascicolo Sanitario Elettronico o puoi chiedere una copia al medico di base." + title: "Questo servizio non è più attivo su IO" pn: service: activate: "Attiva il servizio" diff --git a/locales/it/index.yml b/locales/it/index.yml index e79963f19a2..35d12e7e0be 100644 --- a/locales/it/index.yml +++ b/locales/it/index.yml @@ -2954,57 +2954,10 @@ features: title: "Avvisi pagoPA" noticeCode: "Codice avviso" pay: "Paga" - euCovidCertificate: - save: - album: "IO" - noPermission: "Sembra che l'app non abbia i permessi per salvare immagini. Controlla le impostazioni del tuo dispositivo." - ok: "L'immagine è stata salvata nella galleria del tuo dispositivo" - bottomSheet: - title: "Salva il certificato" - subTitle: "Potrai mostrare il QR code del certificato senza aprire app IO, anche in assenza di connessione." - saveAsImage: - title: "Salva come immagine nella galleria" - subTitle: "Troverai il QR code fra le immagini presenti sul tuo dispositivo" - listItem: - cta: "Visualizza" - common: - title: "Certificazione verde COVID-19" - subtitle: "EU Digital COVID Certificate" - learnMore: "Per saperne di più" - authorizationCode: "Codice di autorizzazione" - messageIdentifier: "Identificativo del messaggio" - loading: - title: "Stiamo caricando i dati del tuo certificato dalla Piattaforma Nazionale del Ministero della Salute" - subtitle: "Attendi per favore" - valid: - accessibility: - qrCode: "QR Code" - hint: "Visualizza il QR Code a tutto schermo" - markdownDetails: - headerTitle: "Dettagli del certificato" - save: "Salva i dettagli" - revoked: - title: "Questo certificato \nnon è valido" - expired: - title: "Questo certificato è scaduto" - ko: - genericError: - title: "Non è stato possibile recuperare i dati del tuo certificato: riprova" - subtitle: "Potrebbe essere dovuto ad un problema temporaneo." - notFound: - title: "Sembra che il certificato non \nesista: contatta l’assistenza" - subtitle: "Dati utili per ricevere assistenza:" - cta: "Contatta l'assistenza" - notOperational: - title: "La Certificazione verde COVID-19 non è attualmente operativa" - subtitle: "TMP" - temporarilyNotAvailable: - title: "Il servizio è temporaneamente non disponibile" - subtitle: "Ti preghiamo di riprovare più tardi" - wrongFormat: - title: "Non è possibile recuperare questo \ncertificato: contatta l’assistenza" - subtitle: "Dati utili per ricevere assistenza:" - cta: "Contatta l'assistenza" + greenPass: + button: "Indietro" + description: "Puoi accedere alla tua Certificazione verde COVID-19 dal Fascicolo Sanitario Elettronico o puoi chiedere una copia al medico di base." + title: "Questo servizio non è più attivo su IO" pn: service: activate: "Attiva il servizio" diff --git a/package.json b/package.json index e4cfecf9b05..1c38b3bfad2 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "io_cgn_specs": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_cgn.yaml", "io_cgn_merchants_specs": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_cgn_operator_search.yaml", "api_fci": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_io_sign.yaml", - "io_eu_covid_cert": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_eucovidcert.yaml", "io_pn_specs": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_pn.yaml", "io_consumed_pn_specs": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/openapi/consumed/api-piattaforma-notifiche.yaml", "api_cdc": "assets/CdcSwagger.yml", @@ -68,7 +67,6 @@ "generate:api-session_manager_api-definitions": "rimraf definitions/session_manager && mkdir -p definitions/session_manager && gen-api-models --api-spec $npm_package_io_session_manager_public_api --out-dir ./definitions/session_manager && gen-api-models --api-spec $npm_package_io_session_manager_api --out-dir ./definitions/session_manager --no-strict --request-types --response-decoders --client", "generate:cgn-definitions": "rimraf definitions/cgn && mkdir -p definitions/cgn && gen-api-models --api-spec $npm_package_io_cgn_specs --out-dir ./definitions/cgn --no-strict --request-types --response-decoders", "generate:cgn-merchants-definitions": "rimraf definitions/cgn/merchants && mkdir -p definitions/cgn/merchants && gen-api-models --api-spec $npm_package_io_cgn_merchants_specs --out-dir ./definitions/cgn/merchants --no-strict --request-types --response-decoders", - "generate:eu-covid-cert": "rimraf definitions/eu_covid_cert && mkdir -p definitions/eu_covid_cert && gen-api-models --api-spec $npm_package_io_eu_covid_cert --out-dir ./definitions/eu_covid_cert --no-strict --request-types --response-decoders", "generate:pn-definitions": "rimraf definitions/pn && mkdir -p definitions/pn && gen-api-models --api-spec $npm_package_io_consumed_pn_specs --out-dir ./definitions/pn && gen-api-models --api-spec $npm_package_io_pn_specs --out-dir ./definitions/pn --no-strict --response-decoders --request-types --client", "generate:pagopa-api-walletv2": "rimraf definitions/pagopa/walletv2 && mkdir -p definitions/pagopa/walletv2 && gen-api-models --api-spec $npm_package_pagopa_api_walletv2 --out-dir ./definitions/pagopa/walletv2 --no-strict --request-types --response-decoders", "generate:pagopa-cobadge-configuration": "rimraf definitions/pagopa/cobadge/configuration && mkdir -p definitions/pagopa/cobadge/configuration && gen-api-models --api-spec $npm_package_pagopa_cobadge_configuration --out-dir ./definitions/pagopa/cobadge/configuration", @@ -124,7 +122,6 @@ "@pagopa/react-native-cie": "^1.3.0", "@pagopa/ts-commons": "^10.15.0", "@react-native-async-storage/async-storage": "^1.23.1", - "@react-native-camera-roll/camera-roll": "5.6.1", "@react-native-clipboard/clipboard": "^1.10.0", "@react-native-community/netinfo": "6.0.6", "@react-native-community/push-notification-ios": "^1.8.0", @@ -205,7 +202,6 @@ "react-native-svg": "^15.1.0", "react-native-tab-view": "3.5.2", "react-native-url-polyfill": "^2.0.0", - "react-native-view-shot": "3.1.2", "react-native-vision-camera": "4.3.1", "react-native-webview": "^13.10.3", "react-native-xml2js": "^1.0.3", diff --git a/scripts/api-config.json b/scripts/api-config.json index 0d2f6dc39be..5bc20519e63 100644 --- a/scripts/api-config.json +++ b/scripts/api-config.json @@ -15,7 +15,7 @@ "paymentWithValidDueDateCount": 1, "paymentWithExpiredDueDateCount": 1, "withCTA": true, - "withEUCovidCert": true, + "generateLegacyGreenPassMessage": true, "withValidDueDateCount": 1, "withInValidDueDateCount": 1, "standardMessageCount": 1, diff --git a/ts/components/__tests__/TosWebviewComponent.test.tsx b/ts/components/__tests__/TosWebviewComponent.test.tsx index e28741f2e30..d731c9c6c6d 100644 --- a/ts/components/__tests__/TosWebviewComponent.test.tsx +++ b/ts/components/__tests__/TosWebviewComponent.test.tsx @@ -13,7 +13,6 @@ import { SafeAreaProvider } from "react-native-safe-area-context"; import TosWebviewComponent from "../TosWebviewComponent"; import { FlowType } from "../../utils/analytics"; // import * as urlUtils from "../../../ts/utils/url"; -// import brokenLinkImage from "../../../img/broken-link.png"; beforeAll(() => { jest.resetAllMocks(); diff --git a/ts/components/screens/GenericErrorComponent.tsx b/ts/components/screens/GenericErrorComponent.tsx index 4edc2027b44..019105f27c8 100644 --- a/ts/components/screens/GenericErrorComponent.tsx +++ b/ts/components/screens/GenericErrorComponent.tsx @@ -2,6 +2,7 @@ import { Body, FooterWithButtons, H4, + Pictogram, VSpacer } from "@pagopa/io-app-design-system"; import { useFocusEffect } from "@react-navigation/native"; @@ -110,13 +111,11 @@ const GenericErrorComponent = (props: Props) => { > - + {props.image ? ( + + ) : ( + + )}

diff --git a/ts/config.ts b/ts/config.ts index 2b9ec058ce7..d3a61a44185 100644 --- a/ts/config.ts +++ b/ts/config.ts @@ -71,10 +71,6 @@ export const bonusApiUrlPrefix: string = Config.BONUS_API_URL_PREFIX; export const isPlaygroundsEnabled: boolean = Config.PLAYGROUNDS_ENABLED === "YES"; -// EU Covid Certificate feature flag -export const euCovidCertificateEnabled: boolean = - Config.EU_COVID_CERT_ENABLED === "YES"; - // Zendesk Feature Flag export const zendeskEnabled: boolean = Config.ZENDESK_ENABLED === "YES"; diff --git a/ts/features/bonus/cdc/components/CdcGenericError.tsx b/ts/features/bonus/cdc/components/CdcGenericError.tsx index c1c5eab6e22..7ec39dc3553 100644 --- a/ts/features/bonus/cdc/components/CdcGenericError.tsx +++ b/ts/features/bonus/cdc/components/CdcGenericError.tsx @@ -1,20 +1,12 @@ -import { FooterWithButtons } from "@pagopa/io-app-design-system"; import { useNavigation } from "@react-navigation/native"; import * as React from "react"; -import { SafeAreaView } from "react-native"; -import image from "../../../../../img/wallet/errors/generic-error-icon.png"; -import { IOStyles } from "../../../../components/core/variables/IOStyles"; -import { InfoScreenComponent } from "../../../../components/infoScreen/InfoScreenComponent"; -import { renderInfoRasterImage } from "../../../../components/infoScreen/imageRendering"; +import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent"; import I18n from "../../../../i18n"; import { AppParamsList, IOStackNavigationProp } from "../../../../navigation/params/AppParamsList"; -/** - ** @deprecated Use `OperationResultScreen` instead - * */ const CdcGenericError = () => { const navigation = useNavigation>(); @@ -23,31 +15,21 @@ const CdcGenericError = () => { }; return ( - <> - - - - - + ); }; diff --git a/ts/features/bonus/cdc/components/CdcRequestCompleted.tsx b/ts/features/bonus/cdc/components/CdcRequestCompleted.tsx index 42d55a6413b..2224f5c0ceb 100644 --- a/ts/features/bonus/cdc/components/CdcRequestCompleted.tsx +++ b/ts/features/bonus/cdc/components/CdcRequestCompleted.tsx @@ -1,20 +1,12 @@ -import { FooterWithButtons } from "@pagopa/io-app-design-system"; import { useNavigation } from "@react-navigation/native"; import * as React from "react"; -import { SafeAreaView } from "react-native"; -import image from "../../../../../img/pictograms/payment-completed.png"; -import { IOStyles } from "../../../../components/core/variables/IOStyles"; -import { InfoScreenComponent } from "../../../../components/infoScreen/InfoScreenComponent"; -import { renderInfoRasterImage } from "../../../../components/infoScreen/imageRendering"; +import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent"; import I18n from "../../../../i18n"; import { AppParamsList, IOStackNavigationProp } from "../../../../navigation/params/AppParamsList"; -/** - ** @deprecated Use `OperationResultScreen` instead - * */ const CdcRequestCompleted = () => { const navigation = useNavigation>(); @@ -22,35 +14,23 @@ const CdcRequestCompleted = () => { navigation.getParent()?.goBack(); }; return ( - <> - - - - - + ); }; diff --git a/ts/features/bonus/cdc/components/CdcRequestPartiallySuccess.tsx b/ts/features/bonus/cdc/components/CdcRequestPartiallySuccess.tsx index 68399ef222e..9fc67d1d301 100644 --- a/ts/features/bonus/cdc/components/CdcRequestPartiallySuccess.tsx +++ b/ts/features/bonus/cdc/components/CdcRequestPartiallySuccess.tsx @@ -1,13 +1,8 @@ -import { FooterWithButtons } from "@pagopa/io-app-design-system"; import { useNavigation } from "@react-navigation/native"; import * as React from "react"; -import { SafeAreaView } from "react-native"; import { Anno } from "../../../../../definitions/cdc/Anno"; -import image from "../../../../../img/wallet/errors/payment-unknown-icon.png"; import { isReady } from "../../../../common/model/RemoteValue"; -import { IOStyles } from "../../../../components/core/variables/IOStyles"; -import { InfoScreenComponent } from "../../../../components/infoScreen/InfoScreenComponent"; -import { renderInfoRasterImage } from "../../../../components/infoScreen/imageRendering"; +import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent"; import I18n from "../../../../i18n"; import { AppParamsList, @@ -97,33 +92,21 @@ const CdcRequestPartiallySuccess = () => { }, ""); return ( - <> - - - - - + ); }; diff --git a/ts/features/bonus/cdc/components/CdcWrongFormat.tsx b/ts/features/bonus/cdc/components/CdcWrongFormat.tsx index 66a0d83d1bc..e9d68748047 100644 --- a/ts/features/bonus/cdc/components/CdcWrongFormat.tsx +++ b/ts/features/bonus/cdc/components/CdcWrongFormat.tsx @@ -1,11 +1,6 @@ -import { FooterWithButtons } from "@pagopa/io-app-design-system"; import { useNavigation } from "@react-navigation/native"; import * as React from "react"; -import { SafeAreaView } from "react-native"; -import image from "../../../../../img/wallet/errors/generic-error-icon.png"; -import { IOStyles } from "../../../../components/core/variables/IOStyles"; -import { InfoScreenComponent } from "../../../../components/infoScreen/InfoScreenComponent"; -import { renderInfoRasterImage } from "../../../../components/infoScreen/imageRendering"; +import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent"; import I18n from "../../../../i18n"; import { AppParamsList, @@ -19,31 +14,21 @@ const CdcWrongFormat = () => { navigation.getParent()?.goBack(); }; return ( - <> - - - - - + ); }; diff --git a/ts/features/bonus/common/components/TosBonusComponent.tsx b/ts/features/bonus/common/components/TosBonusComponent.tsx index 8eb96b10a4a..f83524c64c7 100644 --- a/ts/features/bonus/common/components/TosBonusComponent.tsx +++ b/ts/features/bonus/common/components/TosBonusComponent.tsx @@ -4,19 +4,18 @@ import { FooterWithButtons, H2, IconButton, + Pictogram, VSpacer } from "@pagopa/io-app-design-system"; import * as React from "react"; import { BackHandler, - Image, SafeAreaView, ScrollView, StyleSheet, View } from "react-native"; import WebView from "react-native-webview"; -import brokenLinkImage from "../../../../../img/broken-link.png"; import { IOStyles } from "../../../../components/core/variables/IOStyles"; import { withLoadingSpinner } from "../../../../components/helpers/withLoadingSpinner"; import I18n from "../../../../i18n"; @@ -85,11 +84,7 @@ const TosBonusComponent: React.FunctionComponent = props => { } return ( - +

{I18n.t("onboarding.tos.error")}

diff --git a/ts/features/common/store/reducers/__tests__/__snapshots__/index.test.ts.snap b/ts/features/common/store/reducers/__tests__/__snapshots__/index.test.ts.snap index 02e39e410a1..5b05f98032c 100644 --- a/ts/features/common/store/reducers/__tests__/__snapshots__/index.test.ts.snap +++ b/ts/features/common/store/reducers/__tests__/__snapshots__/index.test.ts.snap @@ -2,9 +2,6 @@ exports[`featuresPersistor should match snapshot 1`] = ` { - "euCovidCert": { - "byAuthCode": {}, - }, "fci": { "documentPreview": { "kind": "PotNone", diff --git a/ts/features/common/store/reducers/index.ts b/ts/features/common/store/reducers/index.ts index 64b2a0bef08..b6604bf2cfc 100644 --- a/ts/features/common/store/reducers/index.ts +++ b/ts/features/common/store/reducers/index.ts @@ -10,10 +10,6 @@ import { CieLoginState, cieLoginPersistor } from "../../../cieLogin/store/reducers"; -import { - EuCovidCertState, - euCovidCertReducer -} from "../../../euCovidCert/store/reducers"; import { FastLoginState, fastLoginReducer @@ -70,7 +66,6 @@ type LoginFeaturesState = { }; export type FeaturesState = { - euCovidCert: EuCovidCertState; pn: PnState; fci: FciState; idPay: IDPayState; @@ -90,7 +85,6 @@ export type FeaturesState = { export type PersistedFeaturesState = FeaturesState & PersistPartial; const rootReducer = combineReducers({ - euCovidCert: euCovidCertReducer, pn: pnReducer, fci: fciReducer, idPay: idPayReducer, diff --git a/ts/features/design-system/core/DSLegacyPictograms.tsx b/ts/features/design-system/core/DSLegacyPictograms.tsx deleted file mode 100644 index 080958f8c43..00000000000 --- a/ts/features/design-system/core/DSLegacyPictograms.tsx +++ /dev/null @@ -1,163 +0,0 @@ -import { - H4, - IOPictograms, - IOPictogramsLegacy, - Pictogram, - VStack, - useIOTheme -} from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { StyleSheet, View } from "react-native"; -import { - DSAssetViewerBox, - assetItemGutter, - renderRasterImage -} from "../components/DSAssetViewerBox"; - -/* PICTOGRAMS */ -import BrokenLink from "../../../../img/broken-link.png"; -import PiggyBank from "../../../../img/messages/empty-transaction-list-icon.png"; -import Question from "../../../../img/pictograms/doubt.png"; -import CompletedRaster from "../../../../img/pictograms/payment-completed.png"; -import ABILogo from "../../../../img/wallet/cards-icons/abiLogoFallback.png"; -import Umbrella from "../../../../img/wallet/errors/generic-error-icon.png"; -import NotAvailable from "../../../../img/wallet/errors/payment-unavailable-icon.png"; -import Unrecognized from "../../../../img/wallet/errors/payment-unknown-icon.png"; -/* EU Covid Certificate */ -import CertificateExpired from "../../../../img/features/euCovidCert/certificate_expired.png"; -import CertificateNotFound from "../../../../img/features/euCovidCert/certificate_not_found.png"; -import CertificateRevoked from "../../../../img/features/euCovidCert/certificate_revoked.png"; -import CertificateWrongFormat from "../../../../img/features/euCovidCert/certificate_wrong_format.png"; -import Baloons from "../../../../img/messages/empty-due-date-list-icon.png"; -/* Sections */ -import { DesignSystemScreen } from "../components/DesignSystemScreen"; - -const styles = StyleSheet.create({ - itemsWrapper: { - flexDirection: "row", - flexWrap: "wrap", - justifyContent: "flex-start", - marginLeft: (assetItemGutter / 2) * -1, - marginRight: (assetItemGutter / 2) * -1, - rowGap: 16 - } -}); - -const sectionTitleMargin = 16; -const blockMargin = 48; - -export const DSLegacyPictograms = () => { - const theme = useIOTheme(); - - return ( - - - -

Vector

- {renderVectorPictograms()} -
- - -

Raster

- {renderRasterPictograms()} -
- - -

EU Covid Certificate

- {renderEUCovidCertificatePictograms()} -
-
-
- ); -}; - -const renderVectorPictograms = () => ( - - {Object.entries(IOPictogramsLegacy).map(([pictogramItemName]) => ( - - } - /> - ))} - -); - -const renderRasterPictograms = () => ( - - - - - - - - - - - -); - -const renderEUCovidCertificatePictograms = () => ( - - - - - - - {/* ↳ Duplicate of Question */} - -); diff --git a/ts/features/design-system/navigation/navigator.tsx b/ts/features/design-system/navigation/navigator.tsx index 9d98a75766a..094c1ea9fc3 100644 --- a/ts/features/design-system/navigation/navigator.tsx +++ b/ts/features/design-system/navigation/navigator.tsx @@ -56,7 +56,6 @@ import { DSLegacyAlert } from "../core/DSLegacyAlert"; import { DSLegacyBadges } from "../core/DSLegacyBadges"; import { DSLegacyButtons } from "../core/DSLegacyButtons"; import { DSLegacyListItems } from "../core/DSLegacyListItems"; -import { DSLegacyPictograms } from "../core/DSLegacyPictograms"; import { DSLegacyTextFields } from "../core/DSLegacyTextFields"; import { DSListItems } from "../core/DSListItems"; import { DSLoaders } from "../core/DSLoaders"; @@ -587,14 +586,6 @@ export const DesignSystemNavigator = () => { {/* LEGACY */} - - { - beforeAll(async () => { - await device.launchApp({ newInstance: true }); - await ensureLoggedIn(); - }); - - it("should find the expired EuCovidCert message, open it and check all the correct elements in the details page", async () => { - await openExpiredEUCovidMessage(); - - await waitFor(element(by.text(euCovidCertExpiredTitle))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - await waitFor(element(by.text(euCovidCertExpiredSubTitle))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - await waitFor(element(by.id(learnMoreLinkTestId))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - }); -}); - -const openExpiredEUCovidMessage = async () => { - await scrollToEUCovidMessage(euCovidCertExpiredSubject); - - const subject = element(by.text(euCovidCertExpiredSubject)); - await subject.tap(); -}; diff --git a/ts/features/euCovidCert/__e2e__/euCovidCertRevoked00.e2e.ts b/ts/features/euCovidCert/__e2e__/euCovidCertRevoked00.e2e.ts deleted file mode 100644 index d0a0e9cc314..00000000000 --- a/ts/features/euCovidCert/__e2e__/euCovidCertRevoked00.e2e.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { device } from "detox"; -import { ensureLoggedIn } from "../../../__e2e__/utils"; -import { e2eWaitRenderTimeout } from "../../../__e2e__/config"; -import { learnMoreLinkTestId, scrollToEUCovidMessage } from "./utils"; - -const euCovidCertRevokedSubject = "🏥 EUCovidCert - revoked"; -const euCovidCertRevokedTitle = "Revoked Certificate title"; -const euCovidCertRevokedSubTitle = "Revoked Certificate sub title"; - -describe("EuCovidCert Revoked", () => { - beforeAll(async () => { - await device.launchApp({ newInstance: true }); - await ensureLoggedIn(); - }); - - it("should find the revoked EuCovidCert message, open it and check all the correct elements in the details page", async () => { - await openRevokedEUCovidMessage(); - - await waitFor(element(by.text(euCovidCertRevokedTitle))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - await waitFor(element(by.text(euCovidCertRevokedSubTitle))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - await waitFor(element(by.id(learnMoreLinkTestId))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - }); -}); - -const openRevokedEUCovidMessage = async () => { - await scrollToEUCovidMessage(euCovidCertRevokedSubject); - - const subject = element(by.text(euCovidCertRevokedSubject)); - await subject.tap(); -}; diff --git a/ts/features/euCovidCert/__e2e__/euCovidCertValid00.e2e.ts b/ts/features/euCovidCert/__e2e__/euCovidCertValid00.e2e.ts deleted file mode 100644 index c76e0ebc284..00000000000 --- a/ts/features/euCovidCert/__e2e__/euCovidCertValid00.e2e.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { device } from "detox"; -import I18n from "../../../i18n"; -import { ensureLoggedIn } from "../../../__e2e__/utils"; -import { e2eWaitRenderTimeout } from "../../../__e2e__/config"; -import { openValidEUCovidMessage, qrCodeTestId } from "./utils"; - -const euCovidCertValidTitle = "Valid Certificate title"; -const euCovidCertValidSubTitle = "Valid Certificate sub title"; - -describe("EuCovidCert Valid", () => { - beforeAll(async () => { - await device.launchApp({ newInstance: true }); - await ensureLoggedIn(); - }); - - it("should find the valid EuCovidCert message, open it and check all the correct elements in the details page", async () => { - await openValidEUCovidMessage(); - - await waitFor(element(by.text(euCovidCertValidTitle))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - await waitFor(element(by.text(euCovidCertValidSubTitle))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - await waitFor(element(by.text(I18n.t("global.genericSave")))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - await waitFor(element(by.id(qrCodeTestId))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - }); -}); diff --git a/ts/features/euCovidCert/__e2e__/euCovidCertValid01.e2e.ts b/ts/features/euCovidCert/__e2e__/euCovidCertValid01.e2e.ts deleted file mode 100644 index b2d36406d8b..00000000000 --- a/ts/features/euCovidCert/__e2e__/euCovidCertValid01.e2e.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { device } from "detox"; -import I18n from "../../../i18n"; -import { e2eWaitRenderTimeout } from "../../../__e2e__/config"; -import { ensureLoggedIn } from "../../../__e2e__/utils"; -import { - fullScreenQrCodeTestId, - openValidEUCovidMessage, - qrCodeTestId -} from "./utils"; - -describe("EuCovidCert Valid", () => { - beforeAll(async () => { - await device.launchApp({ newInstance: true }); - await ensureLoggedIn(); - }); - - it("should open the QRCode in fullscreen and return back", async () => { - await openValidEUCovidMessage(); - - const qrCode = element(by.id(qrCodeTestId)); - await qrCode.tap(); - - await waitFor(element(by.id(fullScreenQrCodeTestId))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - await waitFor(element(by.text(I18n.t("global.buttons.close")))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - const closeButton = element(by.text(I18n.t("global.buttons.close"))); - await closeButton.tap(); - }); -}); diff --git a/ts/features/euCovidCert/__e2e__/euCovidCertValid02.e2e.ts b/ts/features/euCovidCert/__e2e__/euCovidCertValid02.e2e.ts deleted file mode 100644 index 964a37c6645..00000000000 --- a/ts/features/euCovidCert/__e2e__/euCovidCertValid02.e2e.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { device } from "detox"; -import I18n from "../../../i18n"; -import { e2eWaitRenderTimeout } from "../../../__e2e__/config"; -import { ensureLoggedIn } from "../../../__e2e__/utils"; -import { openValidEUCovidMessage } from "./utils"; - -describe("EuCovidCert Valid", () => { - beforeAll(async () => { - await device.launchApp({ newInstance: true }); - await ensureLoggedIn(); - }); - - it("should open the certificate details page and return back", async () => { - await openValidEUCovidMessage(); - - await waitFor(element(by.text(I18n.t("global.buttons.details")))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - const detailsButton = element(by.text(I18n.t("global.buttons.details"))); - await detailsButton.tap(); - - await waitFor(element(by.text(I18n.t("global.buttons.close")))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - const closeButton = element(by.text(I18n.t("global.buttons.close"))); - await closeButton.tap(); - }); -}); diff --git a/ts/features/euCovidCert/__e2e__/euCovidCertValid03.e2e.ts b/ts/features/euCovidCert/__e2e__/euCovidCertValid03.e2e.ts deleted file mode 100644 index 493ec46b041..00000000000 --- a/ts/features/euCovidCert/__e2e__/euCovidCertValid03.e2e.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { device } from "detox"; -import I18n from "../../../i18n"; -import { e2eWaitRenderTimeout } from "../../../__e2e__/config"; -import { ensureLoggedIn } from "../../../__e2e__/utils"; -import { openValidEUCovidMessage } from "./utils"; - -describe("EuCovidCert Valid", () => { - beforeAll(async () => { - await device.launchApp({ newInstance: true }); - await ensureLoggedIn(); - }); - - it("should save the certificate in the gallery", async () => { - await openValidEUCovidMessage(); - - await waitFor(element(by.text(I18n.t("global.genericSave")))) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - const saveButton = element(by.text(I18n.t("global.genericSave"))); - await saveButton.tap(); - - await waitFor( - element( - by.text( - I18n.t( - "features.euCovidCertificate.save.bottomSheet.saveAsImage.title" - ) - ) - ) - ) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - - const saveIntoGalleryButton = element( - by.text( - I18n.t("features.euCovidCertificate.save.bottomSheet.saveAsImage.title") - ) - ); - await saveIntoGalleryButton.tap(); - - await waitFor( - element(by.text(I18n.t("features.euCovidCertificate.save.ok"))) - ) - .toBeVisible() - .withTimeout(e2eWaitRenderTimeout); - }); -}); diff --git a/ts/features/euCovidCert/__e2e__/utils.ts b/ts/features/euCovidCert/__e2e__/utils.ts deleted file mode 100644 index 759fde03a09..00000000000 --- a/ts/features/euCovidCert/__e2e__/utils.ts +++ /dev/null @@ -1,20 +0,0 @@ -const euCovidCertValidSubject = "🏥 EUCovidCert - valid"; - -export const learnMoreLinkTestId = "euCovidCertLearnMoreLink"; -export const messageListTestId = "MessageList_inbox"; -export const qrCodeTestId = "QRCode"; -export const fullScreenQrCodeTestId = "fullScreenQRCode"; - -export const scrollToEUCovidMessage = async (messageSubject: string) => { - await waitFor(element(by.text(messageSubject))) - .toBeVisible() - .whileElement(by.id(messageListTestId)) - .scroll(350, "down"); -}; - -export const openValidEUCovidMessage = async () => { - await scrollToEUCovidMessage(euCovidCertValidSubject); - - const subject = element(by.text(euCovidCertValidSubject)); - await subject.tap(); -}; diff --git a/ts/features/euCovidCert/analytics/index.ts b/ts/features/euCovidCert/analytics/index.ts deleted file mode 100644 index 748c6a73eb6..00000000000 --- a/ts/features/euCovidCert/analytics/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { getType } from "typesafe-actions"; -import { constVoid } from "fp-ts/lib/function"; -import { euCovidCertificateEnabled } from "../../../config"; -import { mixpanel } from "../../../mixpanel"; -import { Action } from "../../../store/actions/types"; -import { getNetworkErrorMessage } from "../../../utils/errors"; -import { euCovidCertificateGet } from "../store/actions"; -import { - EUCovidCertificateResponse, - isEuCovidCertificateSuccessResponse -} from "../types/EUCovidCertificateResponse"; - -const trackEuCovidCertificateActions = - (mp: NonNullable) => - (action: Action): void => { - switch (action.type) { - case getType(euCovidCertificateGet.request): - return mp.track(action.type); - case getType(euCovidCertificateGet.success): - return mp.track( - action.type, - trackEuCovidCertificateGetSuccessResponse(action.payload) - ); - case getType(euCovidCertificateGet.failure): - return mp.track(action.type, { - reason: getNetworkErrorMessage(action.payload) - }); - } - }; - -const trackEuCovidCertificateGetSuccessResponse = ( - response: EUCovidCertificateResponse -): Record => { - if (!isEuCovidCertificateSuccessResponse(response)) { - return { - containsInfo: false, - containsDetails: false, - qrCodeLength: undefined - }; - } - const containsInfo = response.value.markdownInfo !== undefined; - const containsDetails = - response.value.kind === "valid" - ? response.value.markdownDetails !== undefined - : false; - const qrCodeLength = - response.value.kind === "valid" - ? response.value.qrCode.content.length - : undefined; - return { - containsInfo, - containsDetails, - qrCodeLength - }; -}; - -const emptyTracking = (_: NonNullable) => (__: Action) => - constVoid(); - -export default euCovidCertificateEnabled - ? trackEuCovidCertificateActions - : emptyTracking; diff --git a/ts/features/euCovidCert/api/backendEuCovidCert.ts b/ts/features/euCovidCert/api/backendEuCovidCert.ts deleted file mode 100644 index 8da836104c8..00000000000 --- a/ts/features/euCovidCert/api/backendEuCovidCert.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { - ApiHeaderJson, - composeHeaderProducers, - createFetchRequestForApi -} from "@pagopa/ts-commons/lib/requests"; -import { - getCertificateDefaultDecoder, - GetCertificateT -} from "../../../../definitions/eu_covid_cert/requestTypes"; -import { SessionToken } from "../../../types/SessionToken"; -import { - tokenHeaderProducer, - withBearerToken as withToken -} from "../../../utils/api"; -import { defaultRetryingFetch } from "../../../utils/fetch"; - -const getCertificate: GetCertificateT = { - method: "post", - url: () => "/api/v1/eucovidcert/certificate", - headers: composeHeaderProducers(tokenHeaderProducer, ApiHeaderJson), - query: _ => ({}), - body: p => JSON.stringify({ accessData: p.accessData }), - response_decoder: getCertificateDefaultDecoder() -}; - -// client for eu covid to handle API communications -export const BackendEuCovidCertClient = ( - baseUrl: string, - token: SessionToken, - fetchApi: typeof fetch = defaultRetryingFetch() -) => { - const options = { - baseUrl, - fetchApi - }; - const withBearerToken = withToken(token); - return { - getCertificate: withBearerToken( - createFetchRequestForApi(getCertificate, options) - ) - }; -}; diff --git a/ts/features/euCovidCert/components/EUCovidContext.tsx b/ts/features/euCovidCert/components/EUCovidContext.tsx deleted file mode 100644 index a20b1437e9f..00000000000 --- a/ts/features/euCovidCert/components/EUCovidContext.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -import { EuCovidCertificateRouterScreenNavigationParams } from "../screens/EuCovidCertificateRouterScreen"; - -export const EUCovidContext = - React.createContext( - null - ); diff --git a/ts/features/euCovidCert/components/EuCovidCertHeader.tsx b/ts/features/euCovidCert/components/EuCovidCertHeader.tsx deleted file mode 100644 index 47eeb6edae8..00000000000 --- a/ts/features/euCovidCert/components/EuCovidCertHeader.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import * as React from "react"; -import { Image, StyleSheet, View } from "react-native"; -import { H3, H4 } from "@pagopa/io-app-design-system"; -import { isStringNullyOrEmpty } from "../../../utils/strings"; -import { WithEUCovidCertificateHeaderData } from "../types/EUCovidCertificate"; - -const styles = StyleSheet.create({ - row: { - flexDirection: "row", - justifyContent: "space-between" - }, - column: { flexDirection: "column", flex: 1 }, - logo: { - width: 84, - height: 84 - } -}); - -/** - * header with - * | title | logo | - * | subtitle | | - * @param props - * @constructor - */ -export const EuCovidCertHeader = (props: WithEUCovidCertificateHeaderData) => ( - <> - - -

{props.headerData.title}

-

- {props.headerData.subTitle} -

-
- {/* it could happen we don't want to show any logo, in that case url will be empty */} - {!isStringNullyOrEmpty(props.headerData.logoUrl) && ( - - )} -
- -); diff --git a/ts/features/euCovidCert/components/EuCovidCertLearnMoreLink.tsx b/ts/features/euCovidCert/components/EuCovidCertLearnMoreLink.tsx deleted file mode 100644 index dfd60441def..00000000000 --- a/ts/features/euCovidCert/components/EuCovidCertLearnMoreLink.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from "react"; -import { ButtonLink } from "@pagopa/io-app-design-system"; -import { StyleSheet, View } from "react-native"; -import I18n from "../../../i18n"; -import { euCovidCertificateUrl } from "../../../urls"; -import { openWebUrl } from "../../../utils/url"; - -const styles = StyleSheet.create({ - container: { - alignItems: "center" - } -}); - -export const EuCovidCertLearnMoreLink = (): React.ReactElement => ( - - - openWebUrl(euCovidCertificateUrl)} - testID="euCovidCertLearnMoreLink" - /> - - -); diff --git a/ts/features/euCovidCert/components/FlashAnimatedComponent.tsx b/ts/features/euCovidCert/components/FlashAnimatedComponent.tsx deleted file mode 100644 index ae792776416..00000000000 --- a/ts/features/euCovidCert/components/FlashAnimatedComponent.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import { Millisecond } from "@pagopa/ts-commons/lib/units"; -import * as React from "react"; -import { useCallback } from "react"; -import { Animated, Easing, StyleSheet } from "react-native"; -import { hexToRgba, IOColors } from "@pagopa/io-app-design-system"; - -const whiteBgTransparent = hexToRgba(IOColors.white, 0); -const whiteBg = hexToRgba(IOColors.white, 1); -const defaultAnimationDuration = 240 as Millisecond; -export type FlashAnimationState = "fadeIn" | "fadeOut" | undefined; - -const styles = StyleSheet.create({ - hover: { - minWidth: "100%", - minHeight: "100%", - bottom: 0, - left: 0, - top: 0, - position: "absolute", - alignItems: "center", - justifyContent: "center" - } -}); -type Props = { - state: FlashAnimationState; - animationDuration?: Millisecond; - onFadeInCompleted?: () => void; - onFadeOutCompleted?: () => void; -}; - -/* an overlay animated view. it is used when screenshot is captured, to simulate flash effect */ -export const FlashAnimatedComponent = (props: Props) => { - const backgroundAnimation = React.useRef(new Animated.Value(0)).current; - const animation = React.useRef(); - const backgroundInterpolation = backgroundAnimation.interpolate({ - inputRange: [0, 1], - outputRange: [whiteBgTransparent, whiteBg] - }); - const { state, onFadeInCompleted, onFadeOutCompleted, animationDuration } = - props; - - const fadeOut = useCallback(() => { - animation.current?.stop(); - // eslint-disable-next-line functional/immutable-data - animation.current = Animated.timing(backgroundAnimation, { - duration: animationDuration ?? defaultAnimationDuration, - toValue: 0, - useNativeDriver: false, - easing: Easing.cubic - }); - animation.current.start(() => onFadeOutCompleted?.()); - }, [animationDuration, backgroundAnimation, onFadeOutCompleted]); - - const fadeIn = useCallback(() => { - animation.current?.stop(); - // eslint-disable-next-line functional/immutable-data - animation.current = Animated.timing(backgroundAnimation, { - duration: animationDuration ?? defaultAnimationDuration, - toValue: 1, - useNativeDriver: false, - easing: Easing.cubic - }); - animation.current.start(() => onFadeInCompleted?.()); - }, [backgroundAnimation, onFadeInCompleted, animationDuration]); - - React.useEffect(() => { - if (state) { - switch (state) { - case "fadeIn": - fadeIn(); - break; - case "fadeOut": - fadeOut(); - break; - } - } - return () => { - animation.current?.stop(); - }; - }, [state, fadeIn, fadeOut]); - return ( - - ); -}; diff --git a/ts/features/euCovidCert/components/MarkdownHandleCustomLink.tsx b/ts/features/euCovidCert/components/MarkdownHandleCustomLink.tsx deleted file mode 100644 index 6e7240e74fd..00000000000 --- a/ts/features/euCovidCert/components/MarkdownHandleCustomLink.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import * as E from "fp-ts/lib/Either"; -import { pipe } from "fp-ts/lib/function"; -import * as React from "react"; -import { useIOToast } from "@pagopa/io-app-design-system"; -import { deriveCustomHandledLink } from "../../../components/ui/Markdown/handlers/link"; -import I18n from "../../../i18n"; -import { clipboardSetStringWithFeedback } from "../../../utils/clipboard"; -import { taskLinking } from "../../../utils/url"; -import { Markdown } from "../../../components/ui/Markdown/Markdown"; - -export const MarkdownHandleCustomLink = ( - props: React.ComponentProps -): React.ReactElement => { - const toast = useIOToast(); - return ( - { - pipe( - deriveCustomHandledLink(link), - E.map(hl => { - if (hl.schema === "copy") { - clipboardSetStringWithFeedback(hl.value); - return; - } - taskLinking(hl.url)().catch(_ => - toast.error(I18n.t("global.genericError")) - ); - }) - ); - }} - > - {props.children} - - ); -}; diff --git a/ts/features/euCovidCert/components/__test__/EuCovidCertHeader.test.tsx b/ts/features/euCovidCert/components/__test__/EuCovidCertHeader.test.tsx deleted file mode 100644 index 6cb63e4eb3f..00000000000 --- a/ts/features/euCovidCert/components/__test__/EuCovidCertHeader.test.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { render } from "@testing-library/react-native"; -import React from "react"; -import { EuCovidCertHeader } from "../EuCovidCertHeader"; - -const headerData = { - title: "title", - subTitle: "subtitle", - logoUrl: "logoUrl" -}; -describe("EuCovidCertHeader", () => { - it(`it should match the snapshot`, () => { - const component = render(); - expect(component).toMatchSnapshot(); - }); -}); - -describe("when the headerData is full filled", () => { - it(`it should show the title, subtitle and logo`, () => { - const component = render(); - expect(component.queryByText(headerData.title)).not.toBeNull(); - expect(component.queryByText(headerData.subTitle)).not.toBeNull(); - expect(component.queryByTestId("EuCovidCertHeaderLogoID")).not.toBeNull(); - }); -}); - -describe("when title and subtitle are empty", () => { - it(`it should show the title, subtitle and the logo`, () => { - const component = render( - - ); - expect(component.queryByTestId("EuCovidCertHeaderTitle")).not.toBeNull(); - expect(component.queryByTestId("EuCovidCertHeaderSubTitle")).not.toBeNull(); - expect(component.queryByTestId("EuCovidCertHeaderLogoID")).not.toBeNull(); - }); -}); - -describe("when the logo url is empty", () => { - it(`it should show the title, subtitle and not the logo`, () => { - const component = render( - - ); - expect(component.queryByText(headerData.title)).not.toBeNull(); - expect(component.queryByText(headerData.subTitle)).not.toBeNull(); - expect(component.queryByTestId("EuCovidCertHeaderLogoID")).toBeNull(); - }); -}); - -describe("when the logo url is filled with blank spaces", () => { - it(`it should show the title, subtitle and not the logo`, () => { - const component = render( - - ); - expect(component.queryByText(headerData.title)).not.toBeNull(); - expect(component.queryByText(headerData.subTitle)).not.toBeNull(); - expect(component.queryByTestId("EuCovidCertHeaderLogoID")).toBeNull(); - }); -}); diff --git a/ts/features/euCovidCert/components/__test__/__snapshots__/EuCovidCertHeader.test.tsx.snap b/ts/features/euCovidCert/components/__test__/__snapshots__/EuCovidCertHeader.test.tsx.snap deleted file mode 100644 index 81dddce39ed..00000000000 --- a/ts/features/euCovidCert/components/__test__/__snapshots__/EuCovidCertHeader.test.tsx.snap +++ /dev/null @@ -1,82 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`EuCovidCertHeader it should match the snapshot 1`] = ` - - - - title - - - subtitle - - - - -`; diff --git a/ts/features/euCovidCert/navigation/actions.ts b/ts/features/euCovidCert/navigation/actions.ts deleted file mode 100644 index 284a7b7eb37..00000000000 --- a/ts/features/euCovidCert/navigation/actions.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { CommonActions } from "@react-navigation/native"; -import NavigationService from "../../../navigation/NavigationService"; -import { EuCovidCertificateRouterScreenNavigationParams } from "../screens/EuCovidCertificateRouterScreen"; -import { EuCovidCertMarkdownDetailsScreenNavigationParams } from "../screens/valid/EuCovidCertMarkdownDetailsScreen"; -import { EuCovidCertQrCodeFullScreenNavigationParams } from "../screens/valid/EuCovidCertQrCodeFullScreen"; -import { MESSAGES_ROUTES } from "../../messages/navigation/routes"; -import EUCOVIDCERT_ROUTES from "./routes"; - -/** - * @deprecated Do not use this method when you have access to a navigation prop or useNavigation since it will behave differently, - * and many helper methods specific to screens won't be available. - */ -export const navigateToEuCovidCertificateDetailScreen = ( - params: EuCovidCertificateRouterScreenNavigationParams -) => - NavigationService.dispatchNavigationAction( - CommonActions.navigate(MESSAGES_ROUTES.MESSAGES_NAVIGATOR, { - screen: EUCOVIDCERT_ROUTES.MAIN, - params: { - screen: EUCOVIDCERT_ROUTES.CERTIFICATE, - params - } - }) - ); - -/** - * @deprecated Do not use this method when you have access to a navigation prop or useNavigation since it will behave differently, - * and many helper methods specific to screens won't be available. - */ -export const navigateToEuCovidCertificateQrCodeFullScreen = ( - params: EuCovidCertQrCodeFullScreenNavigationParams -) => - NavigationService.dispatchNavigationAction( - CommonActions.navigate(MESSAGES_ROUTES.MESSAGES_NAVIGATOR, { - screen: EUCOVIDCERT_ROUTES.MAIN, - params: { - screen: EUCOVIDCERT_ROUTES.QRCODE, - params - } - }) - ); - -/** - * @deprecated Do not use this method when you have access to a navigation prop or useNavigation since it will behave differently, - * and many helper methods specific to screens won't be available. - */ -export const navigateToEuCovidCertificateMarkdownDetailsScreen = ( - params: EuCovidCertMarkdownDetailsScreenNavigationParams -) => - NavigationService.dispatchNavigationAction( - CommonActions.navigate(MESSAGES_ROUTES.MESSAGES_NAVIGATOR, { - screen: EUCOVIDCERT_ROUTES.MAIN, - params: { - screen: EUCOVIDCERT_ROUTES.MARKDOWN_DETAILS, - params - } - }) - ); diff --git a/ts/features/euCovidCert/navigation/navigator.tsx b/ts/features/euCovidCert/navigation/navigator.tsx deleted file mode 100644 index bbf1f8d9406..00000000000 --- a/ts/features/euCovidCert/navigation/navigator.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { createStackNavigator } from "@react-navigation/stack"; -import * as React from "react"; -import { EuCovidCertificateRouterScreen } from "../screens/EuCovidCertificateRouterScreen"; -import { EuCovidCertMarkdownDetailsScreen } from "../screens/valid/EuCovidCertMarkdownDetailsScreen"; -import { EuCovidCertQrCodeFullScreen } from "../screens/valid/EuCovidCertQrCodeFullScreen"; -import { EUCovidCertParamsList } from "./params"; -import EUCOVIDCERT_ROUTES from "./routes"; - -const Stack = createStackNavigator(); - -export const EUCovidCertStackNavigator = () => ( - - - - - -); diff --git a/ts/features/euCovidCert/navigation/params.ts b/ts/features/euCovidCert/navigation/params.ts deleted file mode 100644 index 7478915af0d..00000000000 --- a/ts/features/euCovidCert/navigation/params.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { EuCovidCertificateRouterScreenNavigationParams } from "../screens/EuCovidCertificateRouterScreen"; -import { EuCovidCertMarkdownDetailsScreenNavigationParams } from "../screens/valid/EuCovidCertMarkdownDetailsScreen"; -import { EuCovidCertQrCodeFullScreenNavigationParams } from "../screens/valid/EuCovidCertQrCodeFullScreen"; -import EUCOVIDCERT_ROUTES from "./routes"; - -export type EUCovidCertParamsList = { - [EUCOVIDCERT_ROUTES.CERTIFICATE]: EuCovidCertificateRouterScreenNavigationParams; - [EUCOVIDCERT_ROUTES.QRCODE]: EuCovidCertQrCodeFullScreenNavigationParams; - [EUCOVIDCERT_ROUTES.MARKDOWN_DETAILS]: EuCovidCertMarkdownDetailsScreenNavigationParams; -}; diff --git a/ts/features/euCovidCert/navigation/routes.ts b/ts/features/euCovidCert/navigation/routes.ts deleted file mode 100644 index 3fdf9dca090..00000000000 --- a/ts/features/euCovidCert/navigation/routes.ts +++ /dev/null @@ -1,8 +0,0 @@ -const EUCOVIDCERT_ROUTES = { - MAIN: "EUCOVIDCERT_ROUTES_MAIN", - CERTIFICATE: "EUCOVIDCERT_CERTIFICATE", - QRCODE: "EUCOVIDCERT_QRCODE", - MARKDOWN_DETAILS: "EUCOVIDCERT_MARKDOWN_DETAILS" -} as const; - -export default EUCOVIDCERT_ROUTES; diff --git a/ts/features/euCovidCert/saga/index.ts b/ts/features/euCovidCert/saga/index.ts deleted file mode 100644 index 63c622f13a4..00000000000 --- a/ts/features/euCovidCert/saga/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { SagaIterator } from "redux-saga"; -import { call, takeLatest } from "typed-redux-saga/macro"; -import { ActionType } from "typesafe-actions"; -import { euCovidCertificateGet } from "../store/actions"; -import { BackendEuCovidCertClient } from "../api/backendEuCovidCert"; -import { apiUrlPrefix } from "../../../config"; -import { SessionToken } from "../../../types/SessionToken"; -import { waitBackoffError } from "../../../utils/backoffError"; -import { handleGetEuCovidCertificate } from "./networking/handleGetEuCovidCertificate"; - -/** - * Handle the EU Covid Certificate requests - * @param bearerToken - */ -export function* watchEUCovidCertificateSaga( - bearerToken: SessionToken -): SagaIterator { - const euCovidCertClient = BackendEuCovidCertClient(apiUrlPrefix, bearerToken); - - // handle the request of getting eu covid cert - yield* takeLatest( - euCovidCertificateGet.request, - function* (action: ActionType) { - // wait backoff time if there were previous errors - yield* call(waitBackoffError, euCovidCertificateGet.failure); - yield* call( - handleGetEuCovidCertificate, - euCovidCertClient.getCertificate, - action - ); - } - ); -} diff --git a/ts/features/euCovidCert/saga/networking/handleGetEuCovidCertificate.ts b/ts/features/euCovidCert/saga/networking/handleGetEuCovidCertificate.ts deleted file mode 100644 index a44eff453a5..00000000000 --- a/ts/features/euCovidCert/saga/networking/handleGetEuCovidCertificate.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as pot from "@pagopa/ts-commons/lib/pot"; -import * as E from "fp-ts/lib/Either"; -import { pipe } from "fp-ts/lib/function"; -import * as O from "fp-ts/lib/Option"; -import { call, put, select } from "typed-redux-saga/macro"; -import { ActionType } from "typesafe-actions"; -import { PreferredLanguageEnum } from "../../../../../definitions/backend/PreferredLanguage"; -import { Certificate } from "../../../../../definitions/eu_covid_cert/Certificate"; -import { HeaderInfo } from "../../../../../definitions/eu_covid_cert/HeaderInfo"; -import { contentRepoUrl } from "../../../../config"; -import { mixpanelTrack } from "../../../../mixpanel"; -import { profileSelector } from "../../../../store/reducers/profile"; -import { SagaCallReturnType } from "../../../../types/utils"; -import { getGenericError, getNetworkError } from "../../../../utils/errors"; -import { readablePrivacyReport } from "../../../../utils/reporters"; -import { BackendEuCovidCertClient } from "../../api/backendEuCovidCert"; -import { euCovidCertificateGet } from "../../store/actions"; -import { - EUCovidCertificate, - EUCovidCertificateAuthCode -} from "../../types/EUCovidCertificate"; -import { - EUCovidCertificateResponse, - EUCovidCertificateResponseFailure -} from "../../types/EUCovidCertificateResponse"; - -const mapKinds: Record = { - 400: "wrongFormat", - 403: "notFound", - 410: "notOperational", - 504: "temporarilyNotAvailable" -}; - -export const convertHeaderInfo = ( - headerInfo: HeaderInfo -): EUCovidCertificate["headerData"] => ({ - title: headerInfo.title, - subTitle: headerInfo.subtitle, - logoUrl: `${contentRepoUrl}/logos/eucovidcert/${headerInfo.logo_id}.png` -}); - -// convert a success response to the logical app representation of it -const convertSuccess = ( - certificate: Certificate, - authCode: EUCovidCertificateAuthCode -): EUCovidCertificateResponse => { - const getCertificate = (): EUCovidCertificate | undefined => { - switch (certificate.status) { - case "valid": - return { - kind: "valid", - id: certificate.uvci as EUCovidCertificate["id"], - qrCode: { - mimeType: certificate.qr_code.mime_type, - content: certificate.qr_code.content - }, - markdownInfo: certificate.info, - markdownDetails: certificate.detail, - headerData: convertHeaderInfo(certificate.header_info) - }; - case "revoked": - return { - kind: "revoked", - id: certificate.uvci as EUCovidCertificate["id"], - revokedOn: certificate.revoked_on, - markdownInfo: certificate.info, - headerData: convertHeaderInfo(certificate.header_info) - }; - case "expired": - return { - kind: "expired", - id: certificate.uvci as EUCovidCertificate["id"], - markdownInfo: certificate.info, - headerData: convertHeaderInfo(certificate.header_info) - }; - default: - return undefined; - } - }; - return pipe( - getCertificate(), - O.fromNullable, - O.foldW( - () => { - // track the conversion failure - void mixpanelTrack("EUCOVIDCERT_CONVERT_SUCCESS_ERROR", { - status: certificate.status - }); - return { kind: "wrongFormat", authCode }; - }, - value => ({ kind: "success", value, authCode }) - ) - ); -}; - -/** - * Handle the remote call to retrieve the certificate data - * @param getCertificate - * @param action - */ -export function* handleGetEuCovidCertificate( - getCertificate: ReturnType["getCertificate"], - action: ActionType -) { - const authCode = action.payload; - - const profile: ReturnType = yield* select( - profileSelector - ); - - try { - const getCertificateResult: SagaCallReturnType = - yield* call(getCertificate, { - accessData: { - auth_code: authCode, - preferred_languages: pot.getOrElse( - pot.mapNullable(profile, p => p.preferred_languages), - [PreferredLanguageEnum.it_IT] - ) - } - }); - if (E.isRight(getCertificateResult)) { - if (getCertificateResult.right.status === 200) { - // handled success - yield* put( - euCovidCertificateGet.success( - convertSuccess(getCertificateResult.right.value, authCode) - ) - ); - return; - } - if (mapKinds[getCertificateResult.right.status] !== undefined) { - yield* put( - euCovidCertificateGet.success({ - kind: mapKinds[getCertificateResult.right.status], - authCode - }) - ); - return; - } - // not handled error codes - yield* put( - euCovidCertificateGet.failure({ - ...getGenericError( - new Error( - `response status code ${getCertificateResult.right.status}` - ) - ), - authCode - }) - ); - } else { - // cannot decode response - yield* put( - euCovidCertificateGet.failure({ - ...getGenericError( - new Error(readablePrivacyReport(getCertificateResult.left)) - ), - authCode - }) - ); - } - } catch (e) { - yield* put( - euCovidCertificateGet.failure({ ...getNetworkError(e), authCode }) - ); - } -} diff --git a/ts/features/euCovidCert/saga/orchestration/placeholder b/ts/features/euCovidCert/saga/orchestration/placeholder deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/ts/features/euCovidCert/screens/BaseEuCovidCertificateLayout.tsx b/ts/features/euCovidCert/screens/BaseEuCovidCertificateLayout.tsx deleted file mode 100644 index 8b6d7aba07b..00000000000 --- a/ts/features/euCovidCert/screens/BaseEuCovidCertificateLayout.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { useFocusEffect } from "@react-navigation/native"; -import * as React from "react"; -import { useRef } from "react"; -import { ScrollView, StyleSheet, View } from "react-native"; -import { heightPercentageToDP } from "react-native-responsive-screen"; -import SectionStatusComponent from "../../../components/SectionStatus"; -import { IOStyles } from "../../../components/core/variables/IOStyles"; -import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel"; -import { WithTestID } from "../../../types/WithTestID"; -import { setAccessibilityFocus } from "../../../utils/accessibility"; - -type Props = WithTestID<{ - header?: React.ReactElement; - content: React.ReactElement; - footer?: React.ReactElement; -}>; - -const styles = StyleSheet.create({ - emptyHeader: { - flex: 1, - height: heightPercentageToDP("10%") - } -}); - -export const BaseEuCovidCertificateLayout = ({ - testID, - header, - content, - footer -}: Props) => { - const elementRef = useRef(null); - - useHeaderSecondLevel({ - supportRequest: true, - title: "" - }); - - useFocusEffect( - React.useCallback(() => { - setAccessibilityFocus(elementRef); - }, []) - ); - - return ( - <> - - {/* if the header is not defined put an empty header that works as a spacer - (design directions, to avoid content too close with the top of the screen) */} - {header ?? } - {content} - - - {footer} - - ); -}; diff --git a/ts/features/euCovidCert/screens/EuCovidCertExpiredScreen.tsx b/ts/features/euCovidCert/screens/EuCovidCertExpiredScreen.tsx deleted file mode 100644 index 56600980c90..00000000000 --- a/ts/features/euCovidCert/screens/EuCovidCertExpiredScreen.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { VSpacer } from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { Image } from "react-native"; -import expiredImage from "../../../../img/features/euCovidCert/certificate_expired.png"; -import { InfoScreenComponent } from "../../../components/infoScreen/InfoScreenComponent"; -import I18n from "../../../i18n"; -import { EuCovidCertHeader } from "../components/EuCovidCertHeader"; -import { EuCovidCertLearnMoreLink } from "../components/EuCovidCertLearnMoreLink"; -import { MarkdownHandleCustomLink } from "../components/MarkdownHandleCustomLink"; -import { WithEUCovidCertificateHeaderData } from "../types/EUCovidCertificate"; -import { BaseEuCovidCertificateLayout } from "./BaseEuCovidCertificateLayout"; - -type Props = { - expiredInfo?: string; -} & WithEUCovidCertificateHeaderData; - -const EuCovidCertExpiredContentComponent = (props: Props) => ( - <> - - - - } - title={I18n.t("features.euCovidCertificate.expired.title")} - body={} - /> - - {props.expiredInfo && ( - - {props.expiredInfo} - - )} - -); - -/** - * TODO: this screen is identical to EuCovidCertRevokedScreen but but it is still being finalized and could change a lot. - * If it remains so, do a refactoring to unify common behaviors - * @param props - * @constructor - */ -export const EuCovidCertExpiredScreen = (props: Props): React.ReactElement => ( - } - header={} - /> -); diff --git a/ts/features/euCovidCert/screens/EuCovidCertLoadingScreen.tsx b/ts/features/euCovidCert/screens/EuCovidCertLoadingScreen.tsx deleted file mode 100644 index af6df84ca27..00000000000 --- a/ts/features/euCovidCert/screens/EuCovidCertLoadingScreen.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import * as React from "react"; -import { StyleSheet, View } from "react-native"; -import { - Body, - H4, - LoadingSpinner, - VSpacer -} from "@pagopa/io-app-design-system"; -import I18n from "../../../i18n"; -import { BaseEuCovidCertificateLayout } from "./BaseEuCovidCertificateLayout"; - -const styles = StyleSheet.create({ - container: { - alignItems: "center" - }, - subtitle: { - textAlign: "center" - }, - title: { - textAlign: "center" - } -}); - -export const EuCovidCertLoadingScreen = (): React.ReactElement => ( - - - - - - - -

- {I18n.t("features.euCovidCertificate.loading.title")} -

- - - {I18n.t("features.euCovidCertificate.loading.subtitle")} - -
- } - /> -); diff --git a/ts/features/euCovidCert/screens/EuCovidCertRevokedScreen.tsx b/ts/features/euCovidCert/screens/EuCovidCertRevokedScreen.tsx deleted file mode 100644 index ff6c1a93657..00000000000 --- a/ts/features/euCovidCert/screens/EuCovidCertRevokedScreen.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import * as pot from "@pagopa/ts-commons/lib/pot"; -import { - Divider, - H3, - Label, - Pictogram, - VSpacer -} from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { StyleSheet, View } from "react-native"; -import I18n from "../../../i18n"; -import { EuCovidCertHeader } from "../components/EuCovidCertHeader"; -import { EuCovidCertLearnMoreLink } from "../components/EuCovidCertLearnMoreLink"; -import { MarkdownHandleCustomLink } from "../components/MarkdownHandleCustomLink"; -import { WithEUCovidCertificateHeaderData } from "../types/EUCovidCertificate"; -import { useIOSelector } from "../../../store/hooks"; -import { EUCovidContext } from "../components/EUCovidContext"; -import { getPaginatedMessageById } from "../../messages/store/reducers/paginatedById"; -import { localeDateFormat } from "../../../utils/locale"; -import { BaseEuCovidCertificateLayout } from "./BaseEuCovidCertificateLayout"; - -const styles = StyleSheet.create({ - container: { - alignItems: "center" - }, - title: { - textAlign: "center" - } -}); - -type Props = { - revokeInfo?: string; -} & WithEUCovidCertificateHeaderData; - -const EuCovidCertRevokedContentComponent = (props: Props) => { - const currentCert = React.useContext(EUCovidContext); - const messageId = currentCert?.messageId ?? ""; - const paginatedMessagePot = useIOSelector(state => - getPaginatedMessageById(state, messageId) - ); - const createdAtOrUndefined = pot.toUndefined(paginatedMessagePot)?.createdAt; - - return ( - <> - - {createdAtOrUndefined && ( - - )} - - - - - -

- {I18n.t("features.euCovidCertificate.revoked.title")} -

-
- - {props.revokeInfo && ( - {props.revokeInfo} - )} - - - - ); -}; - -export const EuCovidCertRevokedScreen = (props: Props): React.ReactElement => ( - } - content={} - /> -); diff --git a/ts/features/euCovidCert/screens/EuCovidCertificateRouterScreen.tsx b/ts/features/euCovidCert/screens/EuCovidCertificateRouterScreen.tsx deleted file mode 100644 index 02565fcbdb6..00000000000 --- a/ts/features/euCovidCert/screens/EuCovidCertificateRouterScreen.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import * as pot from "@pagopa/ts-commons/lib/pot"; -import * as React from "react"; -import { useEffect, useRef } from "react"; -import { euCovidCertificateGet } from "../store/actions"; -import { - euCovidCertificateFromAuthCodeSelector, - euCovidCertificateShouldBeLoadedSelector -} from "../store/reducers/byAuthCode"; -import { - EUCovidCertificate, - EUCovidCertificateAuthCode -} from "../types/EUCovidCertificate"; -import { IOStackNavigationRouteProps } from "../../../navigation/params/AppParamsList"; -import { EUCovidContext } from "../components/EUCovidContext"; -import { EUCovidCertParamsList } from "../navigation/params"; -import { EUCovidCertificateResponse } from "../types/EUCovidCertificateResponse"; -import { useIODispatch, useIOSelector } from "../../../store/hooks"; -import { EuCovidCertExpiredScreen } from "./EuCovidCertExpiredScreen"; -import { EuCovidCertLoadingScreen } from "./EuCovidCertLoadingScreen"; -import { EuCovidCertRevokedScreen } from "./EuCovidCertRevokedScreen"; -import { EuCovidCertGenericErrorKoScreen } from "./ko/EuCovidCertGenericErrorKoScreen"; -import { EuCovidCertNotFoundKoScreen } from "./ko/EuCovidCertNotFoundKoScreen"; -import { EuCovidCertNotOperationalKoScreen } from "./ko/EuCovidCertNotOperationalKoScreen"; -import { EuCovidCertTemporarilyNotAvailableKoScreen } from "./ko/EuCovidCertTemporarilyNotAvailableKoScreen"; -import { EuCovidCertWrongFormatKoScreen } from "./ko/EuCovidCertWrongFormatKoScreen"; -import { EuCovidCertValidScreen } from "./valid/EuCovidCertValidScreen"; - -export type EuCovidCertificateRouterScreenNavigationParams = Readonly<{ - authCode: EUCovidCertificateAuthCode; - messageId: string; -}>; - -/** - * Return the right screen based on the response value - * @param response - */ -const routeEuCovidResponse = ( - response: EUCovidCertificateResponse -): React.ReactElement => { - switch (response.kind) { - case "notFound": - return ; - case "notOperational": - return ; - case "temporarilyNotAvailable": - return ; - case "wrongFormat": - return ; - case "success": - return routeSuccessEuCovidResponse(response.value); - } -}; - -const routeSuccessEuCovidResponse = ( - certificate: EUCovidCertificate -): React.ReactElement => { - switch (certificate.kind) { - case "valid": - return ( - - ); - case "revoked": - return ( - - ); - case "expired": - return ( - - ); - } -}; - -/** - * Router screen that triggers the first loading of the certificate (if not present in the store) - * and dispatch the rendering, based on the results of the certificate received - * @constructor - * @param props - */ -export const EuCovidCertificateRouterScreen = ( - props: IOStackNavigationRouteProps< - EUCovidCertParamsList, - "EUCOVIDCERT_CERTIFICATE" - > -): React.ReactElement | null => { - const authCode = props.route.params.authCode; - const messageId = props.route.params.messageId; - const shouldBeLoaded = useIOSelector(state => - euCovidCertificateShouldBeLoadedSelector(state, authCode) - ); - const euCovidCertificateResponse = useIOSelector(state => - euCovidCertificateFromAuthCodeSelector(state, authCode) - ); - const dispatch = useIODispatch(); - const firstLoading = useRef(true); - - useEffect(() => { - if (firstLoading.current) { - // check if a load is required - if (shouldBeLoaded) { - dispatch(euCovidCertificateGet.request(authCode)); - } - // eslint-disable-next-line functional/immutable-data - firstLoading.current = false; - } - }, [dispatch, shouldBeLoaded, messageId, authCode]); - - // handle with the fold the remote state and with routeEuCovidResponse the different response values - return ( - - {pot.fold( - euCovidCertificateResponse, - () => ( - - ), - () => ( - - ), - _ => ( - - ), - _ => ( - - ), - response => routeEuCovidResponse(response), - _ => ( - - ), - (_, __) => ( - - ), - _ => ( - - ) - )} - - ); -}; diff --git a/ts/features/euCovidCert/screens/__test__/EUCovidCertExpiredScreen.test.tsx b/ts/features/euCovidCert/screens/__test__/EUCovidCertExpiredScreen.test.tsx deleted file mode 100644 index 0d2515fe738..00000000000 --- a/ts/features/euCovidCert/screens/__test__/EUCovidCertExpiredScreen.test.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import * as React from "react"; - -import { Store } from "redux"; -import configureMockStore from "redux-mock-store"; -import { applicationChangeState } from "../../../../store/actions/application"; -import { appReducer } from "../../../../store/reducers"; -import { GlobalState } from "../../../../store/reducers/types"; -import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper"; -import EUCOVIDCERT_ROUTES from "../../navigation/routes"; -import { expiredCertificate } from "../../types/__mock__/EUCovidCertificate.mock"; -import { ExpiredCertificate } from "../../types/EUCovidCertificate"; -import { EuCovidCertExpiredScreen } from "../EuCovidCertExpiredScreen"; - -describe("Test EuCovidCertExpiredScreen", () => { - jest.useFakeTimers(); - - it("With expiredCertificate, the header should match the data contained in the certificate", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const mockStore = configureMockStore(); - const store: ReturnType = mockStore(globalState); - const render = renderComponent(store, { - ...expiredCertificate, - headerData: { - title: "titleValid", - subTitle: "subtitleValid", - logoUrl: "logoUrlValid" - } - }); - expect(render.component.queryByText("titleValid")).not.toBeNull(); - expect(render.component.queryByText("subtitleValid")).not.toBeNull(); - expect( - render.component.findByTestId("EuCovidCertHeaderLogoID") - ).not.toBeNull(); - }); -}); - -const renderComponent = ( - store: Store, - revokedCertificate: ExpiredCertificate -) => ({ - component: renderScreenWithNavigationStoreContext( - () => ( - - ), - EUCOVIDCERT_ROUTES.CERTIFICATE, - {}, - store - ), - store -}); diff --git a/ts/features/euCovidCert/screens/__test__/EUCovidCertRevokedScreen.test.tsx b/ts/features/euCovidCert/screens/__test__/EUCovidCertRevokedScreen.test.tsx deleted file mode 100644 index a1961f20553..00000000000 --- a/ts/features/euCovidCert/screens/__test__/EUCovidCertRevokedScreen.test.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import * as React from "react"; - -import { Store } from "redux"; -import configureMockStore from "redux-mock-store"; -import { applicationChangeState } from "../../../../store/actions/application"; -import { appReducer } from "../../../../store/reducers"; -import { GlobalState } from "../../../../store/reducers/types"; -import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper"; -import EUCOVIDCERT_ROUTES from "../../navigation/routes"; -import { revokedCertificate } from "../../types/__mock__/EUCovidCertificate.mock"; -import { RevokedCertificate } from "../../types/EUCovidCertificate"; -import { EuCovidCertRevokedScreen } from "../EuCovidCertRevokedScreen"; - -describe("Test EuCovidCertRevokedScreen", () => { - jest.useFakeTimers(); - - it("With revokedCertificate, the header should match the data contained in the certificate", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const mockStore = configureMockStore(); - const store: ReturnType = mockStore(globalState); - const render = renderComponent(store, { - ...revokedCertificate, - headerData: { - title: "titleValid", - subTitle: "subtitleValid", - logoUrl: "logoUrlValid" - } - }); - expect(render.component.queryByText("titleValid")).not.toBeNull(); - expect(render.component.queryByText("subtitleValid")).not.toBeNull(); - expect( - render.component.findByTestId("EuCovidCertHeaderLogoID") - ).not.toBeNull(); - }); -}); - -const renderComponent = (store: Store, certificate: RevokedCertificate) => ({ - component: renderScreenWithNavigationStoreContext( - () => , - EUCOVIDCERT_ROUTES.CERTIFICATE, - {}, - store - ), - store -}); diff --git a/ts/features/euCovidCert/screens/__test__/EUCovidCertValidScreen.test.tsx b/ts/features/euCovidCert/screens/__test__/EUCovidCertValidScreen.test.tsx deleted file mode 100644 index 3c4e7f70cc4..00000000000 --- a/ts/features/euCovidCert/screens/__test__/EUCovidCertValidScreen.test.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import { NavigationAction } from "@react-navigation/native"; -import { fireEvent } from "@testing-library/react-native"; -import * as React from "react"; -import { Store } from "redux"; -import configureMockStore from "redux-mock-store"; -import I18n from "../../../../i18n"; -import NavigationService from "../../../../navigation/NavigationService"; -import { applicationChangeState } from "../../../../store/actions/application"; -import { appReducer } from "../../../../store/reducers"; -import { GlobalState } from "../../../../store/reducers/types"; -import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper"; -import EUCOVIDCERT_ROUTES from "../../navigation/routes"; -import { - baseValidCertificate, - completeValidCertificate, - validCertificateWithoutDetails, - validCertificateWithoutPreview -} from "../../types/__mock__/EUCovidCertificate.mock"; -import { ValidCertificate } from "../../types/EUCovidCertificate"; -import { EuCovidCertValidScreen } from "../valid/EuCovidCertValidScreen"; -import { MESSAGES_ROUTES } from "../../../messages/navigation/routes"; - -describe("Test EUCovidCertificateValidScreen", () => { - jest.useFakeTimers(); - it("With baseValidCertificate, the details button and the preview markdown shouldn't be rendered", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const mockStore = configureMockStore(); - const store: ReturnType = mockStore(globalState); - const render = renderComponent(store, baseValidCertificate); - - expect( - render.component.queryByText(I18n.t("global.buttons.details")) - ).toBeNull(); - - expect(render.component.queryByTestId("markdownPreview")).toBeNull(); - }); - it("With validCertificateWithoutPreview, the details button should be rendered but the preview markdown shouldn't be rendered", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const mockStore = configureMockStore(); - const store: ReturnType = mockStore(globalState); - const render = renderComponent(store, validCertificateWithoutPreview); - - expect( - render.component.queryByText(I18n.t("global.buttons.details")) - ).not.toBeNull(); - - expect(render.component.queryByTestId("markdownPreview")).toBeNull(); - }); - - it("With validCertificateWithoutDetails, the details button shouldn't be rendered but the preview markdown should be rendered", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const mockStore = configureMockStore(); - const store: ReturnType = mockStore(globalState); - const render = renderComponent(store, validCertificateWithoutDetails); - - expect( - render.component.queryByText(I18n.t("global.buttons.details")) - ).toBeNull(); - - expect(render.component.queryByTestId("markdownPreview")).not.toBeNull(); - }); - it("With completeValidCertificate, the details button and preview markdown should be rendered", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const spy = jest.spyOn(NavigationService, "dispatchNavigationAction"); - const mockStore = configureMockStore(); - const store: ReturnType = mockStore(globalState); - const render = renderComponent(store, completeValidCertificate); - - const detailsButton = render.component.queryByText( - I18n.t("global.buttons.details") - ); - - const qrCodeTouchable = render.component.queryByTestId("QRCode"); - - expect(detailsButton).not.toBeNull(); - - expect(qrCodeTouchable).not.toBeNull(); - - if (detailsButton) { - fireEvent.press(detailsButton); - const detailsPayload: NavigationAction = { - type: "NAVIGATE", - payload: { - name: MESSAGES_ROUTES.MESSAGES_NAVIGATOR, - params: { - screen: EUCOVIDCERT_ROUTES.MAIN, - params: { - screen: EUCOVIDCERT_ROUTES.MARKDOWN_DETAILS, - params: { - markdownDetails: "markdownDetails" - } - } - } - } - }; - expect(spy).toHaveBeenCalledWith(detailsPayload); - } - - if (qrCodeTouchable) { - fireEvent.press(qrCodeTouchable); - const qrCodePayload: NavigationAction = { - type: "NAVIGATE", - payload: { - name: MESSAGES_ROUTES.MESSAGES_NAVIGATOR, - params: { - screen: EUCOVIDCERT_ROUTES.MAIN, - params: { - screen: EUCOVIDCERT_ROUTES.QRCODE, - params: { - qrCodeContent: - "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsAQAAAABRBrPYAAAHWElEQVR42u2aPY6kSBSEH8LAgwsgcQ28vBJcAIoLwJXw8hpIXAA8DETuF9Rs1Yyx0q5Eap0etUqoKlqT/X4i4r0sC//m32Y/sB/YD+w/wk6z6mXrfljjqldmVldDKHNLpzkM3iyLAutDtdVnY0syp8NRTUeY9GbZ+8VcFXwUWJNVV12FucxrS8LSOUuO6uXOJPBTJrFgen5l6ZiFaSYa1tXEZ+l9GF08WDXW6VWHYbb2WK96nWYr+HQOe4gFI+CdS0c7u4wyKJts0UNN9tfxj2Q9CeOj1v/Tz+9l+SAsKCZGyVmeKSMNtZdxznWsjUT81oBPwoZQDfNS+Ooyaz3xWUcejrKd0xDSKQrszOslOdbhUHkXgY/KPiyNC7vneSniwPTpwePZzisYs3A561XqS3tUYxYF1s+QxmJ1uDIFJAl0NzEJWxY2t+QuBizss4r8Vac7ccjSwadbprB0mYHZosBOy8TPRbDGSgXBQ85nEeCupQ+RYGHMrHNknziYuXXiAbqGuI4w1uuVRYER6kTBh7gWCnt0qw5ck5o0HDpeBBgcYrlKSwy5wxszH6XSPqPjwsvFgKEIa/CQJOLLG/AziahGW1r6GqUIUWB7SC9HAaQvW4qD8uaVGrB+rq6sCnFgKEKOHFhZzJAkOoj+VlNYd6+qG10U2E66a4NAqLfOzqZG9QjOSVjCQaCiwEZ3s6Un+Og7fJWGeR0C/Amhlb2PATsbZ7kRFhLNIavhgMFgFbmaxsHbUWCEYsuWHJthZ+EpdZhTEo9p3Oyr9c/CEo+7EBUPFLyRC+KTqsXCWRxLEgVGZ1HhSF46HXAIJGm9/KqkAYHYQxRYmBECOvp+h9TLXVQTjvGm68tFgWHCX6ptmogagCcVk7vFKMLqc7ZHYWLL4kDcq+l2qi+XYm9MXbZuZr2PAkPf6aaBds7INUVOUs7ccSr81dmGGLAw+ZK66mpSULYHVUedyyQXdLQvPwbjWdjIkZChwN+OY0xfruRIiS/7uwxaHwUW7uAPB3yFFN6jBw9ZuvOKOGZRYFQ4bipHj6g3d+bYchNz5mJR+i4G7OyP0mSMV5nVoNQXXvzcGVPtl6KfhWFpCopNY/vdvAcjLVYHxib7FgnW+zI5zgRD7kVcY33KvIWbq+07CDwKwz7BUSdWKtdSAp9cIk9MdgVzkMovBkzi3uKNa8Dh0uj6HthpN+p/+XT9szA0lxQ3lmJZC2QIo2hGiNBcy6q/KfphWCdLg+SplxG+nHlWHa2S48wWBcYox6SD6mEamXR4WOkmfosyCLdXjwCTLsCNuTZOJaTBwG523pOXjHqXRYHBhy/HuKqBa9CgtzSmiUC//ts+5FEYAUm3mhRLbZkoKbkAkygL91FdFNjL7uaShyEUDHfrbWY0Zt7aFAOG26dz+RQFTCfNsHjylOxfaGJYpzgwc/AVjVzCGEjSLlap9lkOFjVsfRRYckjmmKCTmYaio0+aC2Jp0NzjyyEPwzwSUCZBfthq6JFXTbJbLeouosDeWq+tCJHpbs29tV4eo/X2p8F4Csb/TiMzaxAZIk8ZMPLwvI41/PltwGdh/WzJvcQb8DMHcdA2jzKYVA/fsz0M8+QadRCNJDMDpt5JJIvyb32IAaPSpICdaZBMVG/VxszumNklvo2LAZMnx7Zh+y9V9fpC8fE5h7Z8PORZFBhUzMG2WoWXv4dleVQkqWzf6/coMFh6fe8i9hmTrIM1VonBqAQXAxZ2htaZ8zC6avaZPOqw7sySmdLRZTFgp9bOjMxak2rkGR0dLXIetEX8LsCfhVFgCrjHUDFEW4/yan6XM7/q79mehSWq82o/sMd4KsrAjMFZio/r+DquZ2FNVvZQVkAIUl0SHZIkSn2/zdvgY8CwNPRUNbo00E1aiTBH0+CaKCHqzkWBDRok6Skk6b5MCUsyL52RHS1hJh8HJmuBjaHC4StqgALQupJB3urwWZs8CjvvnWEFh2zyydgYYoIKk3cthz/19iyMbkLWrV43mUaYmbwwO1MMIszPnPUo7DZRs2aQzpEF+SjeJj7awBz22eY9CpPe4aBy/e2/umzLpPK75j4yEgMWJtiSGjt+lRwC1Gjc0+VgojuOKDCKbZClQXo4JyRGUujrdbPqytYrCgx7TLGh6erol260dYcyanWJdTy/CvgkjFwzBcAYHIOkv69sVl06MAfZ9zb2UZgcKUW132PsJPYom3p5bzKvuvqsmx6FaRmCFR9NE4dJg95jCGSyYNd3HwOmLwkUGqzwjdpracyZmT70i9rshRiw8P7CCbWtzpoXE2GeN3753ak+CtP3agZi7jV6iDF0w6uvCkBlu/9+B+NZmFbfby3IzkJcrXP28gAysW0c2E3LtJXGKxSBiQCnihyM2op/tgTPw166OGa4Iw7vJa3oer+J9JOFp2HKNSPApktVGKwKB2ajui8XPlr/MIwib3WDg9CnA2qryY5XbSzva50oMOrtUjdpqaVFIuV339PpguxIX1kM2M83/X5gP7D/C/YXGO1CDNeFmMoAAAAASUVORK5CYII=" - } - } - } - } - }; - expect(spy).toHaveBeenCalledWith(qrCodePayload); - } - expect(render.component.queryByTestId("markdownPreview")).not.toBeNull(); - }); - - it("With baseValidCertificate, the header should match the data contained in the certificate", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const mockStore = configureMockStore(); - const store: ReturnType = mockStore(globalState); - const render = renderComponent(store, { - ...baseValidCertificate, - headerData: { - title: "titleValid", - subTitle: "subtitleValid", - logoUrl: "logoUrlValid" - } - }); - expect(render.component.queryByText("titleValid")).not.toBeNull(); - expect(render.component.queryByText("subtitleValid")).not.toBeNull(); - expect( - render.component.findByTestId("EuCovidCertHeaderLogoID") - ).not.toBeNull(); - }); -}); - -const renderComponent = (store: Store, validCertificate: ValidCertificate) => ({ - component: renderScreenWithNavigationStoreContext( - () => ( - - ), - EUCOVIDCERT_ROUTES.CERTIFICATE, - {}, - store - ), - store -}); diff --git a/ts/features/euCovidCert/screens/__test__/EuCovidCertificateRouterScreen.test.tsx b/ts/features/euCovidCert/screens/__test__/EuCovidCertificateRouterScreen.test.tsx deleted file mode 100644 index a4e84705341..00000000000 --- a/ts/features/euCovidCert/screens/__test__/EuCovidCertificateRouterScreen.test.tsx +++ /dev/null @@ -1,218 +0,0 @@ -import { createStore, Store } from "redux"; -import { applicationChangeState } from "../../../../store/actions/application"; -import { appReducer } from "../../../../store/reducers"; -import { GlobalState } from "../../../../store/reducers/types"; -import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper"; -import { navigateToEuCovidCertificateDetailScreen } from "../../navigation/actions"; -import EUCOVIDCERT_ROUTES from "../../navigation/routes"; -import { euCovidCertificateGet } from "../../store/actions"; -import { - baseValidCertificate, - revokedCertificate -} from "../../types/__mock__/EUCovidCertificate.mock"; -import { EUCovidCertificateAuthCode } from "../../types/EUCovidCertificate"; -import { EuCovidCertificateRouterScreen } from "../EuCovidCertificateRouterScreen"; - -const authCode = "authCode" as EUCovidCertificateAuthCode; - -describe("Test EuCovidCertificateRouterScreen", () => { - jest.useFakeTimers(); - it("With the default store state, the loading screen should be rendered", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const store = createStore(appReducer, globalState as any); - const render = renderComponent(store); - - expect( - render.component.queryByTestId("EuCovidCertLoadingScreen") - ).not.toBeNull(); - }); - it("With a failure, the loading screen should be rendered EuCovidCertGenericErrorKoScreen", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const store = createStore(appReducer, globalState as any); - - const render = renderComponent(store); - - navigateToEuCovidCertificateDetailScreen({ - authCode, - messageId: "messageId" - }); - - expect( - render.component.queryByTestId("EuCovidCertLoadingScreen") - ).not.toBeNull(); - - render.store.dispatch( - euCovidCertificateGet.failure({ - kind: "generic", - authCode, - value: new Error("An error") - }) - ); - - expect( - render.component.queryByTestId("EuCovidCertGenericErrorKoScreen") - ).not.toBeNull(); - }); - - it("With a revoked certificate, the loading screen should be rendered EuCovidCertRevokedScreen", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const store = createStore(appReducer, globalState as any); - const render = renderComponent(store); - - expect( - render.component.queryByTestId("EuCovidCertLoadingScreen") - ).not.toBeNull(); - - render.store.dispatch( - euCovidCertificateGet.success({ - authCode, - kind: "success", - value: revokedCertificate - }) - ); - - expect( - render.component.queryByTestId("EuCovidCertRevokedScreen") - ).not.toBeNull(); - }); - it("With a valid certificate response, the loading screen should be rendered EuCovidCertValidScreen", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const store = createStore(appReducer, globalState as any); - const render = renderComponent(store); - - expect( - render.component.queryByTestId("EuCovidCertLoadingScreen") - ).not.toBeNull(); - - render.store.dispatch( - euCovidCertificateGet.success({ - authCode, - kind: "success", - value: baseValidCertificate - }) - ); - - expect( - render.component.queryByTestId("EuCovidCertValidScreen") - ).not.toBeNull(); - }); - - it("With a notFound response, the loading screen should be rendered EuCovidCertNotFoundKoScreen", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const store = createStore(appReducer, { - ...globalState, - features: { - ...globalState.features, - euCovidCert: { - ...globalState.features.euCovidCert, - current: { - messageId: "123", - authCode: "123" as EUCovidCertificateAuthCode - } - } - } - } as any); - const render = renderComponent(store); - - expect( - render.component.queryByTestId("EuCovidCertLoadingScreen") - ).not.toBeNull(); - - render.store.dispatch( - euCovidCertificateGet.success({ - authCode, - kind: "notFound" - }) - ); - - expect( - render.component.queryByTestId("EuCovidCertNotFoundKoScreen") - ).not.toBeNull(); - }); - - it("With a notOperational response, the loading screen should be rendered EuCovidCertNotOperationalKoScreen", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const store = createStore(appReducer, globalState as any); - const render = renderComponent(store); - - expect( - render.component.queryByTestId("EuCovidCertLoadingScreen") - ).not.toBeNull(); - - render.store.dispatch( - euCovidCertificateGet.success({ - authCode, - kind: "notOperational" - }) - ); - - expect( - render.component.queryByTestId("EuCovidCertNotOperationalKoScreen") - ).not.toBeNull(); - }); - - it("With a temporarilyNotAvailable response, the loading screen should be rendered EuCovidCertTemporarilyNotAvailableKoScreen", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const store = createStore(appReducer, globalState as any); - const render = renderComponent(store); - - expect( - render.component.queryByTestId("EuCovidCertLoadingScreen") - ).not.toBeNull(); - - render.store.dispatch( - euCovidCertificateGet.success({ - authCode, - kind: "temporarilyNotAvailable" - }) - ); - - expect( - render.component.queryByTestId( - "EuCovidCertTemporarilyNotAvailableKoScreen" - ) - ).not.toBeNull(); - }); - it("With a wrongFormat response, the loading screen should be rendered EuCovidCertWrongFormatKoScreen", () => { - const globalState = appReducer(undefined, applicationChangeState("active")); - const store = createStore(appReducer, { - ...globalState, - features: { - ...globalState.features, - euCovidCert: { - ...globalState.features.euCovidCert, - current: { - messageId: "123", - authCode: "123" as EUCovidCertificateAuthCode - } - } - } - } as any); - const render = renderComponent(store); - - expect( - render.component.queryByTestId("EuCovidCertLoadingScreen") - ).not.toBeNull(); - - render.store.dispatch( - euCovidCertificateGet.success({ - authCode, - kind: "wrongFormat" - }) - ); - - expect( - render.component.queryByTestId("EuCovidCertWrongFormatKoScreen") - ).not.toBeNull(); - }); -}); - -const renderComponent = (store: Store) => ({ - component: renderScreenWithNavigationStoreContext( - EuCovidCertificateRouterScreen, - EUCOVIDCERT_ROUTES.CERTIFICATE, - { authCode, messageId: "messageId" }, - store - ), - store -}); diff --git a/ts/features/euCovidCert/screens/ko/EuCovidCertGenericErrorKoScreen.tsx b/ts/features/euCovidCert/screens/ko/EuCovidCertGenericErrorKoScreen.tsx deleted file mode 100644 index 1c6552befaa..00000000000 --- a/ts/features/euCovidCert/screens/ko/EuCovidCertGenericErrorKoScreen.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { - Body, - FooterWithButtons, - H4, - Pictogram, - VSpacer -} from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { useContext } from "react"; -import { StyleSheet, View } from "react-native"; -import WorkunitGenericFailure from "../../../../components/error/WorkunitGenericFailure"; -import I18n from "../../../../i18n"; -import { useIODispatch } from "../../../../store/hooks"; -import { EUCovidContext } from "../../components/EUCovidContext"; -import { euCovidCertificateGet } from "../../store/actions"; -import { BaseEuCovidCertificateLayout } from "../BaseEuCovidCertificateLayout"; - -const styles = StyleSheet.create({ - container: { - alignItems: "center" - }, - subtitle: { - textAlign: "center" - } -}); - -const EuCovidCertGenericErrorKoComponent = () => ( - - - - - -

{I18n.t("features.euCovidCertificate.ko.genericError.title")}

- - - {I18n.t("features.euCovidCertificate.ko.genericError.subtitle")} - -
-); - -export const EuCovidCertGenericErrorKoScreen = (): React.ReactElement => { - const currentCertificate = useContext(EUCovidContext); - const dispatch = useIODispatch(); - // read from the store the authCode for the current certificate and create the refresh callback - const authCode = currentCertificate?.authCode; - const reloadCertificate = React.useCallback(() => { - if (authCode) { - dispatch(euCovidCertificateGet.request(authCode)); - } - }, [authCode, dispatch]); - - // reloadCertificate === undefined should never happens, handled with WorkunitGenericFailure - return reloadCertificate ? ( - } - footer={ - - } - /> - ) : ( - - ); -}; diff --git a/ts/features/euCovidCert/screens/ko/EuCovidCertNotFoundKoScreen.tsx b/ts/features/euCovidCert/screens/ko/EuCovidCertNotFoundKoScreen.tsx deleted file mode 100644 index 4868a425042..00000000000 --- a/ts/features/euCovidCert/screens/ko/EuCovidCertNotFoundKoScreen.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import { - FooterWithButtons, - H6, - HSpacer, - VSpacer -} from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { useContext } from "react"; -import { Image, StyleSheet, View } from "react-native"; -import doubtImage from "../../../../../img/features/euCovidCert/certificate_not_found.png"; -import CopyButtonComponent from "../../../../components/CopyButtonComponent"; -import WorkunitGenericFailure from "../../../../components/error/WorkunitGenericFailure"; -import { InfoScreenComponent } from "../../../../components/infoScreen/InfoScreenComponent"; -import I18n from "../../../../i18n"; -import { mixpanelTrack } from "../../../../mixpanel"; -import { euCovidCertificateUrl } from "../../../../urls"; -import { openWebUrl } from "../../../../utils/url"; -import { EUCovidContext } from "../../components/EUCovidContext"; -import { EUCovidCertificateAuthCode } from "../../types/EUCovidCertificate"; -import { BaseEuCovidCertificateLayout } from "../BaseEuCovidCertificateLayout"; - -const styles = StyleSheet.create({ - row: { - flexDirection: "row", - justifyContent: "space-between" - }, - shrink: { - flexShrink: 1 - } -}); - -const CopyWithTitleItem: React.FC<{ - title: string; - toCopy: string; - testId?: string; -}> = ({ title, toCopy, testId }) => ( - <> - -
{title}
-
- -
- {toCopy} -
- - -
- -); - -const EuCovidCertNotFoundKoComponent: React.FC<{ - currentAuthCode: EUCovidCertificateAuthCode; - messageId: string; -}> = ({ currentAuthCode, messageId }) => ( - <> - - } - title={I18n.t("features.euCovidCertificate.ko.notFound.title")} - /> -
{I18n.t("features.euCovidCertificate.ko.notFound.subtitle")}
- - - - - -); - -export const EuCovidCertNotFoundKoScreen = (): React.ReactElement => { - const euCovidCertCurrent = useContext(EUCovidContext); - // Handling unexpected error - if (euCovidCertCurrent === null) { - void mixpanelTrack("EUCOVIDCERT_UNEXPECTED_ERROR"); - return ; - } - - return ( - - } - footer={ - openWebUrl(euCovidCertificateUrl), - label: I18n.t("features.euCovidCertificate.ko.notFound.cta") - } - }} - /> - } - /> - ); -}; diff --git a/ts/features/euCovidCert/screens/ko/EuCovidCertNotOperationalKoScreen.tsx b/ts/features/euCovidCert/screens/ko/EuCovidCertNotOperationalKoScreen.tsx deleted file mode 100644 index 41f08ab110d..00000000000 --- a/ts/features/euCovidCert/screens/ko/EuCovidCertNotOperationalKoScreen.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { VSpacer } from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { Image } from "react-native"; -import notOperational from "../../../../../img/messages/empty-due-date-list-icon.png"; -import { InfoScreenComponent } from "../../../../components/infoScreen/InfoScreenComponent"; -import I18n from "../../../../i18n"; -import { EuCovidCertLearnMoreLink } from "../../components/EuCovidCertLearnMoreLink"; -import { BaseEuCovidCertificateLayout } from "../BaseEuCovidCertificateLayout"; - -const EuCovidCertNotOperationalComponent = (): React.ReactElement => ( - <> - - - - } - title={I18n.t("features.euCovidCertificate.ko.notOperational.title")} - body={} - /> - -); - -export const EuCovidCertNotOperationalKoScreen = (): React.ReactElement => ( - } - /> -); diff --git a/ts/features/euCovidCert/screens/ko/EuCovidCertTemporarilyNotAvailableKoScreen.tsx b/ts/features/euCovidCert/screens/ko/EuCovidCertTemporarilyNotAvailableKoScreen.tsx deleted file mode 100644 index d1a68d29d84..00000000000 --- a/ts/features/euCovidCert/screens/ko/EuCovidCertTemporarilyNotAvailableKoScreen.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { VSpacer } from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { Image } from "react-native"; -import unavailableImage from "../../../../../img/wallet/errors/payment-expired-icon.png"; -import { InfoScreenComponent } from "../../../../components/infoScreen/InfoScreenComponent"; -import I18n from "../../../../i18n"; -import { BaseEuCovidCertificateLayout } from "../BaseEuCovidCertificateLayout"; - -const EuCovidCertTemporarilyNotAvailableComponent = (): React.ReactElement => ( - <> - - - - } - title={I18n.t( - "features.euCovidCertificate.ko.temporarilyNotAvailable.title" - )} - body={I18n.t( - "features.euCovidCertificate.ko.temporarilyNotAvailable.subtitle" - )} - /> - -); - -export const EuCovidCertTemporarilyNotAvailableKoScreen = - (): React.ReactElement => ( - } - /> - ); diff --git a/ts/features/euCovidCert/screens/ko/EuCovidCertWrongFormatKoScreen.tsx b/ts/features/euCovidCert/screens/ko/EuCovidCertWrongFormatKoScreen.tsx deleted file mode 100644 index 0e2f127deeb..00000000000 --- a/ts/features/euCovidCert/screens/ko/EuCovidCertWrongFormatKoScreen.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { - FooterWithButtons, - H6, - HSpacer, - VSpacer -} from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { useContext } from "react"; -import { Image, StyleSheet, View } from "react-native"; -import wrongFormatImage from "../../../../../img/features/euCovidCert/certificate_wrong_format.png"; -import CopyButtonComponent from "../../../../components/CopyButtonComponent"; -import WorkunitGenericFailure from "../../../../components/error/WorkunitGenericFailure"; -import { InfoScreenComponent } from "../../../../components/infoScreen/InfoScreenComponent"; -import I18n from "../../../../i18n"; -import { mixpanelTrack } from "../../../../mixpanel"; -import { euCovidCertificateUrl } from "../../../../urls"; -import { openWebUrl } from "../../../../utils/url"; -import { EUCovidContext } from "../../components/EUCovidContext"; -import { EUCovidCertificateAuthCode } from "../../types/EUCovidCertificate"; -import { BaseEuCovidCertificateLayout } from "../BaseEuCovidCertificateLayout"; - -const styles = StyleSheet.create({ - row: { - flexDirection: "row", - justifyContent: "space-between" - }, - shrink: { - flexShrink: 1 - } -}); - -const CopyWithTitleItem: React.FC<{ - title: string; - toCopy: string; - testId?: string; -}> = ({ title, toCopy, testId }) => ( - <> - -
{title}
-
- -
- {toCopy} -
- - -
- -); - -const EuCovidCertWrongFormatKoComponent: React.FC<{ - currentAuthCode: EUCovidCertificateAuthCode; - messageId: string; -}> = ({ currentAuthCode, messageId }) => ( - <> - - } - title={I18n.t("features.euCovidCertificate.ko.wrongFormat.title")} - /> -
{I18n.t("features.euCovidCertificate.ko.wrongFormat.subtitle")}
- - - - - -); - -export const EuCovidCertWrongFormatKoScreen = (): React.ReactElement => { - const euCovidCertCurrent = useContext(EUCovidContext); - - // Handling unexpected error - if (euCovidCertCurrent === null) { - void mixpanelTrack("EUCOVIDCERT_UNEXPECTED_ERROR"); - return ; - } - - return ( - - } - footer={ - openWebUrl(euCovidCertificateUrl) - } - }} - /> - } - /> - ); -}; diff --git a/ts/features/euCovidCert/screens/ko/__tests__/EuCovidCertNotFoundKoScreen.test.tsx b/ts/features/euCovidCert/screens/ko/__tests__/EuCovidCertNotFoundKoScreen.test.tsx deleted file mode 100644 index e301939e325..00000000000 --- a/ts/features/euCovidCert/screens/ko/__tests__/EuCovidCertNotFoundKoScreen.test.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { fireEvent } from "@testing-library/react-native"; -import * as React from "react"; - -import { createStore } from "redux"; -import i18n from "../../../../../i18n"; -import * as mixpanelTrack from "../../../../../mixpanel"; -import { applicationChangeState } from "../../../../../store/actions/application"; -import { appReducer } from "../../../../../store/reducers"; -import { GlobalState } from "../../../../../store/reducers/types"; -import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper"; -import * as openWebUrl from "../../../../../utils/url"; -import EUCOVIDCERT_ROUTES from "../../../navigation/routes"; -import { EUCovidCertificateAuthCode } from "../../../types/EUCovidCertificate"; -import { EuCovidCertNotFoundKoScreen } from "../EuCovidCertNotFoundKoScreen"; -import { EuCovidCertWrongFormatKoScreen } from "../EuCovidCertWrongFormatKoScreen"; -import { EUCovidContext } from "../../../components/EUCovidContext"; - -describe("Test EuCovidCertNotFoundKoScreen", () => { - jest.useFakeTimers(); - it("Should show the WorkunitGenericFailure and should send the mixpanel event if euCovidCertCurrentSelector return null", () => { - const spyMixpanelTrack = jest.spyOn(mixpanelTrack, "mixpanelTrack"); - const globalState = appReducer(undefined, applicationChangeState("active")); - const notFoundScreen = renderComponent(globalState, false); - - expect( - notFoundScreen.queryByTestId("WorkunitGenericFailure") - ).not.toBeNull(); - expect( - notFoundScreen.queryByTestId("EuCovidCertNotFoundKoScreen") - ).toBeNull(); - expect(spyMixpanelTrack).toBeCalled(); - }); - it("Should show the authorization code and the message identifier if euCovidCertCurrentSelector is not null, and onButton click should open the web url", () => { - const spyOpenWebUrl = jest.spyOn(openWebUrl, "openWebUrl"); - const globalState = appReducer(undefined, applicationChangeState("active")); - const notFoundScreen = renderComponent({ - ...globalState, - features: { - ...globalState.features, - euCovidCert: { - ...globalState.features.euCovidCert - } - } - }); - const requestAssistanceButton = notFoundScreen.queryByText( - i18n.t("features.euCovidCertificate.ko.notFound.cta") - ); - - expect(requestAssistanceButton).not.toBeNull(); - - if (requestAssistanceButton !== null) { - fireEvent.press(requestAssistanceButton); - expect(spyOpenWebUrl).toBeCalled(); - } - - expect( - notFoundScreen.queryByTestId("authorizationCodeToCopy") - ).not.toBeNull(); - expect( - notFoundScreen.queryByTestId("messageIdentifierToCopy") - ).not.toBeNull(); - expect(notFoundScreen.queryByTestId("WorkunitGenericFailure")).toBeNull(); - }); -}); - -const renderComponent = (state: GlobalState, withContext: boolean = true) => { - const store = createStore(appReducer, state as any); - - const Component = withContext ? ( - - - - ) : ( - - ); - - return renderScreenWithNavigationStoreContext( - () => Component, - EUCOVIDCERT_ROUTES.CERTIFICATE, - {}, - store - ); -}; diff --git a/ts/features/euCovidCert/screens/ko/__tests__/EuCovidCertWrongFormatKoScreen.test.tsx b/ts/features/euCovidCert/screens/ko/__tests__/EuCovidCertWrongFormatKoScreen.test.tsx deleted file mode 100644 index 454ccf6ff2b..00000000000 --- a/ts/features/euCovidCert/screens/ko/__tests__/EuCovidCertWrongFormatKoScreen.test.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { fireEvent } from "@testing-library/react-native"; -import * as React from "react"; - -import { createStore } from "redux"; -import i18n from "../../../../../i18n"; -import * as mixpanelTrack from "../../../../../mixpanel"; -import { applicationChangeState } from "../../../../../store/actions/application"; -import { appReducer } from "../../../../../store/reducers"; -import { GlobalState } from "../../../../../store/reducers/types"; -import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper"; -import * as openWebUrl from "../../../../../utils/url"; -import EUCOVIDCERT_ROUTES from "../../../navigation/routes"; -import { EUCovidCertificateAuthCode } from "../../../types/EUCovidCertificate"; -import { EuCovidCertWrongFormatKoScreen } from "../EuCovidCertWrongFormatKoScreen"; -import { EUCovidContext } from "../../../components/EUCovidContext"; - -describe("Test EuCovidCertNotFoundKoScreen", () => { - jest.useFakeTimers(); - it("Should show the WorkunitGenericFailure and should send the mixpanel event if euCovidCertCurrentSelector return null", () => { - const spyMixpanelTrack = jest.spyOn(mixpanelTrack, "mixpanelTrack"); - const globalState = appReducer(undefined, applicationChangeState("active")); - const wrongFormatScreen = renderComponent(globalState, false); - - expect( - wrongFormatScreen.queryByTestId("WorkunitGenericFailure") - ).not.toBeNull(); - expect( - wrongFormatScreen.queryByTestId("EuCovidCertWrongFormatKoScreen") - ).toBeNull(); - expect(spyMixpanelTrack).toBeCalled(); - }); - it("Should show the authorization code and the message identifier if euCovidCertCurrentSelector is not null, and onButton click should open the web url", () => { - const spyOpenWebUrl = jest.spyOn(openWebUrl, "openWebUrl"); - const globalState = appReducer(undefined, applicationChangeState("active")); - const wrongFormatScreen = renderComponent({ - ...globalState, - features: { - ...globalState.features, - euCovidCert: { - ...globalState.features.euCovidCert - } - } - }); - const requestAssistanceButton = wrongFormatScreen.queryByText( - i18n.t("features.euCovidCertificate.ko.wrongFormat.cta") - ); - - expect(requestAssistanceButton).not.toBeNull(); - - if (requestAssistanceButton !== null) { - fireEvent.press(requestAssistanceButton); - expect(spyOpenWebUrl).toBeCalled(); - } - - expect( - wrongFormatScreen.queryByTestId("authorizationCodeToCopy") - ).not.toBeNull(); - expect( - wrongFormatScreen.queryByTestId("messageIdentifierToCopy") - ).not.toBeNull(); - expect( - wrongFormatScreen.queryByTestId("WorkunitGenericFailure") - ).toBeNull(); - }); -}); - -const renderComponent = (state: GlobalState, withContext: boolean = true) => { - const store = createStore(appReducer, state as any); - - const Component = withContext ? ( - - - - ) : ( - - ); - - return renderScreenWithNavigationStoreContext( - () => Component, - EUCOVIDCERT_ROUTES.CERTIFICATE, - {}, - store - ); -}; diff --git a/ts/features/euCovidCert/screens/valid/EuCovidCertMarkdownDetailsScreen.tsx b/ts/features/euCovidCert/screens/valid/EuCovidCertMarkdownDetailsScreen.tsx deleted file mode 100644 index fe0187ca48a..00000000000 --- a/ts/features/euCovidCert/screens/valid/EuCovidCertMarkdownDetailsScreen.tsx +++ /dev/null @@ -1,142 +0,0 @@ -import { - FooterWithButtons, - IOColors, - IOToast, - VSpacer -} from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { useState } from "react"; -import { ScrollView, StyleSheet, View } from "react-native"; -import { IOStyles } from "../../../../components/core/variables/IOStyles"; -import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel"; -import I18n from "../../../../i18n"; -import { mixpanelTrack } from "../../../../mixpanel"; -import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList"; -import { - FlashAnimatedComponent, - FlashAnimationState -} from "../../components/FlashAnimatedComponent"; -import { MarkdownHandleCustomLink } from "../../components/MarkdownHandleCustomLink"; -import { EUCovidCertParamsList } from "../../navigation/params"; -import { captureScreenshot, screenshotOptions } from "../../utils/screenshot"; - -export type EuCovidCertMarkdownDetailsScreenNavigationParams = Readonly<{ - markdownDetails: string; -}>; - -const styles = StyleSheet.create({ - viewShot: { - flex: 1, - backgroundColor: IOColors.white - } -}); - -const showToastError = (error: string = I18n.t("global.genericError")) => - IOToast.error(error); - -export const EuCovidCertMarkdownDetailsScreen = ( - props: IOStackNavigationRouteProps< - EUCovidCertParamsList, - "EUCOVIDCERT_MARKDOWN_DETAILS" - > -): React.ReactElement => { - const [loadMarkdownComplete, setLoadMarkdownComplete] = useState(false); - const [isCapturingScreenShoot, setIsCapturingScreenShoot] = useState(false); - const [flashAnimationState, setFlashAnimationState] = - useState(); - const screenShotViewContainerRef = React.createRef(); - - React.useEffect(() => { - if (isCapturingScreenShoot) { - // at the end of fadeIn animation, the views inside screenShotViewContainerRef - // will be captured in an screenshot image - setFlashAnimationState("fadeIn"); - } - }, [isCapturingScreenShoot]); - - const saveScreenShoot = () => { - // it should not never happen - if (screenShotViewContainerRef.current === null) { - showToastError(); - setIsCapturingScreenShoot(false); - return; - } - captureScreenshot(screenShotViewContainerRef, screenshotOptions, { - onSuccess: () => - IOToast.success(I18n.t("features.euCovidCertificate.save.ok")), - onNoPermissions: () => - IOToast.info(I18n.t("features.euCovidCertificate.save.noPermission")), - onError: () => IOToast.error(I18n.t("global.genericError")), - onEnd: () => { - setFlashAnimationState("fadeOut"); - setIsCapturingScreenShoot(false); - } - }); - }; - // show button when markdown is loaded and it is not capturing the screenshot - const canShowButton = !isCapturingScreenShoot && loadMarkdownComplete; - - useHeaderSecondLevel({ - title: I18n.t( - "features.euCovidCertificate.valid.markdownDetails.headerTitle" - ), - supportRequest: true - }); - - return ( - <> - - {/* add an extra padding while capturing the screenshot */} - - {/* add an extra top and bottom (as extra height in the markdown component) - margin while capturing the screenshot */} - {isCapturingScreenShoot && } - setLoadMarkdownComplete(true)} - > - {props.route.params.markdownDetails} - - - - {canShowButton && ( - props.navigation.goBack() - } - }} - secondary={{ - type: "Solid", - buttonProps: { - label: I18n.t( - "features.euCovidCertificate.valid.markdownDetails.save" - ), - onPress: () => { - void mixpanelTrack("EUCOVIDCERT_SAVE_MARKDOWN_DETAILS"); - setIsCapturingScreenShoot(true); - } - } - }} - /> - )} - {/* this view must be the last one, since it must be drawn on top of all */} - - - ); -}; diff --git a/ts/features/euCovidCert/screens/valid/EuCovidCertQrCodeFullScreen.tsx b/ts/features/euCovidCert/screens/valid/EuCovidCertQrCodeFullScreen.tsx deleted file mode 100644 index 62f28e65654..00000000000 --- a/ts/features/euCovidCert/screens/valid/EuCovidCertQrCodeFullScreen.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { FooterWithButtons, VSpacer } from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { Dimensions, Image, ScrollView, StyleSheet } from "react-native"; -import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel"; -import I18n from "../../../../i18n"; -import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList"; -import { useMaxBrightness } from "../../../../utils/brightness"; -import { withBase64Uri } from "../../../../utils/image"; -import { EUCovidCertParamsList } from "../../navigation/params"; - -export type EuCovidCertQrCodeFullScreenNavigationParams = Readonly<{ - qrCodeContent: string; -}>; - -const styles = StyleSheet.create({ - qrCode: { - // TODO: it's preferable to use the hook useWindowDimensions, but we need to upgrade react native - width: Dimensions.get("window").width, - height: Dimensions.get("window").width, - flex: 1 - } -}); - -export const EuCovidCertQrCodeFullScreen = ( - props: IOStackNavigationRouteProps< - EUCovidCertParamsList, - "EUCOVIDCERT_QRCODE" - > -): React.ReactElement => { - useMaxBrightness(); - - useHeaderSecondLevel({ - title: "", - supportRequest: true - }); - - return ( - <> - - - - - - props.navigation.goBack() - } - }} - /> - - ); -}; diff --git a/ts/features/euCovidCert/screens/valid/EuCovidCertValidScreen.tsx b/ts/features/euCovidCert/screens/valid/EuCovidCertValidScreen.tsx deleted file mode 100644 index 00b2f64d846..00000000000 --- a/ts/features/euCovidCert/screens/valid/EuCovidCertValidScreen.tsx +++ /dev/null @@ -1,306 +0,0 @@ -import { - BlockButtonProps, - FooterWithButtons, - H4, - H6, - IOColors, - IOToast, - Icon, - VSpacer -} from "@pagopa/io-app-design-system"; -import * as React from "react"; -import { useContext, useState } from "react"; -import { - Dimensions, - Image, - Pressable, - StyleProp, - StyleSheet, - TouchableOpacity, - View, - ViewStyle -} from "react-native"; -import { IOStyles } from "../../../../components/core/variables/IOStyles"; -import I18n from "../../../../i18n"; -import { mixpanelTrack } from "../../../../mixpanel"; -import themeVariables from "../../../../theme/variables"; -import { useLegacyIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet"; -import { withBase64Uri } from "../../../../utils/image"; -import { EUCovidContext } from "../../components/EUCovidContext"; -import { EuCovidCertHeader } from "../../components/EuCovidCertHeader"; -import { - FlashAnimatedComponent, - FlashAnimationState -} from "../../components/FlashAnimatedComponent"; -import { MarkdownHandleCustomLink } from "../../components/MarkdownHandleCustomLink"; -import { - navigateToEuCovidCertificateMarkdownDetailsScreen, - navigateToEuCovidCertificateQrCodeFullScreen -} from "../../navigation/actions"; -import { - ValidCertificate, - WithEUCovidCertificateHeaderData -} from "../../types/EUCovidCertificate"; -import { captureScreenshot, screenshotOptions } from "../../utils/screenshot"; -import { BaseEuCovidCertificateLayout } from "../BaseEuCovidCertificateLayout"; - -type Props = { - validCertificate: ValidCertificate; -} & WithEUCovidCertificateHeaderData; - -const styles = StyleSheet.create({ - qrCode: { - // TODO: it's preferable to use the hook useWindowDimensions, but we need to upgrade react native - width: Dimensions.get("window").width - themeVariables.contentPadding * 2, - height: Dimensions.get("window").width - themeVariables.contentPadding * 2, - flex: 1 - }, - container: { - paddingRight: 0, - paddingLeft: 0, - marginVertical: 20, - height: 60, - backgroundColor: IOColors.white - }, - flexColumn: { - flexDirection: "column", - flex: 1 - }, - row: { - flexDirection: "row", - alignItems: "flex-start", - justifyContent: "space-between" - } -}); - -type EuCovidCertValidComponentProps = Props & { - markdownWebViewStyle?: StyleProp; - messageId?: string; -}; -const EuCovidCertValidComponent = ( - props: EuCovidCertValidComponentProps -): React.ReactElement => ( - - {props.validCertificate.qrCode.mimeType === "image/png" && ( - <> - - - navigateToEuCovidCertificateQrCodeFullScreen({ - qrCodeContent: props.validCertificate.qrCode.content - }) - } - > - { - void mixpanelTrack("EUCOVIDCERT_QRCODE_IMAGE_NOT_VALID", { - messageId: props.messageId - }); - }} - /> - - - - )} - {props.validCertificate.markdownInfo && ( - - - {props.validCertificate.markdownInfo} - - - - )} - -); - -const showToastError = (error: string = I18n.t("global.genericError")) => - IOToast.error(error); - -const addBottomSheetItem = (config: { - title: string; - subTitle: string; - onPress: () => void; -}) => ( - - - - -

{config.title}

-
{config.subTitle}
-
- -
-
- -
-); - -type FooterProps = Props & { onSave: () => void }; -const Footer = (props: FooterProps): React.ReactElement => { - const { - present: presentBottomSheet, - bottomSheet, - dismiss - } = useLegacyIOBottomSheetModal( - - {addBottomSheetItem({ - title: I18n.t( - "features.euCovidCertificate.save.bottomSheet.saveAsImage.title" - ), - subTitle: I18n.t( - "features.euCovidCertificate.save.bottomSheet.saveAsImage.subTitle" - ), - onPress: () => { - props.onSave(); - dismiss(); - } - })} - , - -

- {I18n.t("features.euCovidCertificate.save.bottomSheet.title")} -

-
- {I18n.t("features.euCovidCertificate.save.bottomSheet.subTitle")} -
- -
, - 320 - ); - - const saveButton: BlockButtonProps = { - type: "Solid", - buttonProps: { - onPress: presentBottomSheet, - label: I18n.t("global.genericSave") - } - }; - - const markdownDetails = props.validCertificate.markdownDetails; - - return ( - <> - {bottomSheet} - {markdownDetails ? ( - - navigateToEuCovidCertificateMarkdownDetailsScreen({ - markdownDetails - }), - label: I18n.t("global.buttons.details") - } - }} - secondary={saveButton} - /> - ) : ( - - )} - - ); -}; - -export const EuCovidCertValidScreen = (props: Props): React.ReactElement => { - const currentCert = useContext(EUCovidContext); - const screenShotViewContainer = React.createRef(); - const [flashAnimationState, setFlashAnimationState] = - useState(); - const [isCapturingScreenShoot, setIsCapturingScreenShoot] = useState(false); - React.useEffect(() => { - if (isCapturingScreenShoot) { - // at the end of fadeIn animation, the views inside screenShotViewContainerRef - // will be captured in an screenshot image - setFlashAnimationState("fadeIn"); - } - }, [isCapturingScreenShoot]); - - const saveScreenShoot = () => { - // it should not never happen - if (screenShotViewContainer.current === null) { - showToastError(); - return; - } - captureScreenshot(screenShotViewContainer, screenshotOptions, { - onSuccess: () => - IOToast.success(I18n.t("features.euCovidCertificate.save.ok")), - onNoPermissions: () => - IOToast.info(I18n.t("features.euCovidCertificate.save.noPermission")), - onError: () => IOToast.error(I18n.t("global.genericError")), - onEnd: () => { - setFlashAnimationState("fadeOut"); - setIsCapturingScreenShoot(false); - } - }); - }; - const header = ; - return ( - - {/* add extra space (top,sides,bottom) and padding while capturing the screenshot */} - {isCapturingScreenShoot && } - {isCapturingScreenShoot && ( - {header} - )} - {isCapturingScreenShoot && } - - {isCapturingScreenShoot && } - - } - footer={ - <> -