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

Find a way to track migration initiated from MFE #602

Merged
merged 8 commits into from
Jul 24, 2024
Merged
Changes from 1 commit
Commits
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
Next Next commit
changes
ramyakrishnai committed Jul 19, 2024
commit e6810f76a28a125e2ddc1b768943dd1e2b616d65
Original file line number Diff line number Diff line change
@@ -64,6 +64,7 @@
ACTION_MIGRATION_INITIATED,
ACTION_PAGEVIEW,
CATEGORY,
ACTION_MFE_MIGRATION_INITIATED,

Check warning on line 67 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

ACTION_MFE_MIGRATION_INITIATED not found in '../../../utils/analytics/hiive/constants'
} from '../../../utils/analytics/hiive/constants';

import { socialMediaStoreToState } from '../../SocialMediaForm/utils';
@@ -116,12 +117,13 @@
select( nfdOnboardingStore ).getinstaWpMigrationUrl(),
};
},
[ location.pathname ]

Check warning on line 120 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

React Hook useSelect has an unnecessary dependency: 'location.pathname'. Either exclude it or remove the dependency array
);

const [ isRequestPlaced, setIsRequestPlaced ] = useState( false );
const [ didVisitBasicInfo, setDidVisitBasicInfo ] = useState( false );
const [ didVisitEcommerce, setDidVisitEcommerce ] = useState( false );
const [ isMfeMigrationInitiated, setIsMfeMigrationInitiated ] = useState( false );
const {
setActiveChapter,
flushQueue,
@@ -339,6 +341,7 @@
};

const trackChapters = () => {
console.count("tracking");

Check failure on line 344 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

Unexpected console statement

Check failure on line 344 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

There must be a space after this paren

Check failure on line 344 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

Strings must use singlequote

Check failure on line 344 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

There must be a space before this paren
trackInstaWpMigrationEvent();
if ( location.pathname === firstStep.path ) {
trackOnboardingEvent(
@@ -389,7 +392,7 @@
if ( instaWpMigrationUrl ) {
sendOnboardingEvent(
new OnboardingEvent(
ACTION_MIGRATION_INITIATED,
isMfeMigrationInitiated ? ACTION_MFE_MIGRATION_INITIATED : ACTION_MIGRATION_INITIATED,
instaWpMigrationUrl
)
);
@@ -399,12 +402,13 @@

useEffect( () => {
trackChapters();
}, [ currentStep ] );

Check warning on line 405 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'trackChapters'. Either include it or remove the dependency array

// Track Migration Initated Event in the Migration Step.
useEffect( () => {
getSettings().then(res => setIsMfeMigrationInitiated(res.nfd_migrate_site))

Check failure on line 409 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

There must be a space after this paren

Check failure on line 409 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

Expected parentheses around arrow function argument

Check failure on line 409 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

There must be a space after this paren

Check failure on line 409 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

There must be a space before this paren

Check failure on line 409 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

There must be a space before this paren

Check failure on line 409 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

Missing semicolon
trackInstaWpMigrationEvent();
}, [ instaWpMigrationUrl ] );

Check warning on line 411 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'trackInstaWpMigrationEvent'. Either include it or remove the dependency array

const prioritizeFlow = () => {
const currentFlow = window.nfdOnboarding.currentFlow;
@@ -445,13 +449,13 @@
initializeSettings();
setInterval( cronTrigger, 45000 );
}
}, [ initialize ] );

Check warning on line 452 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'pluginInstallHash'. Either include it or remove the dependency array

useEffect( () => {
if ( false !== brandConfig?.prioritization ) {
return prioritizeFlow();
}
}, [ experienceLevel, topPriority ] );

Check warning on line 458 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'brandConfig?.prioritization' and 'prioritizeFlow'. Either include them or remove the dependency array

useEffect( () => {
document.body.classList.add( `nfd-brand-${ newfoldBrand }` );
@@ -461,7 +465,7 @@
syncStoreToDB();
handlePreviousStepTracking();
handleConditionalDesignStepsRoutes();
}, [ location.pathname, onboardingFlow ] );

Check warning on line 468 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'handleConditionalDesignStepsRoutes', 'handlePreviousStepTracking', and 'syncStoreToDB'. Either include them or remove the dependency array

useEffect( () => {
sendOnboardingEvent( new OnboardingEvent( ACTION_PAGEVIEW ) );
2 changes: 1 addition & 1 deletion src/OnboardingSPA/steps/SiteGen/Migration/index.js
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@
if ( migrateUrl ) {
setInstaWpMigrationUrl( migrateUrl );
setTimeout( () => {
window.open( migrateUrl, '_self' );
// window.open( migrateUrl, '_self' );
}, 3000 );
} else {
trackOnboardingEvent(
@@ -122,13 +122,13 @@
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
setFooterActiveView( FOOTER_SITEGEN );
}, [] );

Check warning on line 125 in src/OnboardingSPA/steps/SiteGen/Migration/index.js

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'allSteps', 'setDrawerActiveView', 'setFooterActiveView', 'setHeaderActiveView', 'setHideFooterNav', 'setIsHeaderEnabled', 'setIsHeaderNavigationEnabled', 'setSidebarActiveView', and 'updateAllSteps'. Either include them or remove the dependency array

useEffect( () => {
if ( siteGenErrorStatus === false ) {
loadData();
}
}, [ siteGenErrorStatus ] );

Check warning on line 131 in src/OnboardingSPA/steps/SiteGen/Migration/index.js

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'loadData'. Either include it or remove the dependency array

const content = getContents( currentBrandName );
return (