Skip to content

Commit 0983a57

Browse files
authored
Merge pull request #647 from newfold-labs/update/js-utility-ui-analytics
Update js-utility-ui-analytics source and imports
2 parents 7f90ea0 + a3841a3 commit 0983a57

File tree

10 files changed

+1527
-532
lines changed

10 files changed

+1527
-532
lines changed

package-lock.json

Lines changed: 1498 additions & 517 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
"test:unit": "npx wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins//phpunit.xml --verbose'"
3030
},
3131
"dependencies": {
32-
"@newfold-labs/js-utility-ui-analytics": "1.2.0",
33-
"@newfold-labs/wp-module-facebook": "^1.0.9",
32+
"@newfold/js-utility-ui-analytics": "1.3.1",
33+
"@newfold/wp-module-facebook": "^1.1.2",
3434
"@sentry/react": "^8.9.2",
35+
"@wordpress/api-fetch": "^7.17.0",
36+
"@wordpress/data": "^10.17.0",
3537
"@wordpress/interface": "^5.25.0",
3638
"@wordpress/style-engine": "^0.11.0",
3739
"bytes": "^3.1.2",

src/OnboardingSPA/components/ExitToWordPress/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
55
import { Button, ButtonGroup, Modal } from '@wordpress/components';
66
import { __, sprintf } from '@wordpress/i18n';
77
import classNames from 'classnames';
8-
import { HiiveAnalytics } from '@newfold-labs/js-utility-ui-analytics';
8+
import { HiiveAnalytics } from '@newfold/js-utility-ui-analytics';
99

1010
import { setFlow } from '../../utils/api/flow';
1111
import { store as nfdOnboardingStore } from '../../store';

src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { stepSiteGenMigration } from '../../../steps/SiteGen/Migration/step';
2222
import { useWPSettings as getWPSettings } from '../../../steps/Ecommerce/useWPSettings';
2323

2424
// classes
25-
import { HiiveAnalytics } from '@newfold-labs/js-utility-ui-analytics';
25+
import { HiiveAnalytics } from '@newfold/js-utility-ui-analytics';
2626
import themeToggleHOC from '../themeToggleHOC';
2727
import { init as initializePlugins } from '../../../utils/api/plugins';
2828
import { init as initializeThemes } from '../../../utils/api/themes';
@@ -389,12 +389,16 @@ const SiteBuild = () => {
389389
const trackInstaWpMigrationEvent = () => {
390390
if ( currentStep?.path === stepSiteGenMigration?.path ) {
391391
if ( instaWpMigrationUrl ) {
392-
getWPSettings().then( ( res ) => sendOnboardingEvent(
393-
new OnboardingEvent(
394-
res.nfd_migrate_site ? ACTION_MFE_MIGRATION_INITIATED : ACTION_MIGRATION_INITIATED,
395-
instaWpMigrationUrl
392+
getWPSettings().then( ( res ) =>
393+
sendOnboardingEvent(
394+
new OnboardingEvent(
395+
res.nfd_migrate_site
396+
? ACTION_MFE_MIGRATION_INITIATED
397+
: ACTION_MIGRATION_INITIATED,
398+
instaWpMigrationUrl
399+
)
396400
)
397-
) );
401+
);
398402
}
399403
}
400404
};

src/OnboardingSPA/components/SkipButton/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { memo } from '@wordpress/element';
33
import { Button } from '@wordpress/components';
44
import { useSelect, useDispatch } from '@wordpress/data';
55
import { useLocation, useNavigate } from 'react-router-dom';
6-
import { HiiveAnalytics } from '@newfold-labs/js-utility-ui-analytics';
6+
import { HiiveAnalytics } from '@newfold/js-utility-ui-analytics';
77

88
import { setFlow } from '../../utils/api/flow';
99
import { store as nfdOnboardingStore } from '../../store';

src/OnboardingSPA/components/StateHandlers/Flow/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getFragment } from '@wordpress/url';
55

66
// Third-party
77
import { useLocation } from 'react-router-dom';
8-
import { HiiveAnalytics } from '@newfold-labs/js-utility-ui-analytics';
8+
import { HiiveAnalytics } from '@newfold/js-utility-ui-analytics';
99

1010
// Classes and functions
1111
import { switchFlow } from '../../../utils/api/flow';

src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useViewportMatch } from '@wordpress/compose';
55

66
// Third-party
77
import { useNavigate } from 'react-router-dom';
8-
import { FacebookConnectButton } from '@newfold-labs/wp-module-facebook';
8+
import { FacebookConnectButton } from '@newfold/wp-module-facebook';
99

1010
// Classes and functions
1111
import getContents from './contents';

src/OnboardingSPA/utils/analytics/hiive/OnboardingEvent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HiiveEvent } from '@newfold-labs/js-utility-ui-analytics';
1+
import { HiiveEvent } from '@newfold/js-utility-ui-analytics';
22
import { getLabelKeyFromAction } from '.';
33
import { CATEGORY } from './constants';
44

src/OnboardingSPA/utils/analytics/hiive/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { HiiveAnalytics } from '@newfold-labs/js-utility-ui-analytics';
1+
import { HiiveAnalytics } from '@newfold/js-utility-ui-analytics';
2+
import { default as wpData } from '@wordpress/data';
3+
import { default as wpApiFetch } from '@wordpress/api-fetch';
24
import { ACTION_TO_LABEL_KEY_MAP } from './constants';
35

46
export const trackOnboardingEvent = ( onboardingEvent ) => {
@@ -16,4 +18,10 @@ export const getLabelKeyFromAction = ( action ) => {
1618
return undefined;
1719
};
1820

21+
// passing dependencies to HiiveAnalytics solely for build purposes
22+
HiiveAnalytics.dependencies = {
23+
wpData,
24+
wpApiFetch,
25+
};
26+
1927
export * from './OnboardingEvent';

src/onboarding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { registerCoreBlocks } from '@wordpress/block-library';
66

77
// Classes and functions
88
import initializeNFDOnboarding from './OnboardingSPA';
9-
import { HiiveAnalytics } from '@newfold-labs/js-utility-ui-analytics';
9+
import { HiiveAnalytics } from '@newfold/js-utility-ui-analytics';
1010
import { onboardingRestURL } from './OnboardingSPA/utils/api/common';
1111
import { isEnvironmentCypress } from './OnboardingSPA/utils';
1212
import * as Sentry from '@sentry/react';

0 commit comments

Comments
 (0)