Skip to content

Commit

Permalink
Merge pull request #2694 from woocommerce/release/2.9.0
Browse files Browse the repository at this point in the history
Release 2.9.0
  • Loading branch information
ianlin authored Nov 26, 2024
2 parents 16df5ec + 143bb98 commit 4523126
Show file tree
Hide file tree
Showing 263 changed files with 8,044 additions and 8,058 deletions.
44 changes: 44 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
*** Google for WooCommerce Changelog ***

= 2.9.0 - 2024-11-26 =
* Add - Add GTIN Migration Job.
* Add - Banner for GTIN MIgration.
* Add - Confirmation modal when user skips without creating a campaign during onboarding.
* Add - During onboarding, automatically create Google Merchant Center or Google Ads accounts when the connected Google account doesn't have a respective existing one.
* Add - GTIN Migration API Controller.
* Add - Show promotion for Google Ads campaign on the Dashboard page.
* Add - Show promotion for Google Ads campaign on the Product Feed page.
* Add - Support YOAST SEO GTIN field in the migration tools.
* Add - WP CLI Command for GTIN Migration.
* Dev - Adding tests for GTIN migration tool.
* Dev - Tweak E2E tests for GTIN migration in versions > 2.8.7.
* Fix - Add margin for separating notices in the admin.
* Fix - Hide or disable GTIN in Product Block editor.
* Fix - Hide/disable GTIN also when YOAST is active.
* Fix - Prevent fatal in GTIN MIgration AS Job.
* Fix rebranding tour on mobile.
* Tweak - Prepare GTIN with the correct format before sending it to MC.
* Tweak - Adjust plugin version to hide GTIN.
* Tweak - Change to use a banner to present the ad credit offer during onboarding.
* Tweak - Move FAQs to the bottom of pages.
* Tweak - Remove the word "Paid" from the plugin.
* Tweak - Remove unused methods from ProductMetaQueryHelper.
* Tweak - Set the default value of the tax rate to destination-based during onboarding.
* Tweak - Show campaign setup fields immediately during onboarding.
* Tweak - Swap performance cards on the Dashboard page.
* Update - Adjust the minimum average daily cost of a campaign to 30% of the highest recommended value among audience countries.
* Update - Automatically preselect a Google Ads account when there is only one, as well as adjust the UI presentation.
* Update - Change the campaign setup and creation to use the recommended budget as the initial value and adjust its description.
* Update - Consolidate the campaign setup UI in the onboarding flow with the one in the Ads-onboarding flow.
* Update - Hide or disable GTIN field in favor of the new native GTIN located in the WooCommerce Product Inventory tab.
* Update - Hides WordPress.com account connection setting from the onboarding flow if already connected.
* Update - Hides the tax rate setting during onboarding.
* Update - Introduce new UI for Google accounts setup during the onboarding.
* Update - Merge the billing setup into the campaign setup for the Ads-onboarding flow.
* Update - Merge the store address setting in Step 3 of the onboarding flow into Step 1 and remove Step 3 along with the contact phone verification.
* Update - Product adapter to map GTIN value from WooCommerce core field if it's available.
* Update - Remove ads audience field from paid ads setup during onboarding.
* Update - Remove the Pre-Launch Checklist from the onboarding flow.
* Update - Remove the contact phone from the Settings page.
* Update - Remove the language setting from onboarding.
* Update - Restrict the GTIN field based on the version of WooCommerce installed and the initial version of G4W installed.
* Update - When the accounts have been connected before, skip accounts setup step during the Ads-onboarding.

= 2.8.7 - 2024-11-14 =
* Dev - WordPress 6.7 Compatibility: Fix the issue that E2E test can't log in to wp-admin.
* Fix - Remove a Google Ads API vendor file that prints php information.
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 for WooCommerce
* 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.8.7
* Version: 2.9.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Text Domain: google-listings-and-ads
Expand All @@ -30,7 +30,7 @@

defined( 'ABSPATH' ) || exit;

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

Expand Down
2 changes: 2 additions & 0 deletions js/src/blocks/product-select-with-text-field/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ export default function Edit( { attributes, context } ) {
options={ options }
value={ optionValue }
onChange={ handleSelectionChange }
disabled={ attributes.disabled }
/>
{ isSelectedCustomInput && (
<TextControl
type="text"
value={ text }
onChange={ handleTextChange }
disabled={ attributes.disabled }
/>
) }
</div>
Expand Down
51 changes: 31 additions & 20 deletions js/src/components/account-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import { Flex, FlexItem, FlexBlock } from '@wordpress/components';
import GridiconPhone from 'gridicons/dist/phone';
import { Icon, store as storeIcon } from '@wordpress/icons';

/**
Expand All @@ -30,7 +28,6 @@ export const APPEARANCE = {
GOOGLE: 'google',
GOOGLE_MERCHANT_CENTER: 'google_merchant_center',
GOOGLE_ADS: 'google_ads',
PHONE: 'phone',
ADDRESS: 'address',
FINAL_URL: 'final_url',
};
Expand Down Expand Up @@ -105,10 +102,6 @@ const appearanceDict = {
'google-listings-and-ads'
),
},
[ APPEARANCE.PHONE ]: {
icon: <GridiconPhone size={ 32 } />,
title: __( 'Phone number', 'google-listings-and-ads' ),
},
[ APPEARANCE.ADDRESS ]: {
icon: <Icon icon={ storeIcon } size={ 32 } />,
title: __( 'Store address', 'google-listings-and-ads' ),
Expand All @@ -122,7 +115,12 @@ const appearanceDict = {
// The `center` is the default alignment, and no need to append any additional class name.
const alignStyleName = {
center: false,
top: `gla-account-card__styled--align-top`,
top: 'gla-account-card__styled--align-top',
};

const indicatorAlignStyleName = {
...alignStyleName,
toDetail: 'gla-account-card__indicator--align-to-detail',
};

/**
Expand All @@ -142,6 +140,9 @@ const alignStyleName = {
* @param {JSX.Element} [props.indicator] Indicator of actions or status on the right side of the card.
* @param {'center'|'top'} [props.alignIcon='center'] Specify the vertical alignment of leading icon.
* @param {'center'|'top'} [props.alignIndicator='center'] Specify the vertical alignment of `indicator`.
* @param {JSX.Element} [props.detail] Detail content below the card description.
* @param {boolean} [props.expandedDetail=false] Whether to expand the detail content.
* @param {JSX.Element} [props.actions] Actions content below the card detail.
* @param {Array<JSX.Element>} [props.children] Children to be rendered if needs more content within the card.
* @param {Object} [props.restProps] Props to be forwarded to Section.Card.
*/
Expand All @@ -156,12 +157,16 @@ export default function AccountCard( {
alignIcon = 'center',
indicator,
alignIndicator = 'center',
detail,
expandedDetail = false,
actions,
children,
...restProps
} ) {
const cardClassName = classnames(
'gla-account-card',
disabled ? 'gla-account-card--is-disabled' : false,
expandedDetail ? 'gla-account-card--is-expanded-detail' : false,
className
);

Expand All @@ -172,19 +177,15 @@ export default function AccountCard( {

const indicatorClassName = classnames(
'gla-account-card__indicator',
alignStyleName[ alignIndicator ]
indicatorAlignStyleName[ alignIndicator ]
);

return (
<Section.Card className={ cardClassName } { ...restProps }>
<Section.Card.Body>
<Flex gap={ 4 }>
{ icon && (
<FlexItem className={ iconClassName }>
{ icon }
</FlexItem>
) }
<FlexBlock>
<div className="gla-account-card__body-layout">
{ icon && <div className={ iconClassName }>{ icon }</div> }
<div className="gla-account-card__subject">
{ title && (
<Subsection.Title className="gla-account-card__title">
{ title }
Expand All @@ -200,13 +201,23 @@ export default function AccountCard( {
{ helper }
</div>
) }
</FlexBlock>
</div>
{ detail && (
<div className="gla-account-card__detail">
{ detail }
</div>
) }
{ indicator && (
<FlexItem className={ indicatorClassName }>
<div className={ indicatorClassName }>
{ indicator }
</FlexItem>
</div>
) }
{ actions && (
<div className="gla-account-card__actions">
{ actions }
</div>
) }
</Flex>
</div>
</Section.Card.Body>
{ children }
</Section.Card>
Expand Down
52 changes: 48 additions & 4 deletions js/src/components/account-card/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,60 @@
opacity: 0.5;
}

&--is-expanded-detail {
.gla-account-card__indicator {
grid-area: 1/3;
}

.gla-account-card__detail {
grid-area: 2/2/auto/span 2;
}
}

&__styled {
&--align-top {
align-self: flex-start;
}
}

&__body-layout {
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
}

&__icon {
grid-area: 1/1/span 2;
margin-right: $grid-unit-20;
line-height: 0;
}

&__subject {
grid-area: 1/2;
}

&__indicator {
grid-area: 1/3/span 2;
margin-left: $grid-unit-20;

&--align-to-detail {
grid-area: 2/3;
margin-top: $grid-unit-15;
}
}

&__detail {
grid-area: 2/2;
margin-top: $grid-unit-15;
}

&__actions {
grid-area: 3/2/auto/span 2;
margin-top: $grid-unit-15;
}

&__title {
margin-bottom: $grid-unit-05;
margin: 0;
color: $black;
}

Expand All @@ -25,6 +67,7 @@
flex-direction: column;
align-items: flex-start;
gap: 1em;
margin-top: $grid-unit-05;
color: $gray-900;

> p {
Expand Down Expand Up @@ -65,11 +108,12 @@
}

@media (max-width: $break-small) {
.components-card__body > .components-flex {
&__body-layout {
display: flex;
flex-direction: column;
align-items: flex-start;
> .components-flex-block,
> .components-flex-item {

> div {
margin: $grid-unit-10;
}
}
Expand Down
64 changes: 64 additions & 0 deletions js/src/components/ads-account-select-control/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* External dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import { getSetting } from '@woocommerce/settings'; // eslint-disable-line import/no-unresolved

/**
* Internal dependencies
*/
import AppSelectControl from '.~/components/app-select-control';
import useExistingGoogleAdsAccounts from '.~/hooks/useExistingGoogleAdsAccounts';
import useGoogleAdsAccount from '.~/hooks/useGoogleAdsAccount';

/**
* @param {Object} props The component props
* @return {JSX.Element} An enhanced AppSelectControl component.
*/
const AdsAccountSelectControl = ( props ) => {
const { existingAccounts } = useExistingGoogleAdsAccounts();
const { googleAdsAccount, hasGoogleAdsConnection } = useGoogleAdsAccount();

const accountIdExists = existingAccounts?.some(
( existingAccount ) => existingAccount.id === googleAdsAccount?.id
);

// If the account ID is not in the list of existing accounts, fake the select options by displaying the connected account ID only.
if ( ! accountIdExists && hasGoogleAdsConnection ) {
const domain = new URL( getSetting( 'homeUrl' ) ).host;

return (
<AppSelectControl
autoSelectFirstOption
nonInteractive
value={ googleAdsAccount.id }
options={ [
{
value: googleAdsAccount.id,
label: sprintf(
// translators: 1: account domain, 2: account ID.
__( '%1$s (%2$s)', 'google-listings-and-ads' ),
domain,
googleAdsAccount.id
),
},
] }
/>
);
}

const options = existingAccounts?.map( ( acc ) => ( {
value: acc.id,
label: `${ acc.name } (${ acc.id })`,
} ) );

return (
<AppSelectControl
options={ options }
autoSelectFirstOption
{ ...props }
/>
);
};

export default AdsAccountSelectControl;
2 changes: 2 additions & 0 deletions js/src/components/app-input-control/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
color: $gray-700;
}

&.has-error .components-input-control__backdrop,
&--error-character-count .components-input-control .components-input-control__container .components-input-control__backdrop {
border-color: $alert-red;
box-shadow: none;
}

&.has-error .components-base-control__help,
&--error-character-count &__character-count {
color: $alert-red;
}
Expand Down
Loading

0 comments on commit 4523126

Please sign in to comment.