Skip to content

Commit

Permalink
feat(Bonus Pagamenti Digitali): [#175949561] Display cashback future …
Browse files Browse the repository at this point in the history
…periods ("Inactive") in wallet (#2470)

* [#175949561] add inactive periods in the wallet

* [#175949561] change logic

* [#175949561] add test

* [#175949561] add comments

* [#175949561] add preview badge in bpd card preview

* Update ts/features/bonus/bpd/store/reducers/__test__/combiner.test.ts

Co-authored-by: Cristiano Tofani <[email protected]>

* Update ts/features/bonus/bpd/store/reducers/__test__/combiner.test.ts

Co-authored-by: Cristiano Tofani <[email protected]>

* Update ts/features/bonus/bpd/store/reducers/__test__/combiner.test.ts

Co-authored-by: Cristiano Tofani <[email protected]>

* Update ts/features/bonus/bpd/store/reducers/__test__/combiner.test.ts

Co-authored-by: Cristiano Tofani <[email protected]>

* Update ts/features/bonus/bpd/store/reducers/__test__/combiner.test.ts

Co-authored-by: Cristiano Tofani <[email protected]>

Co-authored-by: Cristiano Tofani <[email protected]>
Co-authored-by: Matteo Boschi <[email protected]>
  • Loading branch information
3 people authored Dec 2, 2020
1 parent f53125e commit 08e1e9d
Show file tree
Hide file tree
Showing 9 changed files with 376 additions and 254 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export const BpdCardComponent: React.FunctionComponent<Props> = (
} = calculateGraphicalState(props);

const isPeriodClosed = props.period.status === "Closed";
const isPeriodInactive = props.period.status === "Inactive";

const FullCard = () => (
<View style={[styles.row, styles.spaced]}>
Expand Down Expand Up @@ -351,10 +352,10 @@ export const BpdCardComponent: React.FunctionComponent<Props> = (
<IconFont name="io-lucchetto" size={16} color={IOColors.white} />
)}
<View hspacer={true} small={true} />
{isInGracePeriod ? (
{isInGracePeriod || isPeriodInactive ? (
<Badge style={styles.badgePreview}>
<Text semibold={true} style={styles.badgeTextBase} dark={true}>
{I18n.t("profile.preferences.list.wip")}
{statusBadge.label}
</Text>
</Badge>
) : (
Expand Down
6 changes: 0 additions & 6 deletions ts/features/bonus/bpd/navigation/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ export const navigateToBpdIbanInsertion = () =>
routeName: BPD_ROUTES.IBAN
});

// TODO: remove after the introduction of the bpd detail screen
export const navigateToBpdTestScreen = () =>
NavigationActions.navigate({
routeName: BPD_ROUTES.TEST
});

// Details

export const navigateToBpdDetails = (specificPeriod?: BpdPeriod) =>
Expand Down
7 changes: 1 addition & 6 deletions ts/features/bonus/bpd/navigation/navigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import { createStackNavigator } from "react-navigation";
import BpdDetailsScreen from "../screens/details/BpdDetailsScreen";
import BpdTransactionsScreen from "../screens/details/transaction/BpdTransactionsScreen";
import MainIbanScreen from "../screens/iban/MainIbanScreen";
import CtaLandingScreen from "../screens/onboarding/BpdCTAStartOnboardingScreen";
import BpdInformationScreen from "../screens/onboarding/BpdInformationScreen";
import DeclarationScreen from "../screens/onboarding/declaration/DeclarationScreen";
import EnrollPaymentMethodsScreen from "../screens/onboarding/EnrollPaymentMethodsScreen";
import LoadActivateBpdScreen from "../screens/onboarding/LoadActivateBpdScreen";
import LoadBpdActivationStatus from "../screens/onboarding/LoadBpdActivationStatus";
import NoPaymentMethodsAvailableScreen from "../screens/onboarding/NoPaymentMethodsAvailableScreen";
import TMPBpdScreen from "../screens/test/TMPBpdScreen";
import CtaLandingScreen from "../screens/onboarding/BpdCTAStartOnboardingScreen";
import BPD_ROUTES from "./routes";

const BpdNavigator = createStackNavigator(
Expand Down Expand Up @@ -41,10 +40,6 @@ const BpdNavigator = createStackNavigator(
[BPD_ROUTES.TRANSACTIONS]: {
screen: BpdTransactionsScreen
},
// TODO: remove after the introduction of the bpd detail screen
[BPD_ROUTES.TEST]: {
screen: TMPBpdScreen
},
[BPD_ROUTES.CTA_START_BPD]: {
screen: CtaLandingScreen
}
Expand Down
2 changes: 0 additions & 2 deletions ts/features/bonus/bpd/navigation/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const BPD_ROUTES = {
IBAN: "BPD_IBAN",
DETAILS: "BPD_DETAILS",
TRANSACTIONS: "BPD_TRANSACTIONS",
// TODO: remove after the introduction of the bpd detail screen
TEST: "BPD_TEST",
// used from message CTA
CTA_START_BPD: "CTA_START_BPD"
};
Expand Down
5 changes: 3 additions & 2 deletions ts/features/bonus/bpd/screens/details/BpdPeriodSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { BpdCardComponent } from "../../components/bpdCardComponent/BpdCardCompo
import { BpdPeriod } from "../../store/actions/periods";
import { bpdSelectPeriod } from "../../store/actions/selectedPeriod";
import { bpdAmountForSelectedPeriod } from "../../store/reducers/details/amounts";
import { bpdPeriodsAmountSnappedListSelector } from "../../store/reducers/details/combiner";
import { bpdPeriodsAmountWalletVisibleSelector } from "../../store/reducers/details/combiner";
import { bpdSelectedPeriodSelector } from "../../store/reducers/details/selectedPeriod";

export type Props = ReturnType<typeof mapDispatchToProps> &
Expand Down Expand Up @@ -82,7 +82,8 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
});

const mapStateToProps = (state: GlobalState) => ({
periodsWithAmount: bpdPeriodsAmountSnappedListSelector(state),
// ATM the rules of visualization of a period in the selector is the same of the wallet
periodsWithAmount: bpdPeriodsAmountWalletVisibleSelector(state),
selectedPeriod: bpdSelectedPeriodSelector(state),
selectedAmount: bpdAmountForSelectedPeriod(state)
});
Expand Down
135 changes: 0 additions & 135 deletions ts/features/bonus/bpd/screens/test/TMPBpdScreen.tsx

This file was deleted.

93 changes: 0 additions & 93 deletions ts/features/bonus/bpd/screens/test/TMPPeriods.tsx

This file was deleted.

Loading

0 comments on commit 08e1e9d

Please sign in to comment.