Skip to content

Commit

Permalink
fix(cya): rename card name property on button press event (#4239)
Browse files Browse the repository at this point in the history
### Description

The `name` property doesn't show up on mixpanel because its reserved.
Updating per request on this slack thread:
https://valora-app.slack.com/archives/C02KBT0DAHJ/p1695856378942009?thread_ts=1695855941.287799&cid=C02KBT0DAHJ

### Test plan

CI only

### Related issues

N/A

### Backwards compatibility

N/A
  • Loading branch information
satish-ravi authored Sep 28, 2023
1 parent d888060 commit 920def2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/analytics/Properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ interface OnboardingEventsProperties {
[OnboardingEvents.protect_wallet_copy_phrase]: undefined
[OnboardingEvents.protect_wallet_complete]: undefined
[OnboardingEvents.cya_button_press]: {
name: string
cardName: AdventureCardName
position: number
cardOrder: AdventureCardName[]
}
Expand Down
4 changes: 2 additions & 2 deletions src/analytics/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ export const eventDocs: Record<AnalyticsEventType, string> = {
[OnboardingEvents.protect_wallet_help_dismiss]: ``,
[OnboardingEvents.protect_wallet_copy_phrase]: ``,
[OnboardingEvents.protect_wallet_complete]: ``,
[OnboardingEvents.cya_button_press]: ``,
[OnboardingEvents.cya_later]: ``,
[OnboardingEvents.cya_button_press]: `when one of the choose your adventure card is pressed. Properties include card name, position of the card (1-based index) and card order`,
[OnboardingEvents.cya_later]: `when "I'll explore later" is pressed`,
[VerificationEvents.verification_start]: ``,
[VerificationEvents.verification_complete]: ``,
[VerificationEvents.verification_error]: ``,
Expand Down
8 changes: 4 additions & 4 deletions src/onboarding/ChooseYourAdventure.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('ChooseYourAdventure', () => {
})
expect(ValoraAnalytics.track).toHaveBeenLastCalledWith(OnboardingEvents.cya_button_press, {
position: 1,
name: AdventureCardName.Dapp,
cardName: AdventureCardName.Dapp,
cardOrder: expectedCardOrder,
})
fireEvent.press(getByTestId('AdventureCard/1/chooseYourAdventure.options.add'))
Expand All @@ -94,7 +94,7 @@ describe('ChooseYourAdventure', () => {

expect(ValoraAnalytics.track).toHaveBeenLastCalledWith(OnboardingEvents.cya_button_press, {
position: 2,
name: AdventureCardName.Add,
cardName: AdventureCardName.Add,
cardOrder: expectedCardOrder,
})

Expand All @@ -104,7 +104,7 @@ describe('ChooseYourAdventure', () => {
})
expect(ValoraAnalytics.track).toHaveBeenLastCalledWith(OnboardingEvents.cya_button_press, {
position: 3,
name: AdventureCardName.Learn,
cardName: AdventureCardName.Learn,
cardOrder: expectedCardOrder,
})

Expand All @@ -113,7 +113,7 @@ describe('ChooseYourAdventure', () => {
expect(navigate).toHaveBeenLastCalledWith(Screens.Profile)
expect(ValoraAnalytics.track).toHaveBeenLastCalledWith(OnboardingEvents.cya_button_press, {
position: 4,
name: AdventureCardName.Profile,
cardName: AdventureCardName.Profile,
cardOrder: expectedCardOrder,
})

Expand Down
2 changes: 1 addition & 1 deletion src/onboarding/ChooseYourAdventure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function ChooseYourAdventure() {
const onPress = () => {
ValoraAnalytics.track(OnboardingEvents.cya_button_press, {
position: index + 1,
name,
cardName: name,
cardOrder,
})
goToNextScreen()
Expand Down

0 comments on commit 920def2

Please sign in to comment.