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.8.5 #2586

Merged
merged 36 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
19c069c
Use remote-site-status to check the WPCOM Auth status
puntope Aug 20, 2024
e8e51f3
PHPCS
puntope Aug 20, 2024
38254c1
Remove unused dependency
puntope Aug 22, 2024
857e074
Prevent loop and excessive request.
puntope Aug 22, 2024
93b4180
Merge pull request #2570 from woocommerce/trunk
tomalec Aug 27, 2024
435b02e
Bump webpack from 5.93.0 to 5.94.0
dependabot[bot] Aug 27, 2024
75af8e2
Fomat shipping rate to two decimals
jorgemd24 Aug 30, 2024
708910d
Add tests for shipping zone rate with more than 2 decimals
jorgemd24 Aug 30, 2024
f126caa
Add test for is_Ready without health check
puntope Sep 2, 2024
90ed2a4
Update option when there is error.
puntope Sep 2, 2024
ec9e32f
Add more tests
puntope Sep 2, 2024
fd5d8aa
Add more tests
puntope Sep 2, 2024
84d9ad0
Remove the use of WooAdminNavigationTrait
tomalec Sep 2, 2024
e98639a
Remove the `NavigationClassic` use `MainTabNav` directly
tomalec Sep 2, 2024
1958589
Always use `AppSubNav` in `ReportsNavigation`
tomalec Sep 2, 2024
0c1023c
Change `useLegacyMenuEffect` to `useMenuEffect`
tomalec Sep 2, 2024
75a23ce
Always add `marketing` to the breadcrumbs
tomalec Sep 2, 2024
15328f2
Remove `reconnectionLock`
tomalec Sep 2, 2024
9bee30e
Remove `isWCNavigationEnabled`
tomalec Sep 2, 2024
42e55b5
Hide `woocommerce-layout__header` with `display:none` for `full-content`
tomalec Sep 2, 2024
8731dee
Update `useLayout` code comment
tomalec Sep 2, 2024
82ffce8
Merge pull request #2573 from woocommerce/fix/issue-with-syncing-ship…
jorgemd24 Sep 3, 2024
f12ac73
Log exception if asset is enqueued before it's registered
martynmjones Sep 3, 2024
0baf754
Add unit test
martynmjones Sep 3, 2024
baeac50
Merge pull request #2571 from woocommerce/dependabot/npm_and_yarn/web…
eason9487 Sep 4, 2024
12c09f8
Merge pull request #2574 from woocommerce/remove/2406-woo-nav
tomalec Sep 4, 2024
7210b14
Merge pull request #2547 from woocommerce/tweak/check-wpcom-api-auth
puntope Sep 5, 2024
bf5c219
Merge pull request #2576 from woocommerce/fix/1659-asset-enqueued-bef…
martynmjones Sep 5, 2024
fe8d923
Start `release/2.8.5`.
github-actions[bot] Sep 5, 2024
9fda021
Update readme.txt
martynmjones Sep 5, 2024
1c6a902
Set WPCOM_API_STATUS transient for tests
martynmjones Sep 5, 2024
5d9eeda
Merge pull request #2588 from woocommerce/fix/2587-e2e-tests
martynmjones Sep 5, 2024
8ce5aef
Merge branch 'develop' into release/2.8.5
martynmjones Sep 5, 2024
59e3fcd
woorelease: Product version bump update
martynmjones Sep 5, 2024
cf76762
woorelease: Changelog update
martynmjones Sep 5, 2024
cf3c765
Update hooks documentation from branch.
github-actions[bot] Sep 5, 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
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
*** Google for WooCommerce Changelog ***

= 2.8.5 - 2024-09-05 =
* Break - Remove WooCommerce Navigation integration.
* Fix - Issue with syncing shipping rates with more than two decimals.
* Fix - Log exceptions triggered by assets being enqueued before being registered.
* Tweak - Use remote-site-status to check the WPCOM Auth status.
* Tweak - WC 9.3.0 compatibility.

= 2.8.4 - 2024-08-28 =
* Dev - Align namespaces for unit tests.
* Dev - Avoid accidentally using the event object to reset the asset group values in the CampaignAssetsForm component.
Expand Down
6 changes: 3 additions & 3 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.4
* Version: 2.8.5
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Text Domain: google-listings-and-ads
Expand All @@ -13,7 +13,7 @@
* Requires PHP Architecture: 64 bits
* Requires Plugins: woocommerce
* WC requires at least: 6.9
* WC tested up to: 9.2.0
* WC tested up to: 9.3.0
* Woo:
*
* @package WooCommerce\Admin
Expand All @@ -30,7 +30,7 @@

defined( 'ABSPATH' ) || exit;

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

Expand Down
3 changes: 0 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ module.exports = {
'<rootDir>/js/build-dev',
],
globals: {
wcAdminFeatures: {
navigation: false,
},
wcSettings: {
currency: {
code: 'USD',
Expand Down
4 changes: 2 additions & 2 deletions js/src/attribute-mapping/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { __ } from '@wordpress/i18n';
import Section from '.~/wcdl/section';
import AttributeMappingDescription from './attribute-mapping-description';
import AttributeMappingTable from './attribute-mapping-table';
import NavigationClassic from '.~/components/navigation-classic';
import MainTabNav from '.~/components/main-tab-nav';
import RebrandingTour from '.~/components/tours/rebranding-tour';
import './index.scss';

Expand All @@ -21,7 +21,7 @@ import './index.scss';
const AttributeMapping = () => {
return (
<div className="gla-attribute-mapping">
<NavigationClassic />
<MainTabNav />
<RebrandingTour />
<Section
title={ __( 'Manage attributes', 'google-listings-and-ads' ) }
Expand Down
1 change: 1 addition & 0 deletions js/src/components/main-tab-nav/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './main-tab-nav';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getNewPath, getPath } from '@woocommerce/navigation';
*/
import { glaData } from '.~/constants';
import AppTabNav from '.~/components/app-tab-nav';
import useLegacyMenuEffect from '.~/hooks/useLegacyMenuEffect';
import useMenuEffect from '.~/hooks/useMenuEffect';

let tabs = [
{
Expand Down Expand Up @@ -51,7 +51,7 @@ const getSelectedTabKey = () => {
};

const MainTabNav = () => {
useLegacyMenuEffect();
useMenuEffect();

const selectedKey = getSelectedTabKey();

Expand Down
18 changes: 0 additions & 18 deletions js/src/components/navigation-classic/index.js

This file was deleted.

30 changes: 3 additions & 27 deletions js/src/css/shared/_woocommerce-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,8 @@
.woocommerce-layout {
padding-top: 0;

// do not set the header to display: none,
// because we want the offsetHeight value
// and set it to wpbody-content margin-top to counter back.
.woocommerce-layout__header {
visibility: hidden;

// only display the top left WC navigation,
// do not display the h1 page title element
// and the top right activity panel.
&-wrapper > *:not(.woocommerce-navigation) {
display: none;
}
display: none;
}

// Hide StoreAlerts.
Expand All @@ -37,28 +27,14 @@
}
}
}

// the following is only applicable when WC Navigation is enabled
// and the page is on a large screen with .is-wc-nav-expanded applied.
&.has-woocommerce-navigation.is-wc-nav-expanded {
.woocommerce-layout__header {
// WC Navigation lies inside woocommerce-layout__header,
// so we need to display this.
display: block;

// width of the WC Navigation sidebar.
width: 240px;
}
}
}

// Used in .~/hooks/useLayout.js
.gla-full-page {
// hack to fix the margin-top when WC Navigation is not enabled
// and width is between 600px and 782px.
// hack to fix the margin-top when width is between 600px and 782px.
// without this, the margin-top would be -32px,
// and there would be a visible small grey gap.
&.is-wp-toolbar-disabled:not(.has-woocommerce-navigation) {
&.is-wp-toolbar-disabled {
@media (min-width: #{ ($break-small) }) and (max-width: #{ ($break-medium) }) {
margin-top: -46px;
}
Expand Down
4 changes: 2 additions & 2 deletions js/src/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getNewPath, getQuery, getHistory } from '@woocommerce/navigation';
*/
import AppButton from '.~/components/app-button';
import DifferentCurrencyNotice from '.~/components/different-currency-notice';
import NavigationClassic from '.~/components/navigation-classic';
import MainTabNav from '.~/components/main-tab-nav';
import CustomerEffortScorePrompt from '.~/components/customer-effort-score-prompt';
import AppDateRangeFilterPicker from './app-date-range-filter-picker';
import SummarySection from './summary-section';
Expand Down Expand Up @@ -88,7 +88,7 @@ const Dashboard = () => {
<>
<div className="gla-dashboard">
<DifferentCurrencyNotice context="dashboard" />
<NavigationClassic />
<MainTabNav />
<RebrandingTour />
<div className="gla-dashboard__filter">
<AppDateRangeFilterPicker
Expand Down
2 changes: 1 addition & 1 deletion js/src/dashboard/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jest.mock( '.~/components/customer-effort-score-prompt', () => () => (
) );

beforeAll( () => {
// Used in the js/src/hooks/useLegacyMenuEffect.js dependency
// Used in the js/src/hooks/useMenuEffect.js dependency
window.wpNavMenuClassChange = jest.fn();
} );

Expand Down
4 changes: 2 additions & 2 deletions js/src/hooks/useLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default function useLayout( layoutName ) {

const bodyClassList = document.body.classList;
/**
* For WC Navigation, it already has classes applied, for example, "is-wp-toolbar-disabled".
* Here filter existing classes out to avoid them being removed in the cleanup function.
* Here filter potentially already applied classes out
* to avoid them being removed in the cleanup function.
*/
const classNames = classNameDict[ layoutName ].filter(
( name ) => ! bodyClassList.contains( name )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
* External dependencies
*/
import { useEffect } from '@wordpress/element';
/**
* Internal dependencies
*/
import isWCNavigationEnabled from '.~/utils/isWCNavigationEnabled';

/**
* Mocked result of parsing a page entry from {@link /js/src/index.js} by WC-admin's <Route>.
Expand All @@ -18,25 +14,17 @@ const dashboardPage = {
};

/**
* Effect that highlights the GLA Dashboard menu entry in the legacy WC menu.
* Effect that highlights the GLA Dashboard menu entry in the WC menu.
*
* Should be called for every "root page" (`.~/pages/*`) that wants to open the GLA menu.
*
* The hook could be removed once WC Navigation will be always enabled,
* or if we make the plugin fully use the routing feature of WC,
* The hook could be removed once make the plugin fully use the routing feature of WC,
* and let this be done by proper matching of URL matchers from {@link /js/src/index.js}
*
* @see window.wpNavMenuClassChange
*/
export default function useLegacyMenuEffect() {
const navigationEnabled = isWCNavigationEnabled();
export default function useMenuEffect() {
return useEffect( () => {
// Highlight the wp-admin dashboard menu
if ( ! navigationEnabled ) {
window.wpNavMenuClassChange(
dashboardPage,
dashboardPage.match.url
);
}
}, [ navigationEnabled ] );
window.wpNavMenuClassChange( dashboardPage, dashboardPage.match.url );
} );
}
24 changes: 5 additions & 19 deletions js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { getSetting } from '@woocommerce/settings'; // eslint-disable-line impor
import './css/index.scss';
import withAdminPageShell from '.~/components/withAdminPageShell';
import './data';
import isWCNavigationEnabled from './utils/isWCNavigationEnabled';
import { addBaseEventProperties } from '.~/utils/tracks';

const Dashboard = lazy( () =>
Expand Down Expand Up @@ -59,24 +58,11 @@ addFilter(
'woocommerce_admin_pages_list',
'woocommerce/google-listings-and-ads/add-page-routes',
( pages ) => {
const navigationEnabled = isWCNavigationEnabled();
const initialBreadcrumbs = [ [ '', woocommerceTranslation ] ];

/**
* If the WooCommerce Navigation feature is not enabled,
* we want to display the plugin under WC Marketing;
* otherwise, display it under WC Navigation - Extensions.
*/
if ( ! navigationEnabled ) {
initialBreadcrumbs.push( [
'/marketing',
__( 'Marketing', 'google-listings-and-ads' ),
] );
}

initialBreadcrumbs.push(
__( 'Google for WooCommerce', 'google-listings-and-ads' )
);
const initialBreadcrumbs = [
[ '', woocommerceTranslation ],
[ '/marketing', __( 'Marketing', 'google-listings-and-ads' ) ],
__( 'Google for WooCommerce', 'google-listings-and-ads' ),
];

const pluginAdminPages = [
{
Expand Down
4 changes: 2 additions & 2 deletions js/src/product-feed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getQuery } from '@woocommerce/navigation';
/**
* Internal dependencies
*/
import NavigationClassic from '.~/components/navigation-classic';
import MainTabNav from '.~/components/main-tab-nav';
import IssuesTableCard from './issues-table-card';
import ProductFeedTableCard from './product-feed-table-card';
import SubmissionSuccessGuide from './submission-success-guide';
Expand Down Expand Up @@ -47,7 +47,7 @@ const ProductFeed = () => {

return (
<>
<NavigationClassic />
<MainTabNav />
<RebrandingTour />
{ isSubmissionSuccessOpen && <SubmissionSuccessGuide /> }
{ canCESPromptOpen && (
Expand Down
2 changes: 1 addition & 1 deletion js/src/product-feed/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jest.mock( '.~/components/customer-effort-score-prompt', () => () => (
) );

beforeAll( () => {
// Used in the js/src/hooks/useLegacyMenuEffect.js dependency
// Used in the js/src/hooks/useMenuEffect.js dependency
window.wpNavMenuClassChange = jest.fn();
} );

Expand Down
4 changes: 2 additions & 2 deletions js/src/reports/products/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import useMetricsWithFormatter from '../useMetricsWithFormatter';
import useAdsCampaigns from '.~/hooks/useAdsCampaigns';
import AppSpinner from '.~/components/app-spinner';
import DifferentCurrencyNotice from '.~/components/different-currency-notice';
import NavigationClassic from '.~/components/navigation-classic';
import MainTabNav from '.~/components/main-tab-nav';
import ProductsReportFilters from './products-report-filters';
import SummarySection from '../summary-section';
import ChartSection from '../chart-section';
Expand Down Expand Up @@ -123,7 +123,7 @@ const ProductsReportPage = () => {
return (
<>
<DifferentCurrencyNotice context="reports-products" />
<NavigationClassic />
<MainTabNav />
<RebrandingTour />
<ReportsNavigation />
{ loaded ? (
Expand Down
4 changes: 2 additions & 2 deletions js/src/reports/programs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getQuery } from '@woocommerce/navigation';
import useProgramsReport, { usePerformanceReport } from './useProgramsReport';
import useMetricsWithFormatter from '../useMetricsWithFormatter';
import DifferentCurrencyNotice from '.~/components/different-currency-notice';
import NavigationClassic from '.~/components/navigation-classic';
import MainTabNav from '.~/components/main-tab-nav';
import ProgramsReportFilters from './programs-report-filters';
import SummarySection from '../summary-section';
import ChartSection from '../chart-section';
Expand Down Expand Up @@ -103,7 +103,7 @@ const ProgramsReport = () => {
return (
<>
<DifferentCurrencyNotice context={ trackEventId } />
<NavigationClassic />
<MainTabNav />
<RebrandingTour />
<ReportsNavigation />
<ProgramsReportFilters
Expand Down
9 changes: 1 addition & 8 deletions js/src/reports/reports-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { getNewPath } from '@woocommerce/navigation';
/**
* Internal dependencies
*/
import AppTabNav from '.~/components/app-tab-nav';
import isWCNavigationEnabled from '.~/utils/isWCNavigationEnabled';
import AppSubNav from '.~/components/app-sub-nav';
import getSelectedReportKey from '.~/utils/getSelectedReportKey';

Expand All @@ -26,14 +24,9 @@ const tabs = [
];

const ReportsNavigation = () => {
const navigationEnabled = isWCNavigationEnabled();
const reportKey = getSelectedReportKey();

return navigationEnabled ? (
<AppTabNav tabs={ tabs } selectedKey={ reportKey } />
) : (
<AppSubNav tabs={ tabs } selectedKey={ reportKey } />
);
return <AppSubNav tabs={ tabs } selectedKey={ reportKey } />;
};

export default ReportsNavigation;
8 changes: 4 additions & 4 deletions js/src/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getQuery, getHistory } from '@woocommerce/navigation';
* Internal dependencies
*/
import { API_RESPONSE_CODES } from '.~/constants';
import useLegacyMenuEffect from '.~/hooks/useLegacyMenuEffect';
import useMenuEffect from '.~/hooks/useMenuEffect';
import useGoogleAccount from '.~/hooks/useGoogleAccount';
import useUpdateRestAPIAuthorizeStatusByUrlQuery from '.~/hooks/useUpdateRestAPIAuthorizeStatusByUrlQuery';
import { subpaths, getReconnectAccountUrl } from '.~/utils/urls';
Expand All @@ -19,7 +19,7 @@ import ReconnectGoogleAccount from './reconnect-google-account';
import EditStoreAddress from './edit-store-address';
import EditPhoneNumber from './edit-phone-number';
import EnableNewProductSyncNotice from '.~/components/enable-new-product-sync-notice';
import NavigationClassic from '.~/components/navigation-classic';
import MainTabNav from '.~/components/main-tab-nav';
import RebrandingTour from '.~/components/tours/rebranding-tour';
import './index.scss';

Expand All @@ -28,7 +28,7 @@ const pageClassName = 'gla-settings';
const Settings = () => {
const { subpath } = getQuery();
// Make the component highlight GLA entry in the WC legacy menu.
useLegacyMenuEffect();
useMenuEffect();

useUpdateRestAPIAuthorizeStatusByUrlQuery();

Expand Down Expand Up @@ -65,7 +65,7 @@ const Settings = () => {
return (
<div className={ pageClassName }>
<EnableNewProductSyncNotice />
<NavigationClassic />
<MainTabNav />
<RebrandingTour />
<ContactInformationPreview />
<LinkedAccounts />
Expand Down
Loading