Skip to content

Commit

Permalink
Merge branch 'master' into IOCOM-2087_reminderBanner
Browse files Browse the repository at this point in the history
  • Loading branch information
Vangaorth authored Mar 3, 2025
2 parents d17619e + 8e26261 commit c9af59c
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 943 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ exports[`featuresPersistor should match snapshot 1`] = `
"LV_EXPIRATION_REMINDER": true,
"PUSH_NOTIFICATIONS_REMINDER": true,
"SEND_ACTIVATION_REMINDER": false,
"SETTINGS_DISCOVERY": true,
},
"loginFeatures": {
"cieLogin": {
Expand Down Expand Up @@ -297,9 +296,7 @@ exports[`featuresPersistor should match snapshot 1`] = `
"kind": "PotNone",
},
},
"profileSettings": {
"hasUserAcknowledgedSettingsBanner": false,
},
"profileSettings": {},
"services": {
"details": {
"byId": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo } from "react";
import { Alert, Body } from "@pagopa/io-app-design-system";
import { Alert } from "@pagopa/io-app-design-system";
import I18n from "../../../../../i18n.ts";
import { StoredCredential } from "../../../common/utils/itwTypesUtils.ts";
import {
Expand Down Expand Up @@ -121,7 +121,7 @@ const IssuerDynamicErrorAlert = ({ message }: IssuerDynamicErrorAlertProps) => {
const bottomSheet = useIOBottomSheetAutoresizableModal(
{
title: localizedMessage.title,
component: <Body>{localizedMessage.description}</Body>
component: <IOMarkdown content={localizedMessage.description} />
},
128
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ exports[`landingScreenBannersReducer should match snapshot: undefined_no_action
"LV_EXPIRATION_REMINDER": true,
"PUSH_NOTIFICATIONS_REMINDER": true,
"SEND_ACTIVATION_REMINDER": false,
"SETTINGS_DISCOVERY": true,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ process.env.NODE_ENV = "test";
const mockState = {
features: {
landingBanners: {
ITW_DISCOVERY: true,
SETTINGS_DISCOVERY: false
ITW_DISCOVERY: true
}
}
} as GlobalState;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { ReactElement } from "react";
import { SettingsDiscoveryBanner } from "../../../screens/profile/components/SettingsDiscoveryBanner";
import { GlobalState } from "../../../store/reducers/types";
import { ItwDiscoveryBanner } from "../../itwallet/common/components/discoveryBanner/ItwDiscoveryBanner";
import { isItwPersistedDiscoveryBannerRenderableSelector } from "../../itwallet/common/store/selectors";
import { LoginExpirationBanner } from "../../login/preferences/components/LoginExpirationBanner";
import { isSessionExpirationBannerRenderableSelector } from "../../login/preferences/store/selectors";
import { PNActivationReminderBanner } from "../../pn/components/PNActivationReminderBanner";
import { hasUserAcknowledgedSettingsBannerSelector } from "../../profileSettings/store/selectors";
import { PushNotificationsBanner } from "../../pushNotifications/components/PushNotificationsBanner";
import { isPushNotificationsBannerRenderableSelector } from "../../pushNotifications/store/selectors";

Expand All @@ -25,7 +23,6 @@ export type LandingScreenBannerId =
export const LANDING_SCREEN_BANNERS_ENABLED_MAP = {
PUSH_NOTIFICATIONS_REMINDER: true,
ITW_DISCOVERY: true,
SETTINGS_DISCOVERY: true,
LV_EXPIRATION_REMINDER: true,
SEND_ACTIVATION_REMINDER: false
} as const;
Expand All @@ -43,13 +40,6 @@ export const landingScreenBannerMap: BannerMapById = {
),
isRenderableSelector: isItwPersistedDiscoveryBannerRenderableSelector
},
SETTINGS_DISCOVERY: {
component: closeHandler => (
<SettingsDiscoveryBanner handleOnClose={closeHandler} />
),
isRenderableSelector: (state: GlobalState) =>
!hasUserAcknowledgedSettingsBannerSelector(state)
},
LV_EXPIRATION_REMINDER: {
component: closeHandler => (
<LoginExpirationBanner handleOnClose={closeHandler} />
Expand Down
12 changes: 0 additions & 12 deletions ts/features/profileSettings/store/actions/index.ts

This file was deleted.

28 changes: 11 additions & 17 deletions ts/features/profileSettings/store/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ import {
} from "redux-persist";
import AsyncStorage from "@react-native-async-storage/async-storage";
import _ from "lodash";
import { setHasUserAcknowledgedSettingsBanner } from "../actions";
import { Action } from "../../../../store/actions/types";
import { differentProfileLoggedIn } from "../../../../store/actions/crossSessions";
import { isDevEnv } from "../../../../utils/environment";

export type ProfileSettingsState = {
hasUserAcknowledgedSettingsBanner: boolean;
};
// eslint-disable-next-line @typescript-eslint/ban-types
export type ProfileSettingsState = {};

export const profileSettingsReducerInitialState = {
hasUserAcknowledgedSettingsBanner: false
};
export const profileSettingsReducerInitialState = {};

const profileSettingsReducer = (
state: ProfileSettingsState = profileSettingsReducerInitialState,
Expand All @@ -29,38 +25,36 @@ const profileSettingsReducer = (
case getType(differentProfileLoggedIn): {
return profileSettingsReducerInitialState;
}
case getType(setHasUserAcknowledgedSettingsBanner): {
return {
...state,
hasUserAcknowledgedSettingsBanner: action.payload
};
}
default:
return state;
}
};
const CURRENT_REDUX_PROFILE_SETTINGS_STORE_VERSION = 1;
const CURRENT_REDUX_PROFILE_SETTINGS_STORE_VERSION = 2;

const migrations: MigrationManifest = {
// we changed the way we compute the installation ID
"0": (state): ProfileSettingsState & PersistPartial => {
"0": state => {
const prevState = state as ProfileSettingsState & PersistPartial;
return {
...prevState,
hasUserAcknowledgedSettingsBanner: false
};
},
"1": (state): ProfileSettingsState & PersistPartial => {
"1": state => {
const prevState = state as ProfileSettingsState & PersistPartial;
return _.omit(prevState, "showProfileBanner");
},
"2": state => {
const prevState = state as ProfileSettingsState & PersistPartial;
return _.omit(prevState, "hasUserAcknowledgedSettingsBanner");
}
};
const persistConfig: PersistConfig = {
key: "profileSettings",
storage: AsyncStorage,
migrate: createMigrate(migrations, { debug: isDevEnv }),
version: CURRENT_REDUX_PROFILE_SETTINGS_STORE_VERSION,
whitelist: ["hasUserAcknowledgedSettingsBanner"]
whitelist: []
};

export const profileSettingsReducerPersistor = persistReducer(
Expand Down
4 changes: 0 additions & 4 deletions ts/features/profileSettings/store/selectors/index.ts

This file was deleted.

8 changes: 2 additions & 6 deletions ts/screens/onboarding/OnboardingShareDataScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,13 @@ const OnboardingShareDataScreen = (): ReactElement => {
// We wait some time to allow mixpanel to be enabled
// before tracking the event
setTimeout(() => {
void trackMixpanelSetEnabled(
true,
getFlowType(false, isFirstOnBoarding),
store.getState()
);
void trackMixpanelSetEnabled(true, flow, store.getState());
}, 1000);
},
testID: "share-data-confirm-button"
}
}),
[isFirstOnBoarding, present, store, dispatch]
[flow, present, store, dispatch]
);

return (
Expand Down
67 changes: 0 additions & 67 deletions ts/screens/profile/components/SettingsDiscoveryBanner.tsx

This file was deleted.

This file was deleted.

Loading

0 comments on commit c9af59c

Please sign in to comment.