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

Commit

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

* Add changelog to readme.txt

* Unset default customer state if it doesn't match country (#8460)

* Unset default state

* add controller for customers

* rename validation file

* explain fix inline

* address feedback

* revert back state logic

* Update src/StoreApi/Utilities/ValidationUtils.php

Co-authored-by: Mike Jolley <mike.jolley@me.com>

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update readme.txt

* Add testing notes

* Update testing notes

* Fix Customer account sidebar link incorrect margin in WP 6.2 (#8437)

* Fix Customer account sidebar link incorrect margin in WP 6.2

* Update class name to match the guidelines

* Prevent cart from breaking when item_data contains an array (#8440)

* Ensure array item data is removed

* Remove unused key

* Clean up code and add comments

* Check for null instead of empty

* Use plain foreach to filter and map arrays

* Add minimum height to Mini Cart Contents block in the Style Book (#8458)

* Update testing notes zip file

* Update testing notes

* Update testing notes file

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* disable compatibilty layer (#8507)

* update changelog and testing instructions

* add zip link

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Add changelog in readme.txt

* Add testing notes

* Remove change from testing notes

This requires AvaTax credentials for testing. So, we'll test for
regressions instead

* Check for null session before going forward (#8537)

* Fix Payment Options settings crash in the editor (#8535)

* Ensure express payment buttons are visible next to each other (#8548)

* Update ZIP file

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Update readme.txt

* Show three Express Payments buttons in-line (#8601)

* Add testing notes

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Add changelog in readme.txt

* Undo dirty prop removal on error (#8633)

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Add testing notes

* fix 404 error (#8445)

* Empty commit for release pull request

* add testing instruction

* update zip link

* fix version

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
  • Loading branch information
9 people authored Mar 17, 2023
1 parent 228b8cd commit bb29e74
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ $border-radius: 5px;

.wc-block-components-express-payment__event-buttons {
list-style: none;
display: flex;
flex-direction: row;
flex-wrap: wrap;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(calc(33% - 10px), 1fr));
grid-gap: 10px;
box-sizing: border-box;
width: 100%;
padding: 0;
margin: 0;
Expand All @@ -18,13 +19,20 @@ $border-radius: 5px;

> li {
margin: 0;
width: 100%;

> img {
width: 100%;
height: 48px;
}
}
}

@include breakpoint("<782px") {
.wc-block-components-express-payment__event-buttons {
grid-template-columns: 1fr;
}
}
}

.wc-block-components-express-payment--checkout {
Expand Down Expand Up @@ -85,27 +93,6 @@ $border-radius: 5px;
margin-bottom: em($gap);
}
}

.wc-block-components-express-payment__event-buttons {
> li {
display: inline-block;
width: 50%;
}

> li:nth-child(even) {
padding-left: $gap-smaller;
}

> li:nth-child(odd) {
padding-right: $gap-smaller;
}

> li:only-child {
display: block;
width: 100%;
padding: 0;
}
}
}

.wc-block-components-express-payment--cart {
Expand Down
26 changes: 22 additions & 4 deletions assets/js/data/cart/push-changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ const dirtyProps = <
const updateCustomerData = debounce( (): void => {
const { billingAddress, shippingAddress } = customerData;
const validationStore = select( VALIDATION_STORE_KEY );
const customerDataToUpdate = {} as Partial< BillingAddressShippingAddress >;

// Before we push anything, we need to ensure that the data we're pushing (dirty fields) are valid, otherwise we will
// abort and wait for the validation issues to be resolved.
Expand All @@ -150,6 +149,8 @@ const updateCustomerData = debounce( (): void => {
}

// Find valid data from the list of dirtyProps and prepare to push to the server.
const customerDataToUpdate = {} as Partial< BillingAddressShippingAddress >;

if ( dirtyProps.billingAddress.length ) {
customerDataToUpdate.billing_address = pick(
billingAddress,
Expand All @@ -166,14 +167,31 @@ const updateCustomerData = debounce( (): void => {
dirtyProps.shippingAddress = [];
}

// If there is customer data to update, push it to the server.
if ( Object.keys( customerDataToUpdate ).length ) {
dispatch( STORE_KEY )
.updateCustomerData( customerDataToUpdate )
.then( () => {
removeAllNotices();
} )
.then( removeAllNotices )
.catch( ( response ) => {
processErrorResponse( response );

// Data did not persist due to an error. Make the props dirty again so they get pushed to the server.
if ( customerDataToUpdate.billing_address ) {
dirtyProps.billingAddress = [
...dirtyProps.billingAddress,
...( Object.keys(
customerDataToUpdate.billing_address
) as BaseAddressKey[] ),
];
}
if ( customerDataToUpdate.shipping_address ) {
dirtyProps.shippingAddress = [
...dirtyProps.shippingAddress,
...( Object.keys(
customerDataToUpdate.shipping_address
) as BaseAddressKey[] ),
];
}
} );
}
}, 1000 );
Expand Down
4 changes: 2 additions & 2 deletions assets/js/editor-components/external-link-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n';
import { Icon, external } from '@wordpress/icons';
import { VisuallyHidden } from '@wordpress/components';
import { sanitizeHTML } from '@woocommerce/utils';
import { alert } from '@woocommerce/icons';
import { Alert } from '@woocommerce/icons';

/**
* Internal dependencies
Expand Down Expand Up @@ -50,7 +50,7 @@ const ExternalLinkCard = ( {
) }
{ warning ? (
<span className="wc-block-editor-components-external-link-card__warning">
<Icon icon={ alert } />
<Icon icon={ <Alert status="error" /> } />
<span>{ warning }</span>
</span>
) : null }
Expand Down
22 changes: 22 additions & 0 deletions docs/internal-developers/testing/releases/963.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Testing notes and ZIP for release 9.6.3

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


## WooCommerce Core

### Fix the Checkout Blocks "Payment Options" settings crash in the editor. ([8535](https://github.com/woocommerce/woocommerce-blocks/pull/8535))

1. Install and enable an incompatible payment gateway plugin with the `Cart` & `Checkout` Blocks. (e.g., [IDPay Payment Gateway for Woocommerce](https://wordpress.org/plugins/woo-idpay-gateway/))
2. Create a new page and add the `Checkout` Block
3. Select the Checkout Block or any of its Inner Blocks (except for the `Payment Options` Inner Block). Ensure our incompatible payment gateway (e.g., IDPay) is listed under the incompatible gateways notice:

<img width="500" alt="image" src="https://user-images.githubusercontent.com/14235870/221174704-1d12e2bc-6c6c-4089-a2d2-a7bedc7f55c3.png">

4. Select the `Payment Options` Inner Block. Ensure its settings are correctly displayed, the incompatible gateways notice is showing and our incompatible payment Gateway is highlighted under `Settings -> Block -> Methods`

<img width="500" alt="image" src="https://user-images.githubusercontent.com/14235870/221178227-e4e12f08-dd88-4aac-824c-3990bde13a89.png">

| Before | After |
| ------ | ----- |
| <img width="1874" alt="image" src="https://user-images.githubusercontent.com/14235870/221171831-6245b687-a377-4730-92ab-8710360ee060.png"> | <img width="1208" alt="image" src="https://user-images.githubusercontent.com/14235870/221178227-e4e12f08-dd88-4aac-824c-3990bde13a89.png"> |
3 changes: 3 additions & 0 deletions docs/internal-developers/testing/releases/964.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Testing notes and ZIP for release 9.6.4

No User Facing Testing required with this patch release.
13 changes: 13 additions & 0 deletions docs/internal-developers/testing/releases/965.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Testing notes and ZIP for release 9.6.5

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


## WooCommerce Core

### Checkout: Fix state validation after changing shipping country. ([8633](https://github.com/woocommerce/woocommerce-blocks/pull/8633)

1. With a default valid US shipping address set, add an item to the cart and proceed to checkout.
2. Change the shipping address country to India. You will see an error about the incorrect postcode.
3. Select an India state from the dropdown. You will see an error about the incorrect postcode.
4. Enter a valid postcode `411014`. All errors should go away.
11 changes: 11 additions & 0 deletions docs/internal-developers/testing/releases/966.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Testing notes and ZIP for release 9.6.6

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


## WooCommerce Core

### Product Image Gallery: fix 404 error. ([8445](https://github.com/woocommerce/woocommerce-blocks/pull/8445))

1. Add a new post or page.
2. Check the console and see that any 404 error is visible.
5 changes: 4 additions & 1 deletion docs/internal-developers/testing/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ Every release includes specific testing instructions for new features and bug fi
- [9.6.0](./960.md)
- [9.6.1](./961.md)
- [9.6.2](./962.md)

- [9.6.3](./963.md)
- [9.6.4](./964.md)
- [9.6.5](./965.md)
- [9.6.6](./965.md)

<!-- FEEDBACK -->

Expand Down
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.6.2",
"version": "9.6.5",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [
Expand Down
28 changes: 27 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.2
Stable tag: 9.6.2
Stable tag: 9.6.5
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

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

== Changelog ==

= 9.6.6 - 2023-03-17 =

#### Bug Fixes

- Product Image Gallery: fix 404 error. ([8445](https://github.com/woocommerce/woocommerce-blocks/pull/8445))

= 9.6.5 - 2023-03-06 =

#### Bug Fixes

- Checkout: Fix state validation after changing shipping country. ([8633](https://github.com/woocommerce/woocommerce-blocks/pull/8633)

= 9.6.4 - 2023-03-03 =

#### Bug Fixes

- Fix: Show up to three Express Payments buttons next to each other. ([8601](https://github.com/woocommerce/woocommerce-blocks/pull/8601))

= 9.6.3 - 2023-02-27 =

#### Bug Fixes

- Fix: Ensure that Express Payment buttons are visible next to each other. ([8548](https://github.com/woocommerce/woocommerce-blocks/pull/8548))
- Check if session is set before returning updated customer address. ([8537](https://github.com/woocommerce/woocommerce-blocks/pull/8537))
- Fix the Checkout Blocks "Payment Options" settings crash in the editor. ([8535](https://github.com/woocommerce/woocommerce-blocks/pull/8535))

= 9.6.2 - 2023-02-22 =

#### Bug Fixes
Expand Down
10 changes: 7 additions & 3 deletions src/BlockTypes/ProductImageGallery.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

use Automattic\WooCommerce\Blocks\Utils\StyleAttributesUtils;


/**
* ProductImageGallery class.
*/
Expand All @@ -15,6 +12,13 @@ class ProductImageGallery extends AbstractBlock {
*/
protected $block_name = 'product-image-gallery';

/**
* It isn't necessary register block assets because it is a server side block.
*/
protected function register_block_type_assets() {
return null;
}

/**
* Register the context
*
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.6.2';
$version = '9.6.5';
return new NewPackage(
$version,
dirname( __DIR__ ),
Expand Down
4 changes: 4 additions & 0 deletions src/Shipping/ShippingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ public function flush_cache( $settings ) {
* @return array
*/
public function filter_taxable_address( $address ) {

if ( null === WC()->session ) {
return $address;
}
// We only need to select from the first package, since pickup_location only supports a single package.
$chosen_method = current( WC()->session->get( 'chosen_shipping_methods', array() ) ) ?? '';
$chosen_method_id = explode( ':', $chosen_method )[0];
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.6.2
* Version: 9.6.5
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block
Expand Down

0 comments on commit bb29e74

Please sign in to comment.