Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Bonus Pagamenti Digitali): [#175883232] Send BPay actions to mixpanel #2678

Merged
merged 27 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0d8b12b
[#175889351] wip
fabriziofff Jan 5, 2021
8c6235d
[#175889351] Merge remote-tracking branch 'origin/master' into 175889…
fabriziofff Jan 5, 2021
f9c08c8
[#175889351] add missing navigation
fabriziofff Jan 5, 2021
80658c2
[#175889351] fix compile
fabriziofff Jan 5, 2021
d07d30a
[#175889351] renaming
fabriziofff Jan 5, 2021
42f43de
[#175889351] Merge remote-tracking branch 'origin/master' into 175889…
fabriziofff Jan 5, 2021
ca4c982
[#175889351] remove navigation bar
fabriziofff Jan 5, 2021
a5f35e1
[#175889351] fix and link with data
fabriziofff Jan 5, 2021
c68e727
[#175889351] remove unused import
fabriziofff Jan 5, 2021
d95a4f9
[#175889351] remove all the bancomat reference
fabriziofff Jan 5, 2021
a3b7efc
[#175889351] fix add bpay
fabriziofff Jan 5, 2021
d637f87
[#175889351] fix ts
fabriziofff Jan 5, 2021
fe008d9
Merge branch 'master' into 175889351-action-store-reducer-bpay
Undermaken Jan 7, 2021
4652180
Update ts/features/wallet/onboarding/bancomatPay/screens/add-account/…
fabriziofff Jan 7, 2021
d360694
[#175889351] simplify code
fabriziofff Jan 7, 2021
b63b150
[#175889351] Merge remote-tracking branch 'origin/175889351-action-st…
fabriziofff Jan 7, 2021
a862043
[#175889351] add sectionstatus
fabriziofff Jan 7, 2021
632f570
[#175889351] simplify code
fabriziofff Jan 7, 2021
3185aec
[#175883232] add mixpanel
fabriziofff Jan 7, 2021
04c9c0a
[#175883232] remove eslint complexity
fabriziofff Jan 7, 2021
cafdcc5
[#175883232] fix action tap
fabriziofff Jan 7, 2021
b371844
[#175883232] restore eslint
fabriziofff Jan 7, 2021
0df5bac
Merge branch 'master' into 175889351-action-store-reducer-bpay
fabriziofff Jan 7, 2021
a370f68
[#175889351] Merge remote-tracking branch 'origin/master' into 175889…
fabriziofff Jan 7, 2021
0e4c5fd
[#175883232] Merge branch '175889351-action-store-reducer-bpay' into …
fabriziofff Jan 7, 2021
4e6caae
[#175889351] Merge branch 'master' of github.com:pagopa/io-app into 1…
Undermaken Jan 8, 2021
441d4c3
[#175883232] Merge branch '175889351-action-store-reducer-bpay' of gi…
Undermaken Jan 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ts/features/bonus/bpd/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const trackAction = (mp: NonNullable<typeof mixpanel>) => (
case getType(bpdAllData.failure):
return mp.track(action.type, { reason: action.payload.message });

// iban
// IBAN
case getType(bpdIbanInsertionStart):
case getType(bpdIbanInsertionContinue):
case getType(bpdIbanInsertionCancel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from "../store/actions";
import { isTimeoutError } from "../../../../../utils/errors";

// eslint-disable-next-line complexity
const trackAction = (mp: NonNullable<typeof mixpanel>) => (
action: Action
): Promise<any> => {
Expand Down
46 changes: 46 additions & 0 deletions ts/features/wallet/onboarding/bancomatPay/analytics/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { getType } from "typesafe-actions";
import { mixpanel } from "../../../../../mixpanel";
import { Action } from "../../../../../store/actions/types";
import { isTimeoutError } from "../../../../../utils/errors";
import {
addBPayToWallet,
searchUserBPay,
walletAddBPayBack,
walletAddBPayCancel,
walletAddBPayCompleted,
walletAddBPayStart
} from "../store/actions";

export const trackBPayAction = (mp: NonNullable<typeof mixpanel>) => (
action: Action
): Promise<any> => {
switch (action.type) {
case getType(walletAddBPayStart):
case getType(walletAddBPayCompleted):
case getType(walletAddBPayCancel):
case getType(walletAddBPayBack):
case getType(addBPayToWallet.request):
case getType(addBPayToWallet.success):
return mp.track(action.type);
case getType(searchUserBPay.request):
return mp.track(action.type, { abi: action.payload ?? "all" });
case getType(searchUserBPay.success):
return mp.track(action.type, {
count: action.payload.length,
serviceStateList: action.payload.map(bPay =>
bPay.serviceState?.toString()
)
});

case getType(addBPayToWallet.failure):
return mp.track(action.type, { reason: action.payload.message });

case getType(searchUserBPay.failure):
return mp.track(action.type, {
reason: isTimeoutError(action.payload)
? action.payload.kind
: action.payload.value.message
});
}
return Promise.resolve();
};
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const BPaySearchStartScreen = (props: Props): React.ReactElement => (
<SafeAreaView style={IOStyles.flex}>
<Content style={IOStyles.flex} />
<SectionStatusComponent sectionKey={"bancomatpay"} />
{renderFooterButtons(props.onCancel, props.searchBPay)}
{renderFooterButtons(props.onCancel, () => props.searchBPay())}
</SafeAreaView>
</BaseScreenComponent>
);
Expand Down
10 changes: 6 additions & 4 deletions ts/store/middlewares/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
isActivationResponseTrackable,
isEligibilityResponseTrackable
} from "../../features/bonus/bonusVacanze/utils/bonus";
import { trackBPayAction } from "../../features/wallet/onboarding/bancomatPay/analytics";
import { mixpanel } from "../../mixpanel";
import { getCurrentRouteName } from "../../utils/navigation";
import {
Expand Down Expand Up @@ -441,10 +442,11 @@ export const actionTracking = (_: MiddlewareAPI) => (next: Dispatch) => (
if (mixpanel !== undefined) {
// call mixpanel tracking only after we have initialized mixpanel with the
// API token
trackAction(mixpanel)(action).then(constNull, constNull);
trackBpdAction(mixpanel)(action).then(constNull, constNull);
trackBancomatAction(mixpanel)(action).then(constNull, constNull);
trackSatispayAction(mixpanel)(action).then(constNull, constNull);
void trackAction(mixpanel)(action);
void trackBpdAction(mixpanel)(action);
void trackBancomatAction(mixpanel)(action);
void trackSatispayAction(mixpanel)(action);
void trackBPayAction(mixpanel)(action);
}
return next(action);
};
Expand Down