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

Commit

Permalink
Release: 10.4.4 (#9973)
Browse files Browse the repository at this point in the history
* Empty commit for release pull request

* Add back filter blocks frontend scripts (#9954)

* Update changelog and bump version to 10.4.4

* Add testing notes for 10.4.4 release

* Update testing notes for release 10.4.4

* Replace Automated tests badge with Unit and E2E tests badge

* Wait for cart to be removed when emptied (#9829)

* Temporarily skip PHP Unit Tests for PHP 8.1 and 8.2 (#9859)

* Allow failure of the PHP Unit Tests

* Limit the PHP versions to 7.4 and 8.0 to run unit tests

* Don't allow failing fast

* Add a comment explaining the skipped part

* Cancel jobs later

* Cancel all the steps in workflow based on the same condition

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Albert Juhé Lluveras <[email protected]>
Co-authored-by: Alexandre Lara <[email protected]>
Co-authored-by: Mike Jolley <[email protected]>
Co-authored-by: Karol Manijak <[email protected]>
  • Loading branch information
6 people authored Jun 23, 2023
1 parent 532fb99 commit 633e062
Show file tree
Hide file tree
Showing 17 changed files with 182 additions and 40 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,28 +80,38 @@ jobs:
##
- name: Set up PHP
uses: shivammathur/setup-php@v2
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
with:
php-version: '${{ matrix.php }}'
ini-file: development
coverage: none

# Ensure that Composer installs the correct versions of packages.
- name: Override PHP version in composer.json
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
run: |
composer config platform.php ${{ matrix.php }}
composer update
- name: Install npm dependencies
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
run: |
npm ci
npm run build
- name: Docker debug information
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
run: |
docker -v
docker-compose -v
- name: General debug information
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
run: |
npm --version
node --version
Expand All @@ -111,12 +121,18 @@ jobs:
locale -a
- name: Start Docker environment
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
run: npm run wp-env start --update

- name: Log running Docker containers
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
run: docker ps -a

- name: Docker container debug information
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
run: |
npm run wp-env run tests-mysql mysql -- --version
npm run wp-env run tests-wordpress "php --version"
Expand All @@ -125,4 +141,6 @@ jobs:
npm run wp-env run tests-wordpress "locale -a"
- name: Run PHPUnit tests
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
run: npm run test:php
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
[![View](https://img.shields.io/badge/Project%20Components-brightgreen.svg?style=flat)](https://woocommerce.github.io/woocommerce-blocks/)
![JavaScript and CSS Linting](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/JavaScript%20and%20CSS%20Linting/badge.svg?branch=trunk)
![PHP Coding Standards](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/PHP%20Coding%20Standards/badge.svg?branch=trunk)
![Automated tests](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/Automated%20tests/badge.svg?branch=trunk)
![Unit Tests](https://github.com/woocommerce/woocommerce-blocks/workflows/E2E%20tests/badge.svg?branch=trunk)
![E2E Tests](https://github.com/woocommerce/woocommerce-blocks/workflows/Unit%20Tests/badge.svg?branch=trunk)

This is the feature plugin for WooCommerce + Gutenberg. This plugin serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor.

Expand Down
23 changes: 23 additions & 0 deletions assets/js/blocks/attribute-filter/frontend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* External dependencies
*/
import { renderFrontend } from '@woocommerce/base-utils';

/**
* Internal dependencies
*/
import Block from './block';
import { parseAttributes } from './utils';

const getProps = ( el: HTMLElement ) => {
return {
isEditor: false,
attributes: parseAttributes( el.dataset ),
};
};

renderFrontend( {
selector: '.wp-block-woocommerce-attribute-filter',
Block,
getProps,
} );
23 changes: 23 additions & 0 deletions assets/js/blocks/price-filter/frontend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* External dependencies
*/
import { renderFrontend } from '@woocommerce/base-utils';

/**
* Internal dependencies
*/
import Block from './block';
import { parseAttributes } from './utils';

const getProps = ( el: HTMLElement ) => {
return {
attributes: parseAttributes( el.dataset ),
isEditor: false,
};
};

renderFrontend( {
selector: '.wp-block-woocommerce-price-filter',
Block,
getProps,
} );
23 changes: 23 additions & 0 deletions assets/js/blocks/stock-filter/frontend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* External dependencies
*/
import { renderFrontend } from '@woocommerce/base-utils';

/**
* Internal dependencies
*/
import Block from './block';
import { parseAttributes } from './utils';

const getProps = ( el: HTMLElement ) => {
return {
attributes: parseAttributes( el.dataset ),
isEditor: false,
};
};

renderFrontend( {
selector: '.wp-block-woocommerce-stock-filter',
Block,
getProps,
} );
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://woocommerce.com/",
"type": "wordpress-plugin",
"version": "10.4.3",
"version": "10.4.4",
"keywords": [
"gutenberg",
"woocommerce",
Expand Down
75 changes: 75 additions & 0 deletions docs/internal-developers/testing/releases/1044.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Testing notes and ZIP for release 10.4.4

Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11840529/woocommerce-gutenberg-products-block.zip)

## WooCommerce Core

### Add back filter blocks frontend scripts ([9954](https://github.com/woocommerce/woocommerce-blocks/pull/9954))

#### Test that the old markup of filter blocks still works

```text
Important: test needs to be conducted using WooCommerce 7.8
```

1. Add a new page, click on three dots on the right top corner and select "Code Editor"
![image](https://github.com/woocommerce/woocommerce-blocks/assets/11503784/dc294e6a-d924-49b0-8ce5-51f0df829390)

2. Paste the following code and exit the code editor

```HTML
<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"33.33%"} -->
<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:woocommerce/price-filter -->
<div class="wp-block-woocommerce-price-filter is-loading" data-showinputfields="true" data-showfilterbutton="false" data-heading="Filter by price" data-heading-level="3"><span aria-hidden="true" class="wc-block-product-categories__placeholder"></span></div>
<!-- /wp:woocommerce/price-filter -->

<!-- wp:woocommerce/attribute-filter {"attributeId":1,"displayStyle":"dropdown","heading":"Filter by Color"} -->
<div class="wp-block-woocommerce-attribute-filter is-loading" data-attribute-id="1" data-show-counts="true" data-query-type="or" data-heading="Filter by Color" data-heading-level="3" data-display-style="dropdown"><span aria-hidden="true" class="wc-block-product-attribute-filter__placeholder"></span></div>
<!-- /wp:woocommerce/attribute-filter -->

<!-- wp:woocommerce/attribute-filter {"attributeId":2,"heading":"Filter by Size"} -->
<div class="wp-block-woocommerce-attribute-filter is-loading" data-attribute-id="2" data-show-counts="true" data-query-type="or" data-heading="Filter by Size" data-heading-level="3"><span aria-hidden="true" class="wc-block-product-attribute-filter__placeholder"></span></div>
<!-- /wp:woocommerce/attribute-filter -->

<!-- wp:woocommerce/active-filters -->
<div class="wp-block-woocommerce-active-filters is-loading" data-display-style="list" data-heading="Active filters" data-heading-level="3"><span aria-hidden="true" class="wc-block-active-product-filters__placeholder"></span></div>
<!-- /wp:woocommerce/active-filters -->

<!-- wp:woocommerce/stock-filter -->
<div class="wp-block-woocommerce-stock-filter is-loading" data-show-counts="true" data-heading="Filter by stock status" data-heading-level="3"><span aria-hidden="true" class="wc-block-product-stock-filter__placeholder"></span></div>
<!-- /wp:woocommerce/stock-filter --></div>
<!-- /wp:column -->

<!-- wp:column {"width":"66.66%"} -->
<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:woocommerce/all-products {"columns":3,"rows":3,"alignButtons":false,"contentVisibility":{"orderBy":true},"orderby":"date","layoutConfig":[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]]} -->
<div class="wp-block-woocommerce-all-products wc-block-all-products" data-attributes="{&quot;alignButtons&quot;:false,&quot;columns&quot;:3,&quot;contentVisibility&quot;:{&quot;orderBy&quot;:true},&quot;isPreview&quot;:false,&quot;layoutConfig&quot;:[[&quot;woocommerce/product-image&quot;],[&quot;woocommerce/product-title&quot;],[&quot;woocommerce/product-price&quot;],[&quot;woocommerce/product-rating&quot;],[&quot;woocommerce/product-button&quot;]],&quot;orderby&quot;:&quot;date&quot;,&quot;rows&quot;:3}"></div>
<!-- /wp:woocommerce/all-products --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
```

2. Publish the page.
3. Go to the frontend.
4. Verify filter blocks are rendered correctly. Interact with them and verify they work properly.

Before | After
--- | ---
![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/534ddab8-9bd2-4dde-a41c-7655ab88f265) | ![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/67992042-c508-48c7-884a-2dfdb75fdc3b)



##### Test that filter blocks translations are loaded correctly

```text
Important: test needs to be conducted using WooCommerce 7.7
```

1. Change your store language to a locale that has translations (ie: Spanish).
2. Add the Filter by Attribute, Filter by Price, Filter by Stock and Filter by Rating blocks to a post or page, alongside the Active Filters and Products (beta) blocks.
3. In the frontend, interact with the filter blocks and verify they all work properly.
4. Verify translations are loaded correctly. Ie: Filter by Attribute shows "Seleccionar" instead of "Select" in the input field.

Before | After
--- | ---
![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/db3c0465-bbb9-4098-8338-3a7418de0284) | ![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/aec0a8d7-0af2-4166-b0a1-68f1f2d62e01)
1 change: 1 addition & 0 deletions docs/internal-developers/testing/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Every release includes specific testing instructions for new features and bug fi
- [10.4.0](./1040.md)
- [10.4.2](./1042.md)
- [10.4.3](./1043.md)
- [10.4.4](./1044.md)

<!-- FEEDBACK -->

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "10.4.3",
"version": "10.4.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.2
Tested up to: 6.2
Requires PHP: 7.3
Stable tag: 10.4.3
Stable tag: 10.4.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -81,6 +81,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/

== Changelog ==

= 10.4.4 - 2023-06-22 =

#### Bug Fixes

- Fix filter blocks using the old markup not rendering and fix missing translations in those blocks. ([9954](https://github.com/woocommerce/woocommerce-blocks/pull/9954))

= 10.4.3 - 2023-06-20 =

#### Bug Fixes
Expand Down
9 changes: 0 additions & 9 deletions src/BlockTypes/AttributeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,4 @@ protected function enqueue_data( array $attributes = [] ) {
parent::enqueue_data( $attributes );
$this->asset_data_registry->add( 'attributes', array_values( wc_get_attribute_taxonomies() ), true );
}

/**
* Get the frontend script handle for this block type.
*
* @param string $key Data to get, or default to everything.
*/
protected function get_block_type_script( $key = null ) {
return null;
}
}
9 changes: 0 additions & 9 deletions src/BlockTypes/PriceFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,4 @@ class PriceFilter extends AbstractBlock {
protected $block_name = 'price-filter';
const MIN_PRICE_QUERY_VAR = 'min_price';
const MAX_PRICE_QUERY_VAR = 'max_price';

/**
* Get the frontend script handle for this block type.
*
* @param string $key Data to get, or default to everything.
*/
protected function get_block_type_script( $key = null ) {
return null;
}
}
9 changes: 0 additions & 9 deletions src/BlockTypes/StockFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,4 @@ protected function enqueue_data( array $stock_statuses = [] ) {
public static function get_stock_status_query_var_values() {
return array_keys( wc_get_product_stock_status_options() );
}

/**
* Get the frontend script handle for this block type.
*
* @param string $key Data to get, or default to everything.
*/
protected function get_block_type_script( $key = null ) {
return null;
}
}
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 = '10.4.3';
$version = '10.4.4';
return new NewPackage(
$version,
dirname( __DIR__ ),
Expand Down
9 changes: 4 additions & 5 deletions tests/utils/shopper.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,10 @@ export const shopper = {
await uiUnblocked();
}

await page.waitForSelector( '.woocommerce-info' );
// eslint-disable-next-line jest/no-standalone-expect
await expect( page ).toMatchElement(
'.woocommerce-info.cart-empty'
);
// Wait for form to be hidden.
await page.waitForSelector( '.woocommerce-cart-form', {
hidden: true,
} );
},

placeOrder: async () => {
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: 10.4.3
* Version: 10.4.4
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block
Expand Down

0 comments on commit 633e062

Please sign in to comment.