-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Bonus Pagamenti Digitali): [#175883232] Send BPay actions to mix…
…panel (#2678) * [#175889351] wip * [#175889351] add missing navigation * [#175889351] fix compile * [#175889351] renaming * [#175889351] remove navigation bar * [#175889351] fix and link with data * [#175889351] remove unused import * [#175889351] remove all the bancomat reference * [#175889351] fix add bpay * [#175889351] fix ts * Update ts/features/wallet/onboarding/bancomatPay/screens/add-account/AddBPayScreen.tsx Co-authored-by: Matteo Boschi <[email protected]> * [#175889351] simplify code * [#175889351] add sectionstatus * [#175889351] simplify code * [#175883232] add mixpanel * [#175883232] remove eslint complexity * [#175883232] fix action tap * [#175883232] restore eslint Co-authored-by: Matteo Boschi <[email protected]>
- Loading branch information
1 parent
3f9bb70
commit 44f2978
Showing
6 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
ts/features/wallet/onboarding/bancomatPay/analytics/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters