Skip to content

Commit

Permalink
chore(Bonus Pagamenti Digitali): [#176816895] Add feature flag for co…
Browse files Browse the repository at this point in the history
…badge workflow (#2786)

* [#176738620] add choosetype screen

* [#176738620] rename action

* [#176738620] remove back from KO screens

* [#176738620] add legacy support to navigation

* [#176738620] add choosetype screen

* [#176738620] rename action

* [#176738620] remove back from KO screens

* [#176738620] add legacy support to navigation

* [#176738620] fix eslint

* [#176816895] add ff for cobadge

* Update ts/features/wallet/component/NewMethodAddedNotifier.tsx

* [#176816895] remove useless object

Co-authored-by: Simone <[email protected]>
Co-authored-by: Matteo Boschi <[email protected]>
  • Loading branch information
3 people authored Feb 5, 2021
1 parent 28bb25e commit fad5740
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ BPD_API_SIT='https://bpd-dev.azure-api.net'
BPD_API_UAT='https://test.cstar.pagopa.it'
# CGN configuration
CGN_ENABLED=NO

COBADGE_ENABLED=NO
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ BPD_API_SIT='https://bpd-dev.azure-api.net'
BPD_API_UAT='https://test.cstar.pagopa.it'
# CGN configuration
CGN_ENABLED=NO
COBADGE_ENABLED=NO
2 changes: 2 additions & 0 deletions ts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export const isPlaygroundsEnabled: boolean =
// CGN Feature Flag
export const cgnEnabled: boolean = Config.CGN_ENABLED === "YES";

export const cobadgeEnabled: boolean = Config.COBADGE_ENABLED === "YES";

// version of ToS
export const tosVersion: NonNegativeNumber = 2.1 as NonNegativeNumber;

Expand Down
13 changes: 9 additions & 4 deletions ts/features/wallet/bancomat/screen/BancomatDetailScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { none } from "fp-ts/lib/Option";
import { Button, View } from "native-base";
import * as React from "react";
import { StyleSheet } from "react-native";
Expand All @@ -9,8 +10,10 @@ import { IOColors } from "../../../../components/core/variables/IOColors";
import { IOStyles } from "../../../../components/core/variables/IOStyles";
import ItemSeparatorComponent from "../../../../components/ItemSeparatorComponent";
import DarkLayout from "../../../../components/screens/DarkLayout";
import { cobadgeEnabled } from "../../../../config";
import I18n from "../../../../i18n";
import { mixpanelTrack } from "../../../../mixpanel";
import { navigateToWalletAddPaymentMethod } from "../../../../store/actions/navigation";
import { deleteWalletRequest } from "../../../../store/actions/wallet/wallets";
import { GlobalState } from "../../../../store/reducers/types";
import { BancomatPaymentMethod } from "../../../../types/pagopa";
Expand Down Expand Up @@ -133,10 +136,12 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
),
addCoBadge: (abi: string) =>
dispatch(
navigateToOnboardingCoBadgeChooseTypeStartScreen({
abi,
legacyAddCreditCardBack: 1
})
cobadgeEnabled
? navigateToOnboardingCoBadgeChooseTypeStartScreen({
abi,
legacyAddCreditCardBack: 1
})
: navigateToWalletAddPaymentMethod({ inPayment: none })
)
});

Expand Down
7 changes: 6 additions & 1 deletion ts/features/wallet/component/NewMethodAddedNotifier.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { none } from "fp-ts/lib/Option";
import * as React from "react";
import { useState } from "react";
import { connect } from "react-redux";
import { Dispatch } from "redux";
import { cobadgeEnabled } from "../../../config";
import I18n from "../../../i18n";
import { navigateToWalletAddPaymentMethod } from "../../../store/actions/navigation";
import { GlobalState } from "../../../store/reducers/types";
import {
bottomSheetContent,
Expand Down Expand Up @@ -68,7 +71,9 @@ const NewPaymentMethodAddedNotifier = (props: Props) => {
const mapDispatchToProps = (dispatch: Dispatch) => ({
startCoBadgeOnboarding: () =>
dispatch(
navigateToOnboardingCoBadgeChooseTypeStartScreen({})
cobadgeEnabled
? navigateToOnboardingCoBadgeChooseTypeStartScreen({})
: navigateToWalletAddPaymentMethod({ inPayment: none })
)
});

Expand Down

0 comments on commit fad5740

Please sign in to comment.