Skip to content

Commit

Permalink
chore: [IOCOM-1595] New messages flows as default (#5984)
Browse files Browse the repository at this point in the history
## Short description
This PR unlinks the old message section in favour of the new one.

## List of changes proposed in this pull request
- All navigators have been updated in order to only link the new message
flows
- Fixed bottom tab bar style so that it does not change upon tab
switching
- Blocked catching of user events when tapping a service logo in the new
message home

Please note that old code is unliked but it will be removed in a future
PR.

## How to test
Using the io-dev-api-server, check that any kind of message is rendered
with its proper new DS flow
  • Loading branch information
Vangaorth authored Jul 17, 2024
1 parent 4ae3af1 commit d9fc8f6
Show file tree
Hide file tree
Showing 18 changed files with 201 additions and 285 deletions.
1 change: 0 additions & 1 deletion locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ profile:
itWalletTest: IT Wallet
designSystemEnvironment: Experimental Design System
newWalletSection: New wallet section
newHomeSection: New messages home
appVersion: Version
backendVersion: Backend Version
debugMode: Debug mode
Expand Down
1 change: 0 additions & 1 deletion locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ profile:
titleSection: Partecipa alla sperimentazione
designSystemEnvironment: Design System sperimentale
newWalletSection: Nuova sezione portafoglio
newHomeSection: Nuova home messaggi
appVersion: Versione
backendVersion: Versione Backend
debugMode: Modalità debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ exports[`Check the addition for new fields to the persisted store. If one of thi
"isIdPayTestEnabled": false,
"isItWalletTestEnabled": false,
"isMixpanelEnabled": null,
"isNewHomeSectionEnabled": false,
"isNewWalletSectionEnabled": false,
"isPagoPATestEnabled": false,
"isPnTestEnabled": false,
Expand Down
10 changes: 7 additions & 3 deletions ts/boot/configureStoreAndPersistor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { configureReactotron } from "./configureRectotron";
/**
* Redux persist will migrate the store to the current version
*/
const CURRENT_REDUX_STORE_VERSION = 31;
const CURRENT_REDUX_STORE_VERSION = 32;

// see redux-persist documentation:
// https://github.com/rt2zz/redux-persist/blob/master/docs/migrations.md
Expand Down Expand Up @@ -409,7 +409,7 @@ const migrations: MigrationManifest = {
}
} as GlobalState),
// Version 30
// Adds new wallet section FF
// Adds new Messages Home FF
"30": (state: PersistedState) =>
merge(state, {
persistedPreferences: {
Expand All @@ -418,7 +418,11 @@ const migrations: MigrationManifest = {
}),
// version 31
// remove userMetadata from persisted state
"31": (state: PersistedState) => omit(state, "userMetadata")
"31": (state: PersistedState) => omit(state, "userMetadata"),
// Version 32
// Removes new Messages Home FF
"32": (state: PersistedState) =>
omit(state, "persistedPreferences.isNewHomeSectionEnabled")
};

const isDebuggingInChrome = isDevEnv && !!window.navigator.userAgent;
Expand Down
6 changes: 1 addition & 5 deletions ts/features/euCovidCert/navigation/navigator.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { createStackNavigator } from "@react-navigation/stack";
import * as React from "react";
import { isGestureEnabled } from "../../../utils/navigation";
import { EuCovidCertificateRouterScreen } from "../screens/EuCovidCertificateRouterScreen";
import { EuCovidCertMarkdownDetailsScreen } from "../screens/valid/EuCovidCertMarkdownDetailsScreen";
import { EuCovidCertQrCodeFullScreen } from "../screens/valid/EuCovidCertQrCodeFullScreen";
Expand All @@ -10,10 +9,7 @@ import EUCOVIDCERT_ROUTES from "./routes";
const Stack = createStackNavigator<EUCovidCertParamsList>();

export const EUCovidCertStackNavigator = () => (
<Stack.Navigator
initialRouteName={EUCOVIDCERT_ROUTES.CERTIFICATE}
screenOptions={{ gestureEnabled: isGestureEnabled, headerShown: true }}
>
<Stack.Navigator initialRouteName={EUCOVIDCERT_ROUTES.CERTIFICATE}>
<Stack.Screen
name={EUCOVIDCERT_ROUTES.CERTIFICATE}
component={EuCovidCertificateRouterScreen}
Expand Down
14 changes: 10 additions & 4 deletions ts/features/messages/components/Home/ArchiveRestoreBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from "../../store/actions/archiving";
import { MessageListCategory } from "../../types/messageListCategory";
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
import { useBottomTabNavigatorStyle } from "../../../../hooks/useBottomTabNavigatorStyle";

const styles = StyleSheet.create({
container: {
Expand All @@ -46,6 +47,8 @@ export const ArchiveRestoreBar = () => {
const store = useIOStore();
const tabNavigation = useIOTabNavigation();

const tabBarStyle = useBottomTabNavigatorStyle();

const isArchivingDisabled = useIOSelector(isArchivingDisabledSelector);
const shownCategory = useIOSelector(shownMessageCategorySelector);

Expand All @@ -58,11 +61,14 @@ export const ArchiveRestoreBar = () => {

useEffect(() => {
tabNavigation.setOptions({
tabBarStyle: {
display: isArchivingDisabled ? "flex" : "none"
}
tabBarStyle: [
tabBarStyle,
{
display: isArchivingDisabled ? "flex" : "none"
}
]
});
}, [isArchivingDisabled, tabNavigation]);
}, [isArchivingDisabled, tabBarStyle, tabNavigation]);

if (isArchivingDisabled) {
return null;
Expand Down
9 changes: 8 additions & 1 deletion ts/features/messages/components/Home/DS/MessageListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ export const MessageListItem = ({
) : (
<Avatar logoUri={serviceLogos} size="small" />
)}
<View style={StyleSheet.absoluteFill}>
<View
style={[
StyleSheet.absoluteFill,
{
pointerEvents: "none"
}
]}
>
<AnimatedMessageCheckbox checked={selected} />
</View>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,18 @@ exports[`WrappedMessageListItem should match snapshot, from SEND, read message 1
</View>
<View
style={
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"pointerEvents": "none",
},
]
}
>
<View
Expand Down Expand Up @@ -1513,13 +1518,18 @@ exports[`WrappedMessageListItem should match snapshot, from SEND, unread message
</View>
<View
style={
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"pointerEvents": "none",
},
]
}
>
<View
Expand Down Expand Up @@ -2716,13 +2726,18 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, contains p
</View>
<View
style={
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"pointerEvents": "none",
},
]
}
>
<View
Expand Down Expand Up @@ -3774,13 +3789,18 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, contains p
</View>
<View
style={
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"pointerEvents": "none",
},
]
}
>
<View
Expand Down Expand Up @@ -4887,13 +4907,18 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, contains u
</View>
<View
style={
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"pointerEvents": "none",
},
]
}
>
<View
Expand Down Expand Up @@ -5820,13 +5845,18 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, contains u
</View>
<View
style={
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"pointerEvents": "none",
},
]
}
>
<View
Expand Down Expand Up @@ -6687,13 +6717,18 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, not a paym
</View>
<View
style={
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"pointerEvents": "none",
},
]
}
>
<View
Expand Down Expand Up @@ -7499,13 +7534,18 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, not a paym
</View>
<View
style={
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"pointerEvents": "none",
},
]
}
>
<View
Expand Down
18 changes: 3 additions & 15 deletions ts/features/messages/components/MessageDetail/MessageMarkdown.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
/**
* A specialized Markdown component that sets a specific CSS style
*/

import { Omit } from "@pagopa/ts-commons/lib/types";
import React from "react";
import customVariables from "../../../../theme/variables";
import {
Markdown,
MarkdownProps
} from "../../../../components/ui/Markdown/Markdown";
import { isDesignSystemEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { useIOSelector } from "../../../../store/hooks";
import LegacyMarkdown from "../../../../components/ui/Markdown/LegacyMarkdown";

type Props = Omit<MarkdownProps, "cssStyle">;

Expand Down Expand Up @@ -66,11 +59,6 @@ img {
}
`;

export const MessageMarkdown = (props: Props) => {
const isDesignSystemEnabled = useIOSelector(isDesignSystemEnabledSelector);
return isDesignSystemEnabled ? (
<Markdown {...props} cssStyle={MESSAGE_CSS_STYLE} />
) : (
<LegacyMarkdown {...props} cssStyle={MESSAGE_CSS_STYLE} />
);
};
export const MessageMarkdown = (props: Props) => (
<Markdown {...props} cssStyle={MESSAGE_CSS_STYLE} />
);
Loading

0 comments on commit d9fc8f6

Please sign in to comment.