From 3901f9b730a628b73de99fd54d3738b29dc5dd69 Mon Sep 17 00:00:00 2001 From: ajayadav09 Date: Thu, 16 May 2024 16:03:53 +0530 Subject: [PATCH 1/3] fix for migration event --- src/OnboardingSPA/steps/SiteGen/Migration/index.js | 8 +++++--- src/OnboardingSPA/steps/TheFork/index.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/OnboardingSPA/steps/SiteGen/Migration/index.js b/src/OnboardingSPA/steps/SiteGen/Migration/index.js index 86a4eed32..7b0b161d6 100644 --- a/src/OnboardingSPA/steps/SiteGen/Migration/index.js +++ b/src/OnboardingSPA/steps/SiteGen/Migration/index.js @@ -20,7 +20,7 @@ import { store as nfdOnboardingStore } from '../../../store'; import { FOOTER_SITEGEN, HEADER_SITEGEN } from '../../../../constants'; import { OnboardingEvent, - trackOnboardingEvent, + sendOnboardingEvent, } from '../../../utils/analytics/hiive'; import { SITEGEN_FLOW } from '../../../data/flows/constants'; import { ACTION_MIGRATION_INITIATED } from '../../../utils/analytics/hiive/constants'; @@ -56,13 +56,15 @@ const StepSiteGenMigration = () => { const response = await getSiteMigrateUrl(); const migrateUrl = response?.body?.data?.redirect_url; if ( migrateUrl ) { - trackOnboardingEvent( + sendOnboardingEvent( new OnboardingEvent( ACTION_MIGRATION_INITIATED, migrateUrl ) ); - window.open( migrateUrl, '_self' ); + setTimeout( () => { + window.open( migrateUrl, '_self' ); + }, 3000 ); } else { updateSiteGenErrorStatus( true ); } diff --git a/src/OnboardingSPA/steps/TheFork/index.js b/src/OnboardingSPA/steps/TheFork/index.js index 8bbb5cf88..706f83709 100644 --- a/src/OnboardingSPA/steps/TheFork/index.js +++ b/src/OnboardingSPA/steps/TheFork/index.js @@ -87,7 +87,7 @@ const TheFork = () => { } else { window.open( migrationUrl, '_blank' ); } - trackOnboardingEvent( + sendOnboardingEvent( new OnboardingEvent( ACTION_SITEGEN_FORK_OPTION_SELECTED, 'MIGRATE' From 614d389ac69b1ed3f9475609f7866c811f143827 Mon Sep 17 00:00:00 2001 From: ajayadav09 Date: Thu, 16 May 2024 16:12:05 +0530 Subject: [PATCH 2/3] fixed lint --- src/OnboardingSPA/steps/TheFork/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OnboardingSPA/steps/TheFork/index.js b/src/OnboardingSPA/steps/TheFork/index.js index 706f83709..6f868956a 100644 --- a/src/OnboardingSPA/steps/TheFork/index.js +++ b/src/OnboardingSPA/steps/TheFork/index.js @@ -23,7 +23,6 @@ import { import { OnboardingEvent, sendOnboardingEvent, - trackOnboardingEvent, } from '../../utils/analytics/hiive'; import { ACTION_SITEGEN_FORK_OPTION_SELECTED } from '../../utils/analytics/hiive/constants'; import { store as nfdOnboardingStore } from '../../store'; From b20c27d935f3ab29bf9d23af0671e102442e1ba4 Mon Sep 17 00:00:00 2001 From: ajayadav09 Date: Thu, 16 May 2024 16:18:22 +0530 Subject: [PATCH 3/3] reverted to track --- src/OnboardingSPA/steps/TheFork/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OnboardingSPA/steps/TheFork/index.js b/src/OnboardingSPA/steps/TheFork/index.js index 6f868956a..8bbb5cf88 100644 --- a/src/OnboardingSPA/steps/TheFork/index.js +++ b/src/OnboardingSPA/steps/TheFork/index.js @@ -23,6 +23,7 @@ import { import { OnboardingEvent, sendOnboardingEvent, + trackOnboardingEvent, } from '../../utils/analytics/hiive'; import { ACTION_SITEGEN_FORK_OPTION_SELECTED } from '../../utils/analytics/hiive/constants'; import { store as nfdOnboardingStore } from '../../store'; @@ -86,7 +87,7 @@ const TheFork = () => { } else { window.open( migrationUrl, '_blank' ); } - sendOnboardingEvent( + trackOnboardingEvent( new OnboardingEvent( ACTION_SITEGEN_FORK_OPTION_SELECTED, 'MIGRATE'