From 2468b86b86261a93ee2c5c2930829326d414b16e Mon Sep 17 00:00:00 2001 From: Gianluca Spada Date: Tue, 26 Nov 2024 13:03:27 +0100 Subject: [PATCH] chore: disable wallet activation --- package.json | 2 +- .../discovery/screens/ItwDiscoveryInfoScreen.tsx | 4 ++++ ts/store/reducers/backendStatus/remoteConfig.ts | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a94203c061f..e5c1b2ce470 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "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.48/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", diff --git a/ts/features/itwallet/discovery/screens/ItwDiscoveryInfoScreen.tsx b/ts/features/itwallet/discovery/screens/ItwDiscoveryInfoScreen.tsx index 31f378e1292..cbc1400f6d5 100644 --- a/ts/features/itwallet/discovery/screens/ItwDiscoveryInfoScreen.tsx +++ b/ts/features/itwallet/discovery/screens/ItwDiscoveryInfoScreen.tsx @@ -22,6 +22,8 @@ import { trackOpenItwTos } from "../../analytics"; import { itwPrivacyUrl, itwTosUrl } from "../../../../config"; +import { useIOSelector } from "../../../../store/hooks"; +import { isItwActivationDisabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig"; /** * This is the screen that shows the information about the discovery process @@ -34,6 +36,7 @@ const ItwDiscoveryInfoScreen = () => { const machineRef = ItwEidIssuanceMachineContext.useActorRef(); const isLoading = ItwEidIssuanceMachineContext.useSelector(selectIsLoading); + const itwActivationDisabled = useIOSelector(isItwActivationDisabledSelector); const handleContinuePress = () => { trackItWalletActivationStart(); @@ -79,6 +82,7 @@ const ItwDiscoveryInfoScreen = () => { type: "SingleButton", primary: { loading: isLoading, + disabled: itwActivationDisabled, label: I18n.t("global.buttons.continue"), accessibilityLabel: I18n.t("global.buttons.continue"), onPress: handleContinuePress diff --git a/ts/store/reducers/backendStatus/remoteConfig.ts b/ts/store/reducers/backendStatus/remoteConfig.ts index 91820fae200..4d56ce160aa 100644 --- a/ts/store/reducers/backendStatus/remoteConfig.ts +++ b/ts/store/reducers/backendStatus/remoteConfig.ts @@ -428,3 +428,18 @@ export const isItwFeedbackBannerEnabledSelector = createSelector( O.getOrElse(() => false) ) ); + +/** + * Return whether the Wallet activation is disabled. + * This is purely a "cosmetic" configuration to disable UI elements, + * it does not disable the entire IT Wallet feature. + */ +export const isItwActivationDisabledSelector = createSelector( + remoteConfigSelector, + remoteConfig => + pipe( + remoteConfig, + O.chainNullableK(config => config.itw.wallet_activation_disabled), + O.getOrElse(() => false) + ) +);