From 65da5075656e1d7754482bc58ed50572e30aa6bc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:45:49 +0100 Subject: [PATCH] Release: 9.1.4 (#8102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Empty commit for release pull request * Fix for Rating alignment when used in Products block and Classic Template (#8104) * Hide `core/no-results` as default in Product Query if WP <= 5.9 (#8082) `core/no-results` was not available until WP 6.0. * Update the readme * Add testing notes * Remove the “Products (Beta)” block from WP 6.0 or lower (#8112) * Remove the Products block from WP < 6.0 Too many APIs which are required for the Products block experience are just plainly unavailable in versions lower than 6.0. * Revert "Fix for Rating alignment when used in Products block and Classic Template (#8104)" This reverts commit 8af92ee68a82c04db9dbef0b204c4f398755278c. Co-authored-by: github-actions Co-authored-by: kmanijak Co-authored-by: Lucio Giannotta --- assets/js/blocks/product-query/index.tsx | 13 ++-- .../variations/product-query.tsx | 59 ++++++++++--------- .../testing/releases/914.md | 12 ++++ .../testing/releases/README.md | 3 +- package.json | 2 +- readme.txt | 8 ++- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 8 files changed, 62 insertions(+), 39 deletions(-) create mode 100644 docs/internal-developers/testing/releases/914.md diff --git a/assets/js/blocks/product-query/index.tsx b/assets/js/blocks/product-query/index.tsx index 3b9b872c73f..af32b0c1b2a 100644 --- a/assets/js/blocks/product-query/index.tsx +++ b/assets/js/blocks/product-query/index.tsx @@ -3,6 +3,7 @@ */ import type { Block } from '@wordpress/blocks'; import { addFilter } from '@wordpress/hooks'; +import { isWpVersion } from '@woocommerce/settings'; /** * Internal dependencies @@ -35,8 +36,10 @@ function registerProductQueryElementsNamespace( return props; } -addFilter( - 'blocks.registerBlockType', - 'core/custom-class-name/attribute', - registerProductQueryElementsNamespace -); +if ( isWpVersion( '6.1', '>=' ) ) { + addFilter( + 'blocks.registerBlockType', + 'core/custom-class-name/attribute', + registerProductQueryElementsNamespace + ); +} diff --git a/assets/js/blocks/product-query/variations/product-query.tsx b/assets/js/blocks/product-query/variations/product-query.tsx index c993c6903ed..73362b8bf0d 100644 --- a/assets/js/blocks/product-query/variations/product-query.tsx +++ b/assets/js/blocks/product-query/variations/product-query.tsx @@ -5,6 +5,7 @@ import { registerBlockVariation } from '@wordpress/blocks'; import { Icon } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { stacks } from '@woocommerce/icons'; +import { isWpVersion } from '@woocommerce/settings'; /** * Internal dependencies @@ -18,31 +19,33 @@ import { const VARIATION_NAME = 'woocommerce/product-query'; -registerBlockVariation( QUERY_LOOP_ID, { - description: __( - 'A block that displays a selection of products in your store.', - 'woo-gutenberg-products-block' - ), - name: VARIATION_NAME, - /* translators: “Products“ is the name of the block. */ - title: __( 'Products (Beta)', 'woo-gutenberg-products-block' ), - isActive: ( blockAttributes ) => - blockAttributes.namespace === VARIATION_NAME, - icon: ( - - ), - attributes: { - ...QUERY_DEFAULT_ATTRIBUTES, - namespace: VARIATION_NAME, - }, - // Gutenberg doesn't support this type yet, discussion here: - // https://github.com/WordPress/gutenberg/pull/43632 - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - allowedControls: DEFAULT_ALLOWED_CONTROLS, - innerBlocks: INNER_BLOCKS_TEMPLATE, - scope: [ 'inserter' ], -} ); +if ( isWpVersion( '6.1', '>=' ) ) { + registerBlockVariation( QUERY_LOOP_ID, { + description: __( + 'A block that displays a selection of products in your store.', + 'woo-gutenberg-products-block' + ), + name: VARIATION_NAME, + /* translators: “Products“ is the name of the block. */ + title: __( 'Products (Beta)', 'woo-gutenberg-products-block' ), + isActive: ( blockAttributes ) => + blockAttributes.namespace === VARIATION_NAME, + icon: ( + + ), + attributes: { + ...QUERY_DEFAULT_ATTRIBUTES, + namespace: VARIATION_NAME, + }, + // Gutenberg doesn't support this type yet, discussion here: + // https://github.com/WordPress/gutenberg/pull/43632 + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + allowedControls: DEFAULT_ALLOWED_CONTROLS, + innerBlocks: INNER_BLOCKS_TEMPLATE, + scope: [ 'inserter' ], + } ); +} diff --git a/docs/internal-developers/testing/releases/914.md b/docs/internal-developers/testing/releases/914.md new file mode 100644 index 00000000000..a8bfd7dd180 --- /dev/null +++ b/docs/internal-developers/testing/releases/914.md @@ -0,0 +1,12 @@ +# Testing notes and ZIP for release 9.1.4 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10356174/woocommerce-gutenberg-products-block.zip) + +## Feature plugin and package inclusion in WooCommerce + +### Remove the “Products (Beta)” block from WP 6.0 or lower ([8112](https://github.com/woocommerce/woocommerce-blocks/pull/8112)) + +1. Install a WordPress version equal to 6.0 or lower. +2. Ensure that you can't add the “Products (Beta)” block. +3. Install a version higher than 6.0. +4. Ensure that you can add the “Products (Beta)” block correctly. diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index b3e7761ddd9..2f181ff44f2 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -110,7 +110,7 @@ Every release includes specific testing instructions for new features and bug fi - [9.1.1](./911.md) - [9.1.2](./912.md) - [9.1.3](./913.md) - + - [9.1.4](./914.md) @@ -121,4 +121,3 @@ Every release includes specific testing instructions for new features and bug fi 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/internal-developers/testing/releases/README.md) - diff --git a/package.json b/package.json index a6d9141f523..7718493e622 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "9.1.3", + "version": "9.1.4", "description": "WooCommerce blocks for the Gutenberg editor.", "homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/", "keywords": [ diff --git a/readme.txt b/readme.txt index 35e283a556f..57d236462fc 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 6.1.1 Tested up to: 6.1.1 Requires PHP: 7.0 -Stable tag: 9.1.3 +Stable tag: 9.1.4 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -79,6 +79,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 9.1.4 - 2023-01-04 = + +#### Compatibility + +- Products (Beta): Remove the block from WordPress 6.0 and lower. ([8112](https://github.com/woocommerce/woocommerce-blocks/pull/8112)) + = 9.1.3 - 2022-12-21 = #### Enhancements diff --git a/src/Package.php b/src/Package.php index 3966881850e..df0afb3120d 100644 --- a/src/Package.php +++ b/src/Package.php @@ -109,7 +109,7 @@ public static function container( $reset = false ) { NewPackage::class, function ( $container ) { // leave for automated version bumping. - $version = '9.1.3'; + $version = '9.1.4'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index 6a8767aa2a7..ee656239f38 100644 --- a/woocommerce-gutenberg-products-block.php +++ b/woocommerce-gutenberg-products-block.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce Blocks * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block * Description: WooCommerce blocks for the Gutenberg editor. - * Version: 9.1.3 + * Version: 9.1.4 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block