Skip to content

Commit

Permalink
chore(IT Wallet): [SIW-1848] Remove IT Wallet trial system (#6487)
Browse files Browse the repository at this point in the history
## Short description
This PR completely removes the IT Wallet trial system, enabling the
feature for everyone.

## List of changes proposed in this pull request
- Removed trial system references from the .env files
- Removed trial system selectors
- Removed `ItwUpcomingWalletBanner` component
- Refactored ITW banners for the wallet home screen
- Updated components which was conditionally rendering using the Trial
system active flag.
- Updated tests

## How to test

This PR must be tested in different conditions:

### a.  IT Wallet feature is remotely disabled 
Use a proxy software (e.g., Proxyman) to mock the return value of the
remote config and set the IT Wallet enable flag to `false`.

```json
"itw": {
  "enabled": false,
  "min_app_version": {
    "ios": "2.67.0.2",
    "android": "2.67.0.2"
  },
  "feedback_banner_visible": true
}
 ```
Check that all elements related to the IT Wallet (e.g., banners, sections, ctas) are not visible throughout the app.

### b. IT Wallet feature is enabled, but a wallet is not yet been activated

Set the IT Wallet enable flag back to `true`. Without activating the IT Wallet:
1. Navigate to the Messages Home screen.
2. Check the IT Wallet Discovery banner is visible.
3. Navigate to the Wallet Home screen.
4. Check the IT Wallet Discovery banner is visible here as well.
5. Check that the IT Wallet cards section is not rendered

### c. IT Wallet feature is enabled and there is a valid wallet active

1. Navigate to the Wallet Home screen.
2. Confirm the dedicated IT Wallet section is displayed correctly.
3. Verify that all related functionality is accessible and works as expected.
  • Loading branch information
mastro993 authored Dec 4, 2024
1 parent 10b56d6 commit 5edf322
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 550 deletions.
5 changes: 2 additions & 3 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ WALLET_API_BASEURL='http://127.0.0.1:3000'
# Wallet V3 test/env RESTful API
WALLET_API_UAT_BASEURL='https://api.uat.platform.pagopa.it'
# IT Wallet
ITW_TRIAL_ID="01J2GN4TA8FB6DPTAX3T3YD6M1"
ITW_WALLET_PROVIDER_BASE_URL="https://api-app.io.pagopa.it/api/v1/wallet"
ITW_PID_PROVIDER_BASE_URL="https://pre.eid.wallet.ipzs.it"
ITW_EAA_PROVIDER_BASE_URL="https://pre.eaa.wallet.ipzs.it"
Expand All @@ -100,9 +99,9 @@ ITW_BYPASS_IDENTITY_MATCH=YES
ITW_IDP_HINT_TEST=YES
# IPZS Privacy Policy URL
ITW_IPZS_PRIVACY_URL='https://io.italia.it/informativa-ipzs'
# ITW Trial Privacy Policy URL
# ITW Privacy Policy URL
ITW_PRIVACY_URL='https://io.italia.it/informativa-sperimentazione'
# ITW Trial TOS URL
# ITW TOS URL
ITW_TOS_URL='https://io.italia.it/tos-sperimentazione'
# ITW Documents on IO URL
ITW_DOCUMENTS_ON_IO_URL='https://io.italia.it/documenti-su-io'
5 changes: 2 additions & 3 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ WALLET_API_BASEURL='https://api.platform.pagopa.it'
# Wallet test/env RESTful API
WALLET_API_UAT_BASEURL='https://api.uat.platform.pagopa.it'
# IT Wallet
ITW_TRIAL_ID="01J2GN4TA8FB6DPTAX3T3YD6M1"
ITW_WALLET_PROVIDER_BASE_URL="https://api-app.io.pagopa.it/api/v1/wallet"
ITW_PID_PROVIDER_BASE_URL="https://eid.wallet.ipzs.it"
ITW_EAA_PROVIDER_BASE_URL="https://eaa.wallet.ipzs.it"
Expand All @@ -100,9 +99,9 @@ ITW_BYPASS_IDENTITY_MATCH=NO
ITW_IDP_HINT_TEST=NO
# IPZS Privacy Policy URL
ITW_IPZS_PRIVACY_URL='https://io.italia.it/informativa-ipzs'
# ITW Trial Privacy Policy URL
# ITW Privacy Policy URL
ITW_PRIVACY_URL='https://io.italia.it/informativa-sperimentazione'
# ITW Trial TOS URL
# ITW TOS URL
ITW_TOS_URL='https://io.italia.it/tos-sperimentazione'
# ITW Documents on IO URL
ITW_DOCUMENTS_ON_IO_URL='https://io.italia.it/documenti-su-io'
3 changes: 1 addition & 2 deletions ts/__mocks__/react-native-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default {
PREMIUM_MESSAGES_OPT_IN_ENABLED: "YES",
SCAN_ADDITIONAL_BARCODES_ENABLED: "YES",
ITW_TRIAL_ID: "baz"
SCAN_ADDITIONAL_BARCODES_ENABLED: "YES"
};
12 changes: 1 addition & 11 deletions ts/components/SectionStatus/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as O from "fp-ts/lib/Option";
import * as React from "react";
import configureMockStore from "redux-mock-store";
import { IOColors } from "@pagopa/io-app-design-system";
import * as pot from "@pagopa/ts-commons/lib/pot";
import { ToolEnum } from "../../../../definitions/content/AssistanceToolConfig";
import { Config } from "../../../../definitions/content/Config";
import {
Expand All @@ -15,9 +14,6 @@ import { SectionStatusKey } from "../../../store/reducers/backendStatus/sectionS
import { renderScreenWithNavigationStoreContext } from "../../../utils/testWrapper";
import { openWebUrl } from "../../../utils/url";
import SectionStatusComponent from "../index";
import { SubscriptionStateEnum } from "../../../../definitions/trial_system/SubscriptionState";
import { itwTrialId } from "../../../config";
import { TrialSystemState } from "../../../features/trialSystem/store/reducers";
import { PersistedFeaturesState } from "../../../features/common/store/reducers";
import { ItwLifecycleState } from "../../../features/itwallet/lifecycle/store/reducers";
import { ItWalletState } from "../../../features/itwallet/common/store/reducers";
Expand Down Expand Up @@ -67,10 +63,7 @@ const mockSectionStatusState = (
itWallet: {
lifecycle: ItwLifecycleState.ITW_LIFECYCLE_INSTALLED
} as ItWalletState
} as PersistedFeaturesState,
trialSystem: {
[itwTrialId]: pot.some(SubscriptionStateEnum.UNSUBSCRIBED)
} as TrialSystemState
} as PersistedFeaturesState
} as unknown as GlobalState);

const mockStore = configureMockStore();
Expand Down Expand Up @@ -185,9 +178,6 @@ describe("Section Status Component should return null", () => {
mockStore({
remoteConfig: O.none,
sectionStatus: O.none,
trialSystem: {
[itwTrialId]: pot.some(SubscriptionStateEnum.UNSUBSCRIBED)
} as TrialSystemState,
features: {
itWallet: {
lifecycle: ItwLifecycleState.ITW_LIFECYCLE_INSTALLED
Expand Down
2 changes: 0 additions & 2 deletions ts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { pipe } from "fp-ts/lib/function";
import * as O from "fp-ts/lib/Option";
import * as t from "io-ts";
import Config from "react-native-config";
import { TrialId } from "../definitions/trial_system/TrialId";

// default repository for fetching app content (e.g. services metadata)
const DEFAULT_CONTENT_REPO_URL =
Expand Down Expand Up @@ -238,7 +237,6 @@ export const walletApiUatBaseUrl = Config.WALLET_API_UAT_BASEURL;
export const defaultPin = "162534";

// IT Wallet
export const itwTrialId = Config.ITW_TRIAL_ID as TrialId;
export const itwWalletProviderBaseUrl = Config.ITW_WALLET_PROVIDER_BASE_URL;
export const itwGoogleCloudProjectNumber =
Config.ITW_GOOGLE_CLOUD_PROJECT_NUMBER;
Expand Down
35 changes: 0 additions & 35 deletions ts/features/itwallet/common/components/ItwUpcomingWalletBanner.tsx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import * as pot from "@pagopa/ts-commons/lib/pot";
import * as O from "fp-ts/lib/Option";
import _ from "lodash";
import * as React from "react";
import { createStore } from "redux";
import configureMockStore from "redux-mock-store";
import { ToolEnum } from "../../../../../../../definitions/content/AssistanceToolConfig";
import { Config } from "../../../../../../../definitions/content/Config";
import { SubscriptionStateEnum } from "../../../../../../../definitions/trial_system/SubscriptionState";
import { itwTrialId } from "../../../../../../config";
import ROUTES from "../../../../../../navigation/routes";
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
Expand All @@ -19,7 +16,6 @@ import { ItwDiscoveryBanner } from "../ItwDiscoveryBanner";
import { ItwDiscoveryBannerStandalone } from "../ItwDiscoveryBannerStandalone";

type RenderOptions = {
isItwTrial?: boolean;
isItwValid?: boolean;
isItwEnabled?: boolean;
};
Expand Down Expand Up @@ -55,7 +51,6 @@ describe("ItwDiscoveryBannerStandalone", () => {
});

test.each([
{ isItwTrial: false },
{ isItwEnabled: false },
{ isItwValid: true }
] as ReadonlyArray<RenderOptions>)(
Expand All @@ -71,19 +66,13 @@ describe("ItwDiscoveryBannerStandalone", () => {

const renderComponent = ({
isItwEnabled = true,
isItwTrial = true,
isItwValid = false
}: RenderOptions) => {
const globalState = appReducer(undefined, applicationChangeState("active"));

const mockStore = configureMockStore<GlobalState>();
const store: ReturnType<typeof mockStore> = mockStore(
_.merge(undefined, globalState, {
trialSystem: isItwTrial
? {
[itwTrialId]: pot.some(SubscriptionStateEnum.ACTIVE)
}
: {},
features: {
itWallet: isItwValid
? {
Expand Down
Loading

0 comments on commit 5edf322

Please sign in to comment.