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

Release 2.6.8 #2380

Merged
merged 27 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4922ec1
Update Tracking/README.md
eason9487 Apr 16, 2024
4e8c48b
Update `woocommerce-grow-jsdoc` to use the version in code review.
eason9487 Apr 16, 2024
103a4f4
Update Tracking/README.md
eason9487 Apr 16, 2024
0cf8ffc
Merge pull request #2373 from woocommerce/trunk
ianlin Apr 16, 2024
8ba929a
Change to globally mock the `useDispatchCoreNotices` hook when runnin…
eason9487 Apr 17, 2024
58f1a66
Add JS tests for the stepper trackings.
eason9487 Apr 17, 2024
e5dbac1
Handle deprecated event properties marked as removable after Q1 2024.
eason9487 Apr 16, 2024
d4944c1
Change to use `recordStepperChangeEvent` and `recordStepContinueEvent…
eason9487 Apr 16, 2024
8003739
Update src/Tracking/README.md.
eason9487 Apr 16, 2024
62fc5d3
Update tags
mikkamp Apr 17, 2024
90d0666
Merge pull request #2377 from woocommerce/tweak/2376-update-readme-tags
mikkamp Apr 17, 2024
a29f24b
Update to use the merged revision of `woocommerce-grow-jsdoc`.
eason9487 Apr 18, 2024
efdde4b
Merge pull request #2371 from woocommerce/dev/update-woocommerce-grow…
eason9487 Apr 18, 2024
c676ef9
Merge branch 'develop' into tweak/2141-remove-deprecated-event-proper…
eason9487 Apr 18, 2024
f6f8b67
Merge pull request #2375 from woocommerce/tweak/2141-remove-deprecate…
eason9487 Apr 19, 2024
64aacb5
Start `release/2.6.5`.
github-actions[bot] Apr 4, 2024
c8faab8
Start `release/2.6.5`.
github-actions[bot] Apr 4, 2024
a84ad43
Start `release/2.6.6`.
github-actions[bot] Apr 9, 2024
3e5e3aa
Restrict product types to be limited to only 10 when converting from …
matt-h Apr 12, 2024
391170d
Fix Typo
matt-h Apr 19, 2024
0643b21
Merge pull request #2368 from matt-h/product-type
mikkamp Apr 22, 2024
d571cea
Merge pull request #2378 from matt-h/patch-1
mikkamp Apr 22, 2024
73f9e9c
Start `release/2.6.8`.
github-actions[bot] Apr 23, 2024
91add71
Update changelog
puntope Apr 23, 2024
721cd08
Product version bump update
puntope Apr 23, 2024
3ab940e
Changelog update
puntope Apr 23, 2024
8438520
Update hooks documentation from branch.
github-actions[bot] Apr 23, 2024
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
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
*** WooCommerce Google Listings and Ads Changelog ***

= 2.6.8 - 2024-04-23 =
* Tweak - Remove deprecated event properties marked as removable after Q1 2024 from the onboarding event tracking.
* Tweak - Update tags in readme.txt.
* Update - Restrict product types to be limited to only 10 when converting from categories.

= 2.6.7 - 2024-04-16 =
* Dev - Add E2E tests for the integration in the classic product editor.
* Dev - Update e2e test environment to install WooCommerce earlier.
Expand Down
4 changes: 2 additions & 2 deletions google-listings-and-ads.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Google Listings and Ads
* Plugin URL: https://wordpress.org/plugins/google-listings-and-ads/
* Description: Native integration with Google that allows merchants to easily display their products across Google’s network.
* Version: 2.6.7
* Version: 2.6.8
* Author: WooCommerce
* Author URI: https://woo.com/
* Text Domain: google-listings-and-ads
Expand All @@ -30,7 +30,7 @@

defined( 'ABSPATH' ) || exit;

define( 'WC_GLA_VERSION', '2.6.7' ); // WRCS: DEFINED_VERSION.
define( 'WC_GLA_VERSION', '2.6.8' ); // WRCS: DEFINED_VERSION.
define( 'WC_GLA_MIN_PHP_VER', '7.4' );
define( 'WC_GLA_MIN_WC_VER', '6.9' );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ jest.mock( '.~/hooks/useGoogleAdsAccount', () =>
jest.fn().mockName( 'useGoogleAdsAccount' ).mockReturnValue( {} )
);

jest.mock( '.~/hooks/useDispatchCoreNotices', () =>
jest
.fn()
.mockName( 'useDispatchCoreNotices' )
.mockReturnValue( { createNotice: () => {} } )
);

jest.mock( '.~/hooks/useWindowFocus', () =>
jest.fn().mockName( 'useWindowFocus' ).mockReturnValue( true )
);
Expand Down
5 changes: 1 addition & 4 deletions js/src/get-started-page/get-started-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import AppButton from '.~/components/app-button';
import { getSetupMCUrl } from '.~/utils/urls';

/**
* @fires gla_setup_mc with `{ triggered_by: 'start-onboarding-button', action: 'go-to-onboarding', context: 'get-started', target: 'set_up_free_listings', trigger: 'click' }`.
* @fires gla_setup_mc with `{ triggered_by: 'start-onboarding-button', action: 'go-to-onboarding', context: 'get-started' }`.
* @fires gla_documentation_link_click with `{ context: 'get-started', linkId: 'wp-terms-of-service', href: 'https://wordpress.com/tos/' }`.
*/
const GetStartedCard = () => {
Expand Down Expand Up @@ -55,9 +55,6 @@ const GetStartedCard = () => {
triggered_by: 'start-onboarding-button',
action: 'go-to-onboarding',
context: 'get-started',
// 'target' and 'trigger' were deprecated and can be removed after Q1 2024.
target: 'set_up_free_listings',
trigger: 'click',
} }
>
{ __(
Expand Down
5 changes: 1 addition & 4 deletions js/src/get-started-page/get-started-with-video-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getSetupMCUrl } from '.~/utils/urls';
import './index.scss';

/**
* @fires gla_setup_mc with `{ triggered_by: 'start-onboarding-button', action: 'go-to-onboarding', context: 'get-started-with-video', target: 'set_up_free_listings', trigger: 'click' }`.
* @fires gla_setup_mc with `{ triggered_by: 'start-onboarding-button', action: 'go-to-onboarding', context: 'get-started-with-video' }`.
* @fires gla_documentation_link_click with `{ context: 'get-started-with-video', linkId: 'wp-terms-of-service', href: 'https://wordpress.com/tos/' }`.
*/
const GetStartedWithVideoCard = () => {
Expand Down Expand Up @@ -70,9 +70,6 @@ const GetStartedWithVideoCard = () => {
triggered_by: 'start-onboarding-button',
action: 'go-to-onboarding',
context: 'get-started-with-video',
// 'target' and 'trigger' were deprecated and can be removed after Q1 2024.
target: 'set_up_free_listings',
trigger: 'click',
} }
>
{ __(
Expand Down
12 changes: 0 additions & 12 deletions js/src/product-feed/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ jest.mock( '.~/utils/localStorage', () => {
};
} );

jest.mock( '.~/hooks/useDispatchCoreNotices', () => ( {
__esModule: true,
default: jest
.fn()
.mockName( 'useDispatchCoreNotices' )
.mockImplementation( () => {
return {
createNotice: jest.fn(),
};
} ),
} ) );

jest.mock( '.~/utils/isWCTracksEnabled', () => jest.fn() );

const SUBMISSION_SUCCESS_GUIDE_TEXT =
Expand Down
7 changes: 0 additions & 7 deletions js/src/product-feed/review-request/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ jest.mock( '.~/utils/tracks', () => {
};
} );

jest.mock( '.~/hooks/useDispatchCoreNotices', () => ( {
__esModule: true,
default: jest.fn().mockName( 'useDispatchCoreNotices' ).mockReturnValue( {
createNotice: jest.fn(),
} ),
} ) );

/**
* External dependencies
*/
Expand Down
12 changes: 0 additions & 12 deletions js/src/product-feed/review-request/review-request-modal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ jest.mock( '.~/utils/tracks', () => {
};
} );

jest.mock( '.~/hooks/useDispatchCoreNotices', () => ( {
__esModule: true,
default: jest
.fn()
.mockName( 'useDispatchCoreNotices' )
.mockImplementation( () => {
return {
createNotice: jest.fn(),
};
} ),
} ) );

jest.mock( '.~/data', () => ( {
__esModule: true,
useAppDispatch: jest.fn( () => {
Expand Down
15 changes: 6 additions & 9 deletions js/src/setup-ads/ads-stepper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import { useState } from '@wordpress/element';
import SetupAccounts from './setup-accounts';
import AdsCampaign from '.~/components/paid-ads/ads-campaign';
import SetupBilling from './setup-billing';
import { recordGlaEvent } from '.~/utils/tracks';
import {
recordStepperChangeEvent,
recordStepContinueEvent,
} from '.~/utils/tracks';

/**
* @param {Object} props React props
Expand All @@ -26,10 +29,7 @@ const AdsStepper = ( { formProps } ) => {
// Users can only go forward by clicking on the Continue button.
const handleStepClick = ( value ) => {
if ( value < step ) {
recordGlaEvent( 'gla_setup_ads', {
triggered_by: `stepper-step${ value }-button`,
action: `go-to-step${ value }`,
} );
recordStepperChangeEvent( 'gla_setup_ads', value );
setStep( value );
}
};
Expand All @@ -42,10 +42,7 @@ const AdsStepper = ( { formProps } ) => {
const continueStep = ( to ) => {
const from = step;

recordGlaEvent( 'gla_setup_ads', {
triggered_by: `step${ from }-continue-button`,
action: `go-to-step${ to }`,
} );
recordStepContinueEvent( 'gla_setup_ads', from, to );
setStep( to );
};

Expand Down
131 changes: 131 additions & 0 deletions js/src/setup-ads/ads-stepper/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
jest.mock( '@woocommerce/tracks', () => {
return {
recordEvent: jest.fn().mockName( 'recordEvent' ),
};
} );

jest.mock( './setup-accounts', () => jest.fn().mockName( 'SetupAccounts' ) );
jest.mock( '.~/components/paid-ads/ads-campaign', () =>
jest.fn().mockName( 'AdsCampaign' )
);
jest.mock( './setup-billing', () => jest.fn().mockName( 'SetupBilling' ) );

/**
* External dependencies
*/
import { screen, render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { recordEvent } from '@woocommerce/tracks';

/**
* Internal dependencies
*/
import AdsStepper from './';
import { addBaseEventProperties as withBaseProperties } from '.~/utils/tracks';
import SetupAccounts from './setup-accounts';
import AdsCampaign from '.~/components/paid-ads/ads-campaign';
import SetupBilling from './setup-billing';

describe( 'AdsStepper', () => {
let continueToStep2;
let continueToStep3;

beforeEach( () => {
SetupAccounts.mockImplementation( ( { onContinue } ) => {
continueToStep2 = onContinue;
return null;
} );

AdsCampaign.mockImplementation( ( { onContinue } ) => {
continueToStep3 = onContinue;
return null;
} );

SetupBilling.mockReturnValue( null );
} );

afterEach( () => {
jest.clearAllMocks();
} );

function continueUntilStep3() {
continueToStep2();
continueToStep3();
}

describe( 'tracks', () => {
it( 'Should record events after calling back to `onContinue`', () => {
render( <AdsStepper /> );

continueUntilStep3();

expect( recordEvent ).toHaveBeenCalledTimes( 2 );
expect( recordEvent ).toHaveBeenNthCalledWith(
1,
'gla_setup_ads',
withBaseProperties( {
action: 'go-to-step2',
triggered_by: 'step1-continue-button',
} )
);
expect( recordEvent ).toHaveBeenNthCalledWith(
2,
'gla_setup_ads',
withBaseProperties( {
action: 'go-to-step3',
triggered_by: 'step2-continue-button',
} )
);
} );

it( 'Should record events after clicking step navigation buttons', async () => {
render( <AdsStepper /> );

const step1 = screen.getByRole( 'button', { name: /accounts/ } );
const step2 = screen.getByRole( 'button', { name: /campaign/ } );

// Step 3 -> Step 2 -> Step 1
continueUntilStep3();
recordEvent.mockClear();
expect( recordEvent ).toHaveBeenCalledTimes( 0 );

await userEvent.click( step2 );
await userEvent.click( step1 );

expect( recordEvent ).toHaveBeenCalledTimes( 2 );
expect( recordEvent ).toHaveBeenNthCalledWith(
1,
'gla_setup_ads',
withBaseProperties( {
action: 'go-to-step2',
triggered_by: 'stepper-step2-button',
} )
);
expect( recordEvent ).toHaveBeenNthCalledWith(
2,
'gla_setup_ads',
withBaseProperties( {
action: 'go-to-step1',
triggered_by: 'stepper-step1-button',
} )
);

// Step 3 -> Step 1
continueUntilStep3();
recordEvent.mockClear();
expect( recordEvent ).toHaveBeenCalledTimes( 0 );

await userEvent.click( step1 );

expect( recordEvent ).toHaveBeenCalledTimes( 1 );
expect( recordEvent ).toHaveBeenNthCalledWith(
1,
'gla_setup_ads',
withBaseProperties( {
action: 'go-to-step1',
triggered_by: 'stepper-step1-button',
} )
);
} );
} );
} );
5 changes: 1 addition & 4 deletions js/src/setup-ads/top-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import HelpIconButton from '.~/components/help-icon-button';
import { recordGlaEvent } from '.~/utils/tracks';

/**
* @fires gla_setup_ads with given `{ triggered_by: 'back-button', action: 'leave', target: 'back', trigger: 'click' }` when back button is clicked.
* @fires gla_setup_ads with given `{ triggered_by: 'back-button', action: 'leave' }` when back button is clicked.
*/
const SetupAdsTopBar = () => {
// We record the intent to go back or to help - clicking buttons.
Expand All @@ -22,9 +22,6 @@ const SetupAdsTopBar = () => {
recordGlaEvent( 'gla_setup_ads', {
triggered_by: 'back-button',
action: 'leave',
// 'target' and 'trigger' were deprecated and can be removed after Q1 2024.
target: 'back',
trigger: 'click',
} );
};

Expand Down
20 changes: 7 additions & 13 deletions js/src/setup-mc/setup-stepper/saved-setup-stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ import SetupFreeListings from '.~/components/free-listings/setup-free-listings';
import StoreRequirements from './store-requirements';
import SetupPaidAds from './setup-paid-ads';
import stepNameKeyMap from './stepNameKeyMap';
import { recordGlaEvent } from '.~/utils/tracks';
import {
recordStepperChangeEvent,
recordStepContinueEvent,
} from '.~/utils/tracks';

/**
* @param {Object} props React props
* @param {string} [props.savedStep] A saved step overriding the current step
* @fires gla_setup_mc with `{ triggered_by: 'step1-continue-button' | 'step2-continue-button', 'step3-continue-button', action: 'go-to-step2' | 'go-to-step3' | 'go-to-step4', target: 'step1_continue' | 'step2_continue' | 'step3_continue', trigger: 'click' }`.
* @fires gla_setup_mc with `{ triggered_by: 'step1-continue-button' | 'step2-continue-button', 'step3-continue-button', action: 'go-to-step2' | 'go-to-step3' | 'go-to-step4' }`.
* @fires gla_setup_mc with `{ triggered_by: 'stepper-step1-button' | 'stepper-step2-button' | 'stepper-step3-button', action: 'go-to-step1' | 'go-to-step2' | 'go-to-step3' }`.
*/
const SavedSetupStepper = ( { savedStep } ) => {
Expand Down Expand Up @@ -82,13 +85,7 @@ const SavedSetupStepper = ( { savedStep } ) => {
const continueStep = ( to ) => {
const from = step;

recordGlaEvent( 'gla_setup_mc', {
triggered_by: `step${ from }-continue-button`,
action: `go-to-step${ to }`,
// 'target' and 'trigger' were deprecated and can be removed after Q1 2024.
target: `step${ from }_continue`,
trigger: 'click',
} );
recordStepContinueEvent( 'gla_setup_mc', from, to );
setStep( to );
};

Expand All @@ -107,10 +104,7 @@ const SavedSetupStepper = ( { savedStep } ) => {
const handleStepClick = ( stepKey ) => {
// Only allow going back to the previous steps.
if ( Number( stepKey ) < Number( step ) ) {
recordGlaEvent( 'gla_setup_mc', {
triggered_by: `stepper-step${ stepKey }-button`,
action: `go-to-step${ stepKey }`,
} );
recordStepperChangeEvent( 'gla_setup_mc', stepKey );
setStep( stepKey );
}
};
Expand Down
Loading
Loading