Skip to content

Commit

Permalink
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnplb authored Nov 22, 2024
2 parents 1302e2a + 4954500 commit b2b617d
Show file tree
Hide file tree
Showing 32 changed files with 462 additions and 134 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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.77.1-rc.0](https://github.com/pagopa/io-app/compare/2.77.0-rc.3...2.77.1-rc.0) (2024-11-21)

## [2.77.0-rc.3](https://github.com/pagopa/io-app/compare/2.77.0-rc.2...2.77.0-rc.3) (2024-11-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 @@ -113,8 +113,8 @@ android {
applicationId "it.pagopa.io.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 100154868
versionName "2.77.0.3"
versionCode 100154869
versionName "2.77.1.0"
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 @@ -805,7 +805,7 @@
CODE_SIGN_ENTITLEMENTS = ItaliaApp/ItaliaApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 0;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = M2X5YQ4BJ7;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -842,7 +842,7 @@
CODE_SIGN_ENTITLEMENTS = ItaliaApp/ItaliaApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 0;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = M2X5YQ4BJ7;
ENABLE_BITCODE = NO;
Expand Down
4 changes: 2 additions & 2 deletions ios/ItaliaApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.77.0</string>
<string>2.77.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3</string>
<string>0</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/ItaliaAppTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.77.0</string>
<string>2.77.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3</string>
<string>0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ authentication:
wizards:
cie_id_wizard:
title: Do you have the CieID app?
description: If you have the CieID app on your device, enter the code you have set for the CieID app or use your face or fingerprint.
description: "If you have the CieID app on your device, enter the code you have set for the CieID app or use your face or fingerprint.\n\nTo enter the IO app without physically using the Electronic Identity Card,you must first enable Level 1 and Level 2 access in the CieID application."
actions:
primary:
label: Yes, log in with CieID
Expand Down
2 changes: 1 addition & 1 deletion locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ authentication:
wizards:
cie_id_wizard:
title: Hai l'app CieID?
description: Se hai l’app CieID sul tuo dispositivo, inserisci il codice che hai impostato per l’app CieID o usa il tuo volto o l’impronta.
description: "Se hai l’app CieID sul tuo dispositivo, inserisci il codice che hai impostato per l’app CieID o usa il tuo volto o l’impronta.\n\nPer entrare su IO senza usare fisicamente la Carta di Identità Elettronica, devi prima abilitare l’accesso con livello 1 e 2 nell’app CieID."
actions:
primary:
label: Sì, entra con CieID
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "italia-app",
"version": "2.77.0-rc.3",
"version": "2.77.1-rc.0",
"io_backend_api": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_backend.yaml",
"io_session_manager_api": "https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@1.0.0/apps/io-session-manager/api/internal.yaml",
"io_session_manager_public_api": "https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@1.0.0/apps/io-session-manager/api/public.yaml",
"io_public_api": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_public.yaml",
"io_content_specs": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.46/definitions.yml",
"io_content_specs": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.47/definitions.yml",
"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",
Expand Down
4 changes: 2 additions & 2 deletions publiccode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
publiccodeYmlVersion: "0.2"
name: IO
logo: "img/io-app-icon.png"
releaseDate: "2024-11-18"
releaseDate: "2024-11-21"
url: "https://github.com/pagopa/io-app"
applicationSuite: IO
landingURL: "https://io.italia.it/"
softwareVersion: 2.77.0-rc.3
softwareVersion: 2.77.1-rc.0
developmentStatus: beta
softwareType: standalone/mobile
roadmap: "https://io.italia.it/"
Expand Down
36 changes: 17 additions & 19 deletions ts/features/cie/__tests__/CieIdErrorScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@ import { fireEvent, render } from "@testing-library/react-native";
import React from "react";
import CieIdErrorScreen from "../screens/errors/CieIdErrorScreen";
import * as useNavigateToLoginMethod from "../../../hooks/useNavigateToLoginMethod";
import ROUTES from "../../../navigation/routes";

const mockNavigateToCiePinInsertion = jest.fn();
const mockNavigateToIdpSelection = jest.fn();
const mockNavigateToCieIdScreen = jest.fn();
const mockReplace = jest.fn();
const mockNavigate = jest.fn();

jest.mock("@react-navigation/native", () => {
const actualNav = jest.requireActual("@react-navigation/native");
return {
...actualNav,
useNavigation: () => ({
replace: mockReplace
replace: mockReplace,
navigate: mockNavigate
})
};
});
jest.mock("react-redux", () => ({
...jest.requireActual("react-redux"),
useDispatch: jest.fn
}));

describe("CieIdErrorScreen where device supports NFC", () => {
afterEach(jest.clearAllMocks);
beforeEach(() => {
jest.spyOn(useNavigateToLoginMethod, "default").mockImplementation(() => ({
navigateToCiePinInsertion: mockNavigateToCiePinInsertion,
navigateToIdpSelection: mockNavigateToIdpSelection,
navigateToCieIdLoginScreen: mockNavigateToCieIdScreen,
...jest.requireActual("../../../hooks/useNavigateToLoginMethod"),
isCieSupported: true
}));
});
Expand All @@ -37,9 +39,9 @@ describe("CieIdErrorScreen where device supports NFC", () => {

fireEvent.press(primaryAction);

expect(mockNavigateToCiePinInsertion).toHaveBeenCalled();
expect(mockNavigateToIdpSelection).not.toHaveBeenCalled();
expect(mockNavigateToCieIdScreen).not.toHaveBeenCalled();
expect(mockNavigate).toHaveBeenCalledWith(ROUTES.AUTHENTICATION, {
screen: ROUTES.CIE_PIN_SCREEN
});
expect(mockReplace).not.toHaveBeenCalled();
});
it("Should properly call replace", testReplace);
Expand All @@ -48,9 +50,7 @@ describe("CieIdErrorScreen where device doesn't support NFC", () => {
afterEach(jest.clearAllMocks);
beforeEach(() => {
jest.spyOn(useNavigateToLoginMethod, "default").mockImplementation(() => ({
navigateToCiePinInsertion: mockNavigateToCiePinInsertion,
navigateToIdpSelection: mockNavigateToIdpSelection,
navigateToCieIdLoginScreen: mockNavigateToCieIdScreen,
...jest.requireActual("../../../hooks/useNavigateToLoginMethod"),
isCieSupported: false
}));
});
Expand All @@ -63,9 +63,9 @@ describe("CieIdErrorScreen where device doesn't support NFC", () => {

fireEvent.press(primaryAction);

expect(mockNavigateToIdpSelection).toHaveBeenCalled();
expect(mockNavigateToCiePinInsertion).not.toHaveBeenCalled();
expect(mockNavigateToCieIdScreen).not.toHaveBeenCalled();
expect(mockNavigate).toHaveBeenCalledWith(ROUTES.AUTHENTICATION, {
screen: ROUTES.AUTHENTICATION_IDP_SELECTION
});
expect(mockReplace).not.toHaveBeenCalled();
});
it("Should properly call pop-to-top", testReplace);
Expand All @@ -89,8 +89,6 @@ function testReplace() {

fireEvent.press(primaryAction);

expect(mockNavigateToCiePinInsertion).not.toHaveBeenCalled();
expect(mockNavigateToIdpSelection).not.toHaveBeenCalled();
expect(mockNavigateToCieIdScreen).not.toHaveBeenCalled();
expect(mockNavigate).not.toHaveBeenCalled();
expect(mockReplace).toHaveBeenCalled();
}
2 changes: 2 additions & 0 deletions ts/features/cie/__tests__/__snapshots__/wizards.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ exports[`CieIdWizard Should match the snapshot 1`] = `
}
>
If you have the CieID app on your device, enter the code you have set for the CieID app or use your face or fingerprint.
To enter the IO app without physically using the Electronic Identity Card,you must first enable Level 1 and Level 2 access in the CieID application.
</Text>
</View>
<View
Expand Down
5 changes: 4 additions & 1 deletion ts/features/cie/__tests__/wizards.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jest.mock("react-redux", () => ({
...jest.requireActual("react-redux"),
useDispatch: jest.fn,
useSelector: jest.fn,
useStore: jest.fn
useStore: () => ({
getState: jest.fn()
})
}));
jest.mock("react-native-safe-area-context", () => ({
useSafeAreaInsets: jest.fn
Expand All @@ -51,6 +53,7 @@ jest.mock("../../../hooks/useNavigateToLoginMethod", () => ({
jest.mock("@gorhom/bottom-sheet", () =>
jest.requireActual("../../../__mocks__/@gorhom/bottom-sheet.ts")
);
jest.mock("../analytics");

describe(CieIdWizard, () => {
afterEach(jest.clearAllMocks);
Expand Down
119 changes: 119 additions & 0 deletions ts/features/cie/analytics/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import { IdpCIE, IdpCIE_ID } from "../../../hooks/useNavigateToLoginMethod";
import { mixpanelTrack } from "../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../mixpanelConfig/profileProperties";
import { GlobalState } from "../../../store/reducers/types";
import { buildEventProperties } from "../../../utils/analytics";
import { SpidLevel } from "../../cieLogin/utils";

const SECURITY_LEVEL_MAP: Record<SpidLevel, "L2" | "L3"> = {
SpidL2: "L2",
SpidL3: "L3"
};

// Wizards screen view events
export const trackCieIdWizardScreen = async () => {
void mixpanelTrack(
"LOGIN_CIE_WIZARD_CIEID",
buildEventProperties("UX", "screen_view")
);
};
export const trackCiePinWizardScreen = async () => {
void mixpanelTrack(
"LOGIN_CIE_WIZARD_PIN",
buildEventProperties("UX", "screen_view")
);
};
export const trackSpidWizardScreen = async () => {
void mixpanelTrack(
"LOGIN_CIE_WIZARD_SPID",
buildEventProperties("UX", "screen_view")
);
};
export const trackIdpActivationWizardScreen = async () => {
void mixpanelTrack(
"LOGIN_CIE_WIZARD_IDP_ACTIVATION",
buildEventProperties("UX", "screen_view")
);
};

// Wizards action events
export const trackWizardCieIdSelected = async (
state: GlobalState,
spidLevel: SpidLevel
) => {
await updateMixpanelProfileProperties(state, {
property: "LOGIN_METHOD",
value: IdpCIE_ID.id
});
void mixpanelTrack(
"LOGIN_CIE_WIZARD_CIEID_SELECTED",
buildEventProperties("UX", "action", {
security_level: SECURITY_LEVEL_MAP[spidLevel]
})
);
};
export const trackWizardCiePinSelected = async (state: GlobalState) => {
await updateMixpanelProfileProperties(state, {
property: "LOGIN_METHOD",
value: IdpCIE.id
});
void mixpanelTrack(
"LOGIN_CIE_WIZARD_PIN_SELECTED",
buildEventProperties("UX", "action")
);
};
export const trackWizardCiePinInfoSelected = async () => {
void mixpanelTrack(
"LOGIN_CIE_WIZARD_PIN_INFO",
buildEventProperties("UX", "action")
);
};
export const trackWizardSpidSelected = async () => {
void mixpanelTrack(
"LOGIN_CIE_WIZARD_SPID_SELECTED",
buildEventProperties("UX", "action")
);
};

// Cie id not installed screen view events
export const trackCieIdNotInstalledScreen = async () => {
void mixpanelTrack(
"LOGIN_CIEID_APP_NOT_FOUND",
buildEventProperties("KO", "error")
);
};
// Cie id not installed action events
export const trackCieIdNotInstalledDownloadAction = async () => {
void mixpanelTrack(
"LOGIN_CIEID_APP_NOT_FOUND_DOWNLOAD",
buildEventProperties("UX", "action")
);
};

// Cie Id error screen view events
export const trackCieIdErrorCiePinFallbackScreen = async () => {
void mixpanelTrack(
"LOGIN_CIEID_FALLBACK_CIE_PIN",
buildEventProperties("KO", undefined)
);
};
export const trackCieIdErrorSpidFallbackScreen = async () => {
void mixpanelTrack(
"LOGIN_CIEID_FALLBACK_SPID",
buildEventProperties("KO", undefined)
);
};

// Cie Id error screen action events
export const trackCieIdErrorCiePinSelected = async () => {
void mixpanelTrack(
"LOGIN_CIEID_FALLBACK_CIE_PIN_SELECTED",
buildEventProperties("UX", "action")
);
};
export const trackCieIdErrorSpidSelected = async () => {
void mixpanelTrack(
"LOGIN_CIEID_FALLBACK_CIE_SPID_SELECTED",
buildEventProperties("UX", "action")
);
};
2 changes: 2 additions & 0 deletions ts/features/cie/components/CieIdNotInstalled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Linking, Platform } from "react-native";
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import I18n from "../../../i18n";
import { trackCieIdNotInstalledDownloadAction } from "../analytics";

export const CIE_ID_IOS_LINK =
"https://apps.apple.com/it/app/cieid/id1504644677";
Expand All @@ -28,6 +29,7 @@ const CieIdNotInstalled = ({ isUat }: CieIdNotInstalledProps) => {
"authentication.cie_id.cie_not_installed.primary_action_label"
),
onPress: () => {
void trackCieIdNotInstalledDownloadAction();
void Linking.openURL(
Platform.select({
ios: CIE_ID_IOS_LINK,
Expand Down
7 changes: 6 additions & 1 deletion ts/features/cie/screens/CieIdNotInstalledScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import React from "react";
import React, { useEffect } from "react";
import { RouteProp, useRoute } from "@react-navigation/native";
import CieIdNotInstalled from "../components/CieIdNotInstalled";
import { AuthenticationParamsList } from "../../../navigation/params/AuthenticationParamsList";
import ROUTES from "../../../navigation/routes";
import { trackCieIdNotInstalledScreen } from "../analytics";

const CieIdNotInstalledScreen = () => {
const { params } =
useRoute<
RouteProp<AuthenticationParamsList, typeof ROUTES.CIE_NOT_INSTALLED>
>();

useEffect(() => {
void trackCieIdNotInstalledScreen();
}, []);

return <CieIdNotInstalled {...params} />;
};

Expand Down
Loading

0 comments on commit b2b617d

Please sign in to comment.