From ca6461d1c0e1b5c1bf132e8dbb3abebdf64a9fb4 Mon Sep 17 00:00:00 2001 From: Milan Date: Tue, 12 Apr 2022 16:32:01 +0200 Subject: [PATCH] feat(segement conflicts): fied issue with segment issues --- .../analytics/types/onboardingAndVerification.ts | 14 +++++++++----- .../KycVerification/InfoAndResidential/index.tsx | 16 ++++++++++++++-- .../src/scenes/Signup/index.tsx | 8 ++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/packages/blockchain-wallet-v4-frontend/src/data/analytics/types/onboardingAndVerification.ts b/packages/blockchain-wallet-v4-frontend/src/data/analytics/types/onboardingAndVerification.ts index 7f9f3dff818..0c0e5ef2bc4 100644 --- a/packages/blockchain-wallet-v4-frontend/src/data/analytics/types/onboardingAndVerification.ts +++ b/packages/blockchain-wallet-v4-frontend/src/data/analytics/types/onboardingAndVerification.ts @@ -14,7 +14,7 @@ export enum Events { ONBOARDING_GET_MORE_ACCESS_WHEN_YOU_VERIFY = 'Get More Access When You Verify Clicked', ONBOARDING_GET_MORE_ACCESS_WHEN_YOU_VERIFY_DISMISSED = 'Get More Access When You Verify Dismissed', ONBOARDING_MANUAL_VERIFICATION_REQUIRED = 'Manual Verification Required', - ONBOARDING_PERSONAL_INFORMATION_CLICKED = 'Personal Information Entered', + ONBOARDING_PERSONAL_INFORMATION_ENTERED = 'Personal Information Entered', ONBOARDING_PRE_VERIFICATION_CTA_CLICKED = 'Pre Verification CTA Clicked', ONBOARDING_PRE_VERIFICATION_DISMISSED = 'Pre Verification Dismissed', ONBOARDING_PRE_VERIFICATION_VIEWED = 'Pre Verification Viewed', @@ -81,6 +81,8 @@ type FailureReason = type LunchByPromo = 'NUX_LAUNCH_PROMO_BUY_CRYPTO' // this is defined as single enum +type EnteredInformation = 'SETTINGS' + type Provider = 'BLOCKCHAIN' | 'VERIFF' type AddressEnteredAction = { @@ -158,9 +160,11 @@ type CompleteProfileBannerClickedAction = { } } -type PersonalInformationClickedAction = { - key: Events.ONBOARDING_PERSONAL_INFORMATION_CLICKED - properties: {} +type PersonalInformationEnteredAction = { + key: Events.ONBOARDING_PERSONAL_INFORMATION_ENTERED + properties: { + origin: EnteredInformation + } } type SignUpClickedAction = { @@ -323,7 +327,7 @@ export type TrackEventAction = | CompleteProfileModalViewedAction | CompleteProfileModalButtonClickedAction | CompleteProfileBannerClickedAction - | PersonalInformationClickedAction + | PersonalInformationEnteredAction | SignUpClickedAction | CountrySelectedAction | CountryStateSelectedAction diff --git a/packages/blockchain-wallet-v4-frontend/src/modals/Onboarding/KycVerification/InfoAndResidential/index.tsx b/packages/blockchain-wallet-v4-frontend/src/modals/Onboarding/KycVerification/InfoAndResidential/index.tsx index 99d1f39658d..ae822c0fbfb 100644 --- a/packages/blockchain-wallet-v4-frontend/src/modals/Onboarding/KycVerification/InfoAndResidential/index.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/modals/Onboarding/KycVerification/InfoAndResidential/index.tsx @@ -7,7 +7,7 @@ import DataError from 'components/DataError' import { actions, model, selectors } from 'data' import { CountryType } from 'data/components/identityVerification/types' import { RootState } from 'data/rootReducer' -import { InfoAndResidentialFormValuesType } from 'data/types' +import { Analytics, InfoAndResidentialFormValuesType } from 'data/types' import Loading from '../template.loading' import { getData } from './selectors' @@ -26,12 +26,23 @@ class InfoAndResidential extends PureComponent { } handleSubmit = () => { - const { checkSddEligibility, identityVerificationActions, onCompletionCallback } = this.props + const { + analyticsActions, + checkSddEligibility, + identityVerificationActions, + onCompletionCallback + } = this.props identityVerificationActions.saveInfoAndResidentialData( checkSddEligibility, onCompletionCallback, false ) + analyticsActions.trackEvent({ + key: Analytics.ONBOARDING_PERSONAL_INFORMATION_ENTERED, + properties: { + origin: 'SETTINGS' + } + }) } onCountryChange = (e, value) => { @@ -73,6 +84,7 @@ const mapStateToProps = (state: RootState) => ({ }) const mapDispatchToProps = (dispatch) => ({ + analyticsActions: bindActionCreators(actions.analytics, dispatch), formActions: bindActionCreators(actions.form, dispatch), identityVerificationActions: bindActionCreators(actions.components.identityVerification, dispatch) }) diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Signup/index.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/Signup/index.tsx index d2e92eb8224..7b19d48b31c 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Signup/index.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Signup/index.tsx @@ -32,8 +32,8 @@ class SignupContainer extends React.PureComponent< super(props) this.state = { captchaToken: undefined, - showForm: props.search.includes('showWallet'), isLatam: props.search.includes('latam'), + showForm: props.search.includes('showWallet'), showState: false } } @@ -122,15 +122,15 @@ class SignupContainer extends React.PureComponent< const subviewProps = { isFormSubmitting, + isLatam: this.state.isLatam, isLinkAccountGoal, onCountrySelect: this.onCountryChange, onSignupSubmit: this.onSubmit, setDefaultCountry: this.setCountryOnLoad, showForm: this.state.showForm, - isLatam: this.state.isLatam, showState: this.state.showState, - toggleSignupFormVisibility: this.toggleSignupFormVisibility, toggleLatamVisibility: this.toggleLatamVisibility, + toggleSignupFormVisibility: this.toggleSignupFormVisibility, ...this.props, // order here matters as we may need to override initial form values! initialValues: signupInitialValues } @@ -179,8 +179,8 @@ type LinkStatePropsType = { } type StateProps = { captchaToken?: string - showForm: boolean isLatam: boolean + showForm: boolean showState: boolean }