Skip to content

Commit

Permalink
Merge branch 'master' into IOAPPX-405-remove-react-import-
Browse files Browse the repository at this point in the history
  • Loading branch information
LeleDallas authored Dec 20, 2024
2 parents 048e915 + a835a70 commit b7be7d4
Show file tree
Hide file tree
Showing 26 changed files with 354 additions and 46 deletions.
4 changes: 1 addition & 3 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,4 @@ 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'
# ITW Documents on IO URL
ITW_DOCUMENTS_ON_IO_URL='https://io.italia.it/documenti-su-io'
ITW_IPZS_PRIVACY_URL='https://io.italia.it/informativa-ipzs'
4 changes: 1 addition & 3 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,4 @@ 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'
# ITW Documents on IO URL
ITW_DOCUMENTS_ON_IO_URL='https://io.italia.it/documenti-su-io'
ITW_IPZS_PRIVACY_URL='https://io.italia.it/informativa-ipzs'
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.80.0-rc.6](https://github.com/pagopa/io-app/compare/2.80.0-rc.5...2.80.0-rc.6) (2024-12-19)


### Features

* **IT Wallet:** [[SIW-1824](https://pagopa.atlassian.net/browse/SIW-1824)] Show alert if wallet instance is revoked ([#6547](https://github.com/pagopa/io-app/issues/6547)) ([fbe9e87](https://github.com/pagopa/io-app/commit/fbe9e87eb00f576a09867991353b1b82a5f5fea3))


### Bug Fixes

* [[IOPID-2547](https://pagopa.atlassian.net/browse/IOPID-2547)] Fix unhandled error on `Linking.openUrl` ([#6554](https://github.com/pagopa/io-app/issues/6554)) ([1ddf587](https://github.com/pagopa/io-app/commit/1ddf587f5c63c6bf5a236da5a96e31764b86955f))
* [[IOPLT-814](https://pagopa.atlassian.net/browse/IOPLT-814)] Fixes workflow concatenation after changes due to test improvements ([#6572](https://github.com/pagopa/io-app/issues/6572)) ([d8a8e66](https://github.com/pagopa/io-app/commit/d8a8e660bfc5bf9358e2050763ebeeff5b6b9c4c))


### Chores

* **Cross:** [[IOAPPX-432](https://pagopa.atlassian.net/browse/IOAPPX-432)] Development Push notifications for Android ([#6416](https://github.com/pagopa/io-app/issues/6416)) ([8cf64a9](https://github.com/pagopa/io-app/commit/8cf64a942a0ac538c0f6b493dccd1d8695bc29d5))
* **Cross:** [[IOAPPX-448](https://pagopa.atlassian.net/browse/IOAPPX-448)] Add missing components to the Design System section, remove legacy ones + Change `ListItemMessage` component API ([#6541](https://github.com/pagopa/io-app/issues/6541)) ([323996f](https://github.com/pagopa/io-app/commit/323996f8e0207da8a60766ff38042e9a85d9a857))
* [[IOBP-1076](https://pagopa.atlassian.net/browse/IOBP-1076)] FAQ without CTA with sticky buttons ([#6555](https://github.com/pagopa/io-app/issues/6555)) ([a0d562f](https://github.com/pagopa/io-app/commit/a0d562fc949e40ca7b24b714e42e41f53db56f32))
* [[IOPLT-798](https://pagopa.atlassian.net/browse/IOPLT-798)] Split test execution using shards ([#6500](https://github.com/pagopa/io-app/issues/6500)) ([7d9df54](https://github.com/pagopa/io-app/commit/7d9df5479cd9784e2679e5a5188d085cb68dbef5))
* [[IOPLT-813](https://pagopa.atlassian.net/browse/IOPLT-813)] Fix android run script and align Gemfile ([#6571](https://github.com/pagopa/io-app/issues/6571)) ([bbe6980](https://github.com/pagopa/io-app/commit/bbe69800a17a8e0b6b88629da9b58fa7f23f95c4))
* **IT Wallet:** [[SIW-1793](https://pagopa.atlassian.net/browse/SIW-1793)] Update non-matching identity screen ([#6559](https://github.com/pagopa/io-app/issues/6559)) ([5c04708](https://github.com/pagopa/io-app/commit/5c04708efdf2aa82263c947073eb6c9e489f15f7))
* [[IOPLT-801](https://pagopa.atlassian.net/browse/IOPLT-801)] Improvements to canary release workflow ([#6468](https://github.com/pagopa/io-app/issues/6468)) ([dc66860](https://github.com/pagopa/io-app/commit/dc668601582efbb029b36c58186e7fb9e098b576))

## [2.80.0-rc.5](https://github.com/pagopa/io-app/compare/2.80.0-rc.4...2.80.0-rc.5) (2024-12-18)


Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ android {
applicationId "it.pagopa.io.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 100154900
versionName "2.80.0.5"
versionCode 100154901
versionName "2.80.0.6"
multiDexEnabled true
// The resConfigs attribute will remove all not required localized resources while building the application,
// including the localized resources from libraries.
Expand Down
4 changes: 2 additions & 2 deletions ios/ItaliaApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@
CODE_SIGN_ENTITLEMENTS = ItaliaApp/ItaliaApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = M2X5YQ4BJ7;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -835,7 +835,7 @@
CODE_SIGN_ENTITLEMENTS = ItaliaApp/ItaliaApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = M2X5YQ4BJ7;
ENABLE_BITCODE = NO;
Expand Down
2 changes: 1 addition & 1 deletion ios/ItaliaApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>5</string>
<string>6</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/ItaliaAppTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5</string>
<string>6</string>
</dict>
</plist>
14 changes: 14 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3555,6 +3555,20 @@ features:
title: Dicci cosa ne pensi
content: Raccontaci la tua esperienza con la funzionalità Documenti su IO.
action: Inizia
walletInstanceRevoked:
alert:
cta: Scopri di più
closeButton: Chiudi
closeButtonAlt: Ho capito
revokedByWalletProvider:
title: Documenti su IO è stata disattivata
content: Per verificare i requisiti richiesti per continuare a usare la funzionalità sul tuo dispositivo, premi "Scopri di più".
newWalletInstanceCreated:
title: Documenti su IO è stata disattivata su questo dispositivo
content: Puoi usare i tuoi documenti su IO su un solo dispositivo alla volta per ragioni di sicurezza.
revokedByUser:
title: Hai disattivato Documenti su IO
content: Se cambi idea, potrai riattivare Documenti su IO in futuro.
support:
ticketList:
noTicket:
Expand Down
14 changes: 14 additions & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3555,6 +3555,20 @@ features:
title: Dicci cosa ne pensi
content: Raccontaci la tua esperienza con la funzionalità Documenti su IO.
action: Inizia
walletInstanceRevoked:
alert:
cta: Scopri di più
closeButton: Chiudi
closeButtonAlt: Ho capito
revokedByWalletProvider:
title: Documenti su IO è stata disattivata
content: Per verificare i requisiti richiesti per continuare a usare la funzionalità sul tuo dispositivo, premi "Scopri di più".
newWalletInstanceCreated:
title: Documenti su IO è stata disattivata su questo dispositivo
content: Puoi usare i tuoi documenti su IO su un solo dispositivo alla volta per ragioni di sicurezza.
revokedByUser:
title: Hai disattivato Documenti su IO
content: Se cambi idea, potrai riattivare Documenti su IO in futuro.
support:
ticketList:
noTicket:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "italia-app",
"version": "2.80.0-rc.5",
"version": "2.80.0-rc.6",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down
2 changes: 1 addition & 1 deletion publiccode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ releaseDate: "2024-11-21"
url: "https://github.com/pagopa/io-app"
applicationSuite: IO
landingURL: "https://io.italia.it/"
softwareVersion: 2.80.0-rc.5
softwareVersion: 2.80.0-rc.6
developmentStatus: beta
softwareType: standalone/mobile
roadmap: "https://io.italia.it/"
Expand Down
5 changes: 0 additions & 5 deletions ts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,3 @@ export const itwIpzsPrivacyUrl: string = pipe(
t.string.decode,
E.getOrElse(() => "https://io.italia.it/informativa-ipzs")
);
export const itwDocumentsOnIOUrl: string = pipe(
Config.ITW_DOCUMENTS_ON_IO_URL,
t.string.decode,
E.getOrElse(() => "https://io.italia.it/documenti-su-io")
);
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ exports[`featuresPersistor should match snapshot 1`] = `
},
"walletInstance": {
"attestation": undefined,
"status": undefined,
},
},
"landingBanners": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ exports[`itWalletReducer should match snapshot [if this test fails, remember to
},
"walletInstance": {
"attestation": undefined,
"status": undefined,
},
}
`;
19 changes: 18 additions & 1 deletion ts/features/itwallet/common/utils/itwTypesUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { Credential, Trust } from "@pagopa/io-react-native-wallet";
import {
Credential,
Trust,
WalletInstance
} from "@pagopa/io-react-native-wallet";

/**
* Alias type for the return type of the start issuance flow operation.
Expand Down Expand Up @@ -43,6 +47,19 @@ export type ParsedStatusAttestation = Awaited<
ReturnType<typeof Credential.Status.verifyAndParseStatusAttestation>
>["parsedStatusAttestation"]["payload"];

/**
* Alias for the WalletInstanceStatus type
*/
export type WalletInstanceStatus = Awaited<
ReturnType<typeof WalletInstance.getWalletInstanceStatus>
>;

/**
* Alias for the WalletInstanceRevocationReason type
*/
export type WalletInstanceRevocationReason =
WalletInstanceStatus["revocation_reason"];

export type StoredStatusAttestation =
| {
credentialStatus: "valid";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { getWalletInstanceStatus } from "../../../common/utils/itwAttestationUti
import { StoredCredential } from "../../../common/utils/itwTypesUtils";
import { sessionTokenSelector } from "../../../../../store/reducers/authentication";
import { handleWalletInstanceResetSaga } from "../handleWalletInstanceResetSaga";
import { itwIsWalletInstanceAttestationValidSelector } from "../../../walletInstance/store/reducers";
import { ensureIntegrityServiceIsReady } from "../../../common/utils/itwIntegrityUtils";
import { itwIntegrityServiceReadySelector } from "../../../issuance/store/selectors";
import { itwIsWalletInstanceAttestationValidSelector } from "../../../walletInstance/store/selectors";

jest.mock("@pagopa/io-react-native-crypto", () => ({
deleteKey: jest.fn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ensureIntegrityServiceIsReady } from "../../common/utils/itwIntegrityUt
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
import { itwLifecycleIsOperationalOrValid } from "../store/selectors";
import { itwIntegritySetServiceIsReady } from "../../issuance/store/actions";
import { itwUpdateWalletInstanceStatus } from "../../walletInstance/store/actions";
import { handleWalletInstanceResetSaga } from "./handleWalletInstanceResetSaga";

export function* getStatusOrResetWalletInstance(integrityKeyTag: string) {
Expand All @@ -23,6 +24,9 @@ export function* getStatusOrResetWalletInstance(integrityKeyTag: string) {
if (walletInstanceStatus.is_revoked) {
yield* call(handleWalletInstanceResetSaga);
}

// Update wallet instance status
yield* put(itwUpdateWalletInstanceStatus(walletInstanceStatus));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ts/features/itwallet/machine/credential/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { itwCredentialsStore } from "../../credentials/store/actions";
import { ITW_ROUTES } from "../../navigation/routes";
import { itwWalletInstanceAttestationStore } from "../../walletInstance/store/actions";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/reducers";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/selectors";
import { Context } from "./context";
import { CredentialIssuanceEvents } from "./events";

Expand Down
2 changes: 1 addition & 1 deletion ts/features/itwallet/machine/eid/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import {
trackSaveCredentialSuccess,
updateITWStatusAndIDProperties
} from "../../analytics";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/reducers";
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/selectors";
import { Context } from "./context";
import { EidIssuanceEvents } from "./events";

Expand Down
2 changes: 1 addition & 1 deletion ts/features/itwallet/trustmark/machine/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { checkCurrentSession } from "../../../../store/actions/authentication";
import { useIOStore } from "../../../../store/hooks";
import { itwCredentialByTypeSelector } from "../../credentials/store/selectors";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/reducers";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/selectors";
import { Context } from "./context";

export const createItwTrustmarkActionsImplementation = (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import { Alert } from "react-native";
import { useCallback } from "react";
import I18n from "../../../../i18n";
import { WalletInstanceRevocationReason } from "../../common/utils/itwTypesUtils";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { itwWalletInstanceStatusSelector } from "../store/selectors";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { itwUpdateWalletInstanceStatus } from "../store/actions";
import { openWebUrl } from "../../../../utils/url";

const closeButtonText = I18n.t(
"features.itWallet.walletInstanceRevoked.alert.closeButton"
);
const alertCtaText = I18n.t(
"features.itWallet.walletInstanceRevoked.alert.cta"
);

const itwMinIntegrityReqUrl = "https://io.italia.it/documenti-su-io/faq/#n1_12";
const itwDocsOnIOMultipleDevicesUrl =
"https://io.italia.it/documenti-su-io/faq/#n1_14";

/**
* Hook to monitor wallet instance status and display alerts if revoked.
*/
export const useItwWalletInstanceRevocationAlert = () => {
const walletInstanceStatus = useIOSelector(itwWalletInstanceStatusSelector);
const dispatch = useIODispatch();

useOnFirstRender(
useCallback(() => {
if (walletInstanceStatus?.is_revoked) {
showWalletRevocationAlert(walletInstanceStatus.revocation_reason);
dispatch(itwUpdateWalletInstanceStatus(undefined));
}
}, [walletInstanceStatus, dispatch])
);
};

/**
* Displays an alert based on the revocation reason.
*/
const showWalletRevocationAlert = (
revocationReason?: WalletInstanceRevocationReason
) => {
switch (revocationReason) {
case "CERTIFICATE_REVOKED_BY_ISSUER":
Alert.alert(
I18n.t(
"features.itWallet.walletInstanceRevoked.alert.revokedByWalletProvider.title"
),
I18n.t(
"features.itWallet.walletInstanceRevoked.alert.revokedByWalletProvider.content"
),
[
{ text: closeButtonText },
{
text: alertCtaText,
onPress: () => openWebUrl(itwMinIntegrityReqUrl)
}
]
);
break;

case "NEW_WALLET_INSTANCE_CREATED":
Alert.alert(
I18n.t(
"features.itWallet.walletInstanceRevoked.alert.newWalletInstanceCreated.title"
),
I18n.t(
"features.itWallet.walletInstanceRevoked.alert.newWalletInstanceCreated.content"
),
[
{ text: closeButtonText },
{
text: alertCtaText,
onPress: () => openWebUrl(itwDocsOnIOMultipleDevicesUrl)
}
]
);
break;
case "REVOKED_BY_USER":
Alert.alert(
I18n.t(
"features.itWallet.walletInstanceRevoked.alert.revokedByUser.title"
),
I18n.t(
"features.itWallet.walletInstanceRevoked.alert.revokedByUser.content"
),
[
{
text: I18n.t(
"features.itWallet.walletInstanceRevoked.alert.closeButtonAlt"
)
}
]
);
break;
default:
break;
}
};
14 changes: 11 additions & 3 deletions ts/features/itwallet/walletInstance/store/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ActionType, createStandardAction } from "typesafe-actions";
import { WalletInstanceStatus } from "../../../common/utils/itwTypesUtils";

/**
* This action stores the Wallet Instance Attestation
Expand All @@ -7,6 +8,13 @@ export const itwWalletInstanceAttestationStore = createStandardAction(
"ITW_WALLET_INSTANCE_ATTESTATION_STORE"
)<string>();

export type ItwWalletInstanceActions = ActionType<
typeof itwWalletInstanceAttestationStore
>;
/**
* This action update the Wallet Instance Status
*/
export const itwUpdateWalletInstanceStatus = createStandardAction(
"ITW_WALLET_INSTANCE_STATUS_UPDATE"
)<WalletInstanceStatus | undefined>();

export type ItwWalletInstanceActions =
| ActionType<typeof itwWalletInstanceAttestationStore>
| ActionType<typeof itwUpdateWalletInstanceStatus>;
Loading

0 comments on commit b7be7d4

Please sign in to comment.