Skip to content

Commit

Permalink
Merge branch 'master' into IOBP-782-add-biz-events-migration-banner-info
Browse files Browse the repository at this point in the history
  • Loading branch information
Hantex9 authored Oct 17, 2024
2 parents d6a993b + 24a9b41 commit 67800dc
Show file tree
Hide file tree
Showing 27 changed files with 502 additions and 122 deletions.
2 changes: 2 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ ITW_ISSUANCE_REDIRECT_URI_CIE="iowalletcie://cb"
ITW_BYPASS_IDENTITY_MATCH=YES
# Use the test environment for the IDP hint for both CIE and SPID
ITW_IDP_HINT_TEST=YES
# IPZS Privacy Policy URL
ITW_IPZS_PRIVACY_URL='https://io.italia.it/informativa-ipzs'
2 changes: 2 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ ITW_ISSUANCE_REDIRECT_URI_CIE="iowalletcie://cb"
ITW_BYPASS_IDENTITY_MATCH=NO
# Use the test environment for the IDP hint for both CIE and SPID
ITW_IDP_HINT_TEST=NO
# IPZS Privacy Policy URL
ITW_IPZS_PRIVACY_URL='https://io.italia.it/informativa-ipzs'
11 changes: 9 additions & 2 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,11 @@ features:
mdl: Patente di Guida
dc: Carta Europea della Disabilità
ts: Tessera Sanitaria - Tessera europea di assicurazione malattia
ipzsPrivacy:
title: I tuoi Documenti su IO sono al sicuro
warning: Premendo **Continua** dichiari di aver letto e compreso l’**Informativa Privacy**.
button:
label: Continua
wallet:
active: Attivo
inactive: Non attivo
Expand Down Expand Up @@ -3250,11 +3255,11 @@ features:
placeOfBirth: "Luogo di nascita"
expirationDate: "Scadenza"
securityLevel: "Livello di sicurezza"
issuedBy: "Credenziale emessa da"
info: "Ulteriori info su questi dati"
issuedByNew: "Emessa da"
releasedBy: Emissione versione digitale
attachments: "Attachments"
authenticSource: Origine dei dati
mdl:
category: "Licenza {{category}}"
issuedDate: "Valida dal"
Expand Down Expand Up @@ -3287,7 +3292,6 @@ features:
cieId:
title: CieID
subtitle: Usa credenziali e app CieID
privacy: Identificandoti dichiari di aver letto e compreso l’[Informativa Privacy](https://io.italia.it/informativa-ipzs-sperimentazione) di **Istituto Poligrafico e Zecca dello Stato**.
nfc:
title: Attiva l'NFC per continuare
description: Per consentire a IO di leggere la tua CIE, attiva l'NFC dalle Impostazioni del tuo dispositivo.
Expand Down Expand Up @@ -3330,6 +3334,9 @@ features:
about:
title: "Chi è?"
subtitle: "È l'ente riconosciuto dallo Stato a fornirti la versione digitale dei tuoi documenti."
authSource:
title: "Chi è?"
subtitle: "È l'ente che detiene i dati contenuti all'interno del tuo documento."
actions:
primary: Aggiungi al portafoglio
secondary: Annulla
Expand Down
11 changes: 9 additions & 2 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,11 @@ features:
mdl: Patente di Guida
dc: Carta Europea della Disabilità
ts: Tessera Sanitaria - Tessera europea di assicurazione malattia
ipzsPrivacy:
title: I tuoi Documenti su IO sono al sicuro
warning: Premendo **Continua** dichiari di aver letto e compreso l’**Informativa Privacy**.
button:
label: Continua
wallet:
active: Attivo
inactive: Non attivo
Expand Down Expand Up @@ -3250,11 +3255,11 @@ features:
placeOfBirth: "Luogo di nascita"
expirationDate: "Scadenza"
securityLevel: "Livello di sicurezza"
issuedBy: "Credenziale emessa da"
info: "Ulteriori info su questi dati"
issuedByNew: "Emessa da"
releasedBy: Emissione versione digitale
attachments: "Allegati"
authenticSource: Origine dei dati
mdl:
category: "Licenza {{category}}"
issuedDate: "Valida dal"
Expand Down Expand Up @@ -3287,7 +3292,6 @@ features:
cieId:
title: CieID
subtitle: Usa credenziali e app CieID
privacy: Identificandoti dichiari di aver letto e compreso l’[Informativa Privacy](https://io.italia.it/informativa-ipzs-sperimentazione) di **Istituto Poligrafico e Zecca dello Stato**.
nfc:
title: Attiva l'NFC per continuare
description: Per consentire a IO di leggere la tua CIE, attiva l'NFC dalle Impostazioni del tuo dispositivo.
Expand Down Expand Up @@ -3330,6 +3334,9 @@ features:
about:
title: "Chi è?"
subtitle: "È l'ente riconosciuto dallo Stato a fornirti la versione digitale dei tuoi documenti."
authSource:
title: "Chi è?"
subtitle: "È l'ente che detiene i dati contenuti all'interno del tuo documento."
actions:
primary: Aggiungi al portafoglio
secondary: Annulla
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"@pagopa/io-react-native-integrity": "^0.3.0",
"@pagopa/io-react-native-jwt": "^1.2.0",
"@pagopa/io-react-native-login-utils": "1.0.6",
"@pagopa/io-react-native-wallet": "^0.20.0",
"@pagopa/io-react-native-wallet": "^0.21.0",
"@pagopa/io-react-native-zendesk": "^0.3.29",
"@pagopa/react-native-cie": "^1.3.0",
"@pagopa/ts-commons": "^10.15.0",
Expand Down
5 changes: 5 additions & 0 deletions ts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,8 @@ export const itwEaaVerifierBaseUrl = Config.ITW_EAA_VERIFIER_BASE_URL;
export const itwBypassIdentityMatch =
Config.ITW_BYPASS_IDENTITY_MATCH === "YES";
export const itwIdpHintTest = Config.ITW_IDP_HINT_TEST === "YES";
export const itwIpzsPrivacyUrl: string = pipe(
Config.ITW_IPZS_PRIVACY_URL,
t.string.decode,
E.getOrElse(() => "https://io.italia.it/informativa-ipzs")
);
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as pot from "@pagopa/ts-commons/lib/pot";
import * as React from "react";
import {
Divider,
ListItemHeader,
ListItemInfo
} from "@pagopa/io-app-design-system";
import * as pot from "@pagopa/ts-commons/lib/pot";
import * as React from "react";
import I18n from "../../../../../i18n";
import { profileSelector } from "../../../../../store/reducers/profile";
import { useIOSelector } from "../../../../../store/hooks";
import { capitalize } from "../../../../../utils/strings";
import { profileSelector } from "../../../../../store/reducers/profile";
import { capitalizeTextName } from "../../../../../utils/strings";

/**
* Renders the CGN ownership block for detail screen, including Owner's Fiscal Code (The current user logged in)
Expand All @@ -23,12 +23,12 @@ const CgnOwnershipInformation = (): React.ReactElement => {
<ListItemHeader label={I18n.t("bonus.cgn.detail.ownership")} />
<ListItemInfo
label="Nome"
value={capitalize(currentProfile.value.name)}
value={capitalizeTextName(currentProfile.value.name)}
/>
<Divider />
<ListItemInfo
label="Cognome"
value={capitalize(currentProfile.value.family_name)}
value={capitalizeTextName(currentProfile.value.family_name)}
/>
<Divider />
<ListItemInfo
Expand Down
8 changes: 4 additions & 4 deletions ts/features/bonus/cgn/screens/CgnDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { profileSelector } from "../../../../store/reducers/profile";
import { GlobalState } from "../../../../store/reducers/types";
import { formatDateAsShortFormat } from "../../../../utils/dates";
import { useActionOnFocus } from "../../../../utils/hooks/useOnFocus";
import { capitalizeTextName } from "../../../../utils/strings";
import { openWebUrl } from "../../../../utils/url";
import { availableBonusTypesSelectorFromId } from "../../common/store/selectors";
import { ID_CGN_TYPE } from "../../common/utils";
Expand Down Expand Up @@ -65,7 +66,6 @@ import {
import { cgnUnsubscribeSelector } from "../store/reducers/unsubscribe";
import { EYCA_WEBSITE_DISCOUNTS_PAGE_URL } from "../utils/constants";
import { canEycaCardBeShown } from "../utils/eyca";
import { capitalize } from "../../../../utils/strings";

type Props = ReturnType<typeof mapStateToProps> &
ReturnType<typeof mapDispatchToProps>;
Expand Down Expand Up @@ -198,9 +198,9 @@ const CgnDetailScreen = (props: Props): React.ReactElement => {
}}
>
{pot.isSome(currentProfile)
? `${capitalize(currentProfile.value.name)} ${capitalize(
currentProfile.value.family_name
)}`
? `${capitalizeTextName(
currentProfile.value.name
)} ${capitalizeTextName(currentProfile.value.family_name)}`
: ""}
</H4>
}
Expand Down
160 changes: 160 additions & 0 deletions ts/features/itwallet/common/components/ItwIssuanceMetadata.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import { Divider, ListItemInfo } from "@pagopa/io-app-design-system";
import React, { useMemo } from "react";
import { pipe } from "fp-ts/lib/function";
import * as O from "fp-ts/lib/Option";
import I18n from "../../../../i18n";
import { useItwInfoBottomSheet } from "../hooks/useItwInfoBottomSheet";
import { StoredCredential } from "../utils/itwTypesUtils";
import {
CREDENTIALS_MAP,
trackWalletCredentialShowAuthSource,
trackWalletCredentialShowIssuer
} from "../../analytics";

type ItwIssuanceMetadataProps = {
credential: StoredCredential;
isPreview?: boolean;
};

type ItwMetadataIssuanceListItemProps = {
label: string;
value: string;
bottomSheet: {
contentTitle: string;
contentBody: string;
onPress: () => void;
};
isPreview?: boolean;
};

const ItwMetadataIssuanceListItem = ({
label,
value,
bottomSheet: bottomSheetProps,
isPreview
}: ItwMetadataIssuanceListItemProps) => {
const bottomSheet = useItwInfoBottomSheet({
title: value,
content: [
{
title: bottomSheetProps.contentTitle,
body: bottomSheetProps.contentBody
}
]
});

const endElement: ListItemInfo["endElement"] = useMemo(() => {
if (isPreview) {
return;
}

return {
type: "iconButton",
componentProps: {
icon: "info",
accessibilityLabel: `Info ${label}`,
onPress: () => {
bottomSheetProps.onPress();
bottomSheet.present();
}
}
};
}, [isPreview, bottomSheet, bottomSheetProps, label]);

return (
<>
<ListItemInfo
endElement={endElement}
label={label}
value={value}
accessibilityLabel={`${label} ${value}`}
/>
{bottomSheet.bottomSheet}
</>
);
};

const getAuthSource = (credential: StoredCredential) =>
pipe(
credential.issuerConf.openid_credential_issuer
.credential_configurations_supported?.[credential.credentialType],
O.fromNullable,
O.map(config => config.authentic_source),
O.toUndefined
);

/**
* Renders additional issuance-related metadata, i.e. releaser and auth source.
* They are not part of the claims list, thus they're rendered separately.
* @param credential - the credential with the issuer configuration
* @param isPreview - whether the component is rendered in preview mode which hides the info button.
* @returns the list items with the metadata.
*/
export const ItwIssuanceMetadata = ({
credential,
isPreview
}: ItwIssuanceMetadataProps) => {
const releaserName =
credential.issuerConf.federation_entity.organization_name;
const authSource = getAuthSource(credential);

const releaserNameBottomSheet: ItwMetadataIssuanceListItemProps["bottomSheet"] =
useMemo(
() => ({
contentTitle: I18n.t(
"features.itWallet.issuance.credentialPreview.bottomSheet.about.title"
),
contentBody: I18n.t(
"features.itWallet.issuance.credentialPreview.bottomSheet.about.subtitle"
),
onPress: () =>
trackWalletCredentialShowIssuer(
CREDENTIALS_MAP[credential.credentialType]
)
}),
[credential.credentialType]
);

const authSourceBottomSheet: ItwMetadataIssuanceListItemProps["bottomSheet"] =
useMemo(
() => ({
contentTitle: I18n.t(
"features.itWallet.issuance.credentialPreview.bottomSheet.authSource.title"
),
contentBody: I18n.t(
"features.itWallet.issuance.credentialPreview.bottomSheet.authSource.subtitle"
),
onPress: () =>
trackWalletCredentialShowAuthSource(
CREDENTIALS_MAP[credential.credentialType]
)
}),
[credential.credentialType]
);

return (
<>
{authSource && (
<ItwMetadataIssuanceListItem
label={I18n.t(
"features.itWallet.verifiableCredentials.claims.authenticSource"
)}
value={authSource}
isPreview={isPreview}
bottomSheet={authSourceBottomSheet}
/>
)}
{authSource && releaserName && <Divider />}
{releaserName && (
<ItwMetadataIssuanceListItem
label={I18n.t(
"features.itWallet.verifiableCredentials.claims.releasedBy"
)}
value={releaserName}
isPreview={isPreview}
bottomSheet={releaserNameBottomSheet}
/>
)}
</>
);
};
Loading

0 comments on commit 67800dc

Please sign in to comment.