Skip to content

Commit

Permalink
chore: [IOBP-488] Refactor bonus features to remove cross feature dep…
Browse files Browse the repository at this point in the history
…endencies (#5397)

## Short description
This PR is preparatory to the removal of the legacy code associated with
SiciliaVola, Cashback and Bonus Vacanze features.
It consists of a major refactoring of the `bonus` feature, removing
cross dependency between features, and a relocation of some of the
components used in the IO app.

## List of changes proposed in this pull request
- Refactored `bonusReducer`, moved it outside `bonusVacanze` feature
folder
- Moved `features/bonus/bonusVacanze/models/RemoteValue` to
`common/models/RemoteValue`
- Moved `features/bonus/bonusVacanze/components/buttons/*` components to
`components/buttons/*`
- Moved
`features/bonus/bonusVacanze/components/loadingScreenComponent/LoadingErrorComponent`
to `components/LoadingErrorComponent`
- Moved `features/bonus/bonusVacanze/components/markdown/*` to
`components/markdown/*`
- Moved `features/bonus/bonusVacanze/components/FooterTopShadow` to
`components/FooterTopShadow`

## How to test
All tests should solve correctly, app should build correctly on all
platforms

---------

Co-authored-by: Martino Cesari Tomba <[email protected]>
Co-authored-by: Mario Perrotta <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2024
1 parent 6b76845 commit dfc75ab
Show file tree
Hide file tree
Showing 254 changed files with 588 additions and 528 deletions.
2 changes: 1 addition & 1 deletion ts/boot/configureStoreAndPersistor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
persistStore
} from "redux-persist";
import createSagaMiddleware from "redux-saga";
import { remoteUndefined } from "../features/bonus/bpd/model/RemoteValue";
import { remoteUndefined } from "../common/model/RemoteValue";
import { CURRENT_REDUX_LOLLIPOP_STORE_VERSION } from "../features/lollipop/store";
import {
initialLollipopState,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IOStyles } from "@pagopa/io-app-design-system";
import * as React from "react";
import { View, StyleSheet } from "react-native";
import { IOStyles } from "../../../../components/core/variables/IOStyles";
import variables from "../../../../theme/variables";
import { StyleSheet, View } from "react-native";
import variables from "../theme/variables";

// TODO: after bonus vacanze,create a common style for footer, atm duplicated in FooterWithButtons
const styles = StyleSheet.create({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import * as React from "react";
import { useEffect } from "react";
import { View, ActivityIndicator, SafeAreaView } from "react-native";
import { IOStyles } from "../../../../../components/core/variables/IOStyles";
import { InfoScreenComponent } from "../../../../../components/infoScreen/InfoScreenComponent";
import GenericErrorComponent from "../../../../../components/screens/GenericErrorComponent";
import { WithTestID } from "../../../../../types/WithTestID";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { ActivityIndicator, SafeAreaView, View } from "react-native";
import { WithTestID } from "../types/WithTestID";
import { setAccessibilityFocus } from "../utils/accessibility";
import { IOStyles } from "./core/variables/IOStyles";
import { InfoScreenComponent } from "./infoScreen/InfoScreenComponent";
import GenericErrorComponent from "./screens/GenericErrorComponent";

export type LoadingErrorProps = WithTestID<{
isLoading: boolean;
Expand Down
2 changes: 1 addition & 1 deletion ts/components/PinCreationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ButtonOutline, IOColors, VSpacer } from "@pagopa/io-app-design-system";
import * as React from "react";
import { ScrollView, StyleSheet, View } from "react-native";
import { defaultPin } from "../config";
import { confirmButtonProps } from "../features/bonus/bonusVacanze/components/buttons/ButtonConfigurations";
import { isValidPinNumber } from "../features/fastLogin/utils/pinPolicy";
import I18n from "../i18n";
import { trackPinError } from "../screens/profile/analytics";
Expand All @@ -12,6 +11,7 @@ import { PinString } from "../types/PinString";
import { getFlowType } from "../utils/analytics";
import { PIN_LENGTH_SIX } from "../utils/constants";
import { isDevEnv } from "../utils/environment";
import { confirmButtonProps } from "./buttons/ButtonConfigurations";
import { LabelledItem } from "./LabelledItem";
import { InfoBox } from "./box/InfoBox";
import { Body } from "./core/typography/Body";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IOColors, IOIcons } from "@pagopa/io-app-design-system";
import { BlockButtonProps } from "../../../../../components/ui/BlockButtons";
import I18n from "../../../../../i18n";
import { BlockButtonProps } from "../ui/BlockButtons";
import I18n from "../../i18n";

/**
* A common configuration for all the buttons that represent a cancel/abort action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Text as NBButtonText } from "native-base";
import * as React from "react";
import { View, StyleSheet } from "react-native";
import { HSpacer, Icon, VSpacer } from "@pagopa/io-app-design-system";
import ButtonDefaultOpacity from "../../../../../components/ButtonDefaultOpacity";
import { BlockButtonProps } from "../../../../../components/ui/BlockButtons";
import ButtonDefaultOpacity from "../ButtonDefaultOpacity";
import { BlockButtonProps } from "../ui/BlockButtons";
import { FooterTopShadow } from "../FooterTopShadow";

const styles = StyleSheet.create({
Expand Down
2 changes: 1 addition & 1 deletion ts/components/error/WorkunitGenericFailure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SafeAreaView } from "react-native";
import { connect } from "react-redux";
import { Dispatch } from "redux";
import image from "../../../img/servicesStatus/error-detail-icon.png";
import { cancelButtonProps } from "../../features/bonus/bonusVacanze/components/buttons/ButtonConfigurations";
import { cancelButtonProps } from "../buttons/ButtonConfigurations";
import I18n from "../../i18n";
import { navigateBack } from "../../store/actions/navigation";
import { IOStyles } from "../core/variables/IOStyles";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import FooterWithButtons from "../../../../../components/ui/FooterWithButtons";
import FooterWithButtons from "../ui/FooterWithButtons";
import { cancelButtonProps } from "../buttons/ButtonConfigurations";

export type OnCancelProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import FooterWithButtons from "../../../../../components/ui/FooterWithButtons";
import FooterWithButtons from "../ui/FooterWithButtons";
import {
cancelButtonProps,
confirmButtonProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useEffect, useState } from "react";
import * as React from "react";
import { View, StyleSheet } from "react-native";
import BaseScreenComponent from "../../../../../components/screens/BaseScreenComponent";
import { EdgeBorderComponent } from "../../../../../components/screens/EdgeBorderComponent";
import ScreenContent from "../../../../../components/screens/ScreenContent";
import Markdown from "../../../../../components/ui/Markdown";
import themeVariables from "../../../../../theme/variables";
import BaseScreenComponent from "../screens/BaseScreenComponent";
import { EdgeBorderComponent } from "../screens/EdgeBorderComponent";
import ScreenContent from "../screens/ScreenContent";
import Markdown from "../ui/Markdown";
import themeVariables from "../../theme/variables";

/**
* TODO Rename the title prop in the BaseScreenComponent to navigationTitle
Expand Down
2 changes: 1 addition & 1 deletion ts/components/screens/LogoutScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { HSpacer } from "@pagopa/io-app-design-system";
import { Dispatch } from "../../store/actions/types";
import { logoutRequest } from "../../store/actions/authentication";
import I18n from "../../i18n";
import { LoadingErrorComponent } from "../../features/bonus/bonusVacanze/components/loadingErrorScreen/LoadingErrorComponent";
import { LoadingErrorComponent } from "../LoadingErrorComponent";
import BaseScreenComponent from "./BaseScreenComponent";

type Props = ReturnType<typeof mapDispatchToProps>;
Expand Down
2 changes: 1 addition & 1 deletion ts/components/wallet/OutcomeCodeMessageComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import FooterWithButtons from "../ui/FooterWithButtons";
import {
cancelButtonProps,
confirmButtonProps
} from "../../features/bonus/bonusVacanze/components/buttons/ButtonConfigurations";
} from "../buttons/ButtonConfigurations";
import { OutcomeCode } from "../../types/outcomeCode";
import { getFullLocale } from "../../utils/locale";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BonusAvailable } from "../../../../../definitions/content/BonusAvailable";
import { BonusesAvailable } from "../../../../../definitions/content/BonusesAvailable";
import { BonusAvailable } from "../../../../definitions/content/BonusAvailable";
import { BonusesAvailable } from "../../../../definitions/content/BonusesAvailable";
import {
ID_BONUS_VACANZE_TYPE,
ID_BPD_TYPE,
ID_CGN_TYPE
} from "../utils/bonus";
import { BonusVisibilityEnum } from "../../../../../definitions/content/BonusVisibility";
} from "../common/utils";
import { BonusVisibilityEnum } from "../../../../definitions/content/BonusVisibility";

export const contentBonusVacanzeIT = `#### Chi può richiederlo?
Expand Down
Loading

0 comments on commit dfc75ab

Please sign in to comment.