Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Release: 9.1.4 (#8102)
Browse files Browse the repository at this point in the history
* 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 8af92ee.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
  • Loading branch information
4 people authored Jan 5, 2023
1 parent 388a8b9 commit 65da507
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 39 deletions.
13 changes: 8 additions & 5 deletions assets/js/blocks/product-query/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import type { Block } from '@wordpress/blocks';
import { addFilter } from '@wordpress/hooks';
import { isWpVersion } from '@woocommerce/settings';

/**
* Internal dependencies
Expand Down Expand Up @@ -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
);
}
59 changes: 31 additions & 28 deletions assets/js/blocks/product-query/variations/product-query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: (
<Icon
icon={ stacks }
className="wc-block-editor-components-block-icon wc-block-editor-components-block-icon--stacks"
/>
),
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: (
<Icon
icon={ stacks }
className="wc-block-editor-components-block-icon wc-block-editor-components-block-icon--stacks"
/>
),
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' ],
} );
}
12 changes: 12 additions & 0 deletions docs/internal-developers/testing/releases/914.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 1 addition & 2 deletions docs/internal-developers/testing/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- FEEDBACK -->

Expand All @@ -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)

<!-- /FEEDBACK -->

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__ ),
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-gutenberg-products-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65da507

Please sign in to comment.