diff --git a/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss b/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss index 17fb4cb709c..990809e7fac 100644 --- a/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss +++ b/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss @@ -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; @@ -18,6 +19,7 @@ $border-radius: 5px; > li { margin: 0; + width: 100%; > img { width: 100%; @@ -25,6 +27,12 @@ $border-radius: 5px; } } } + + @include breakpoint("<782px") { + .wc-block-components-express-payment__event-buttons { + grid-template-columns: 1fr; + } + } } .wc-block-components-express-payment--checkout { @@ -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 { diff --git a/assets/js/data/cart/push-changes.ts b/assets/js/data/cart/push-changes.ts index 85373cf9e88..8410a3a0a70 100644 --- a/assets/js/data/cart/push-changes.ts +++ b/assets/js/data/cart/push-changes.ts @@ -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. @@ -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, @@ -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 ); diff --git a/assets/js/editor-components/external-link-card/index.tsx b/assets/js/editor-components/external-link-card/index.tsx index 21c57081aca..3b0495cbf4f 100644 --- a/assets/js/editor-components/external-link-card/index.tsx +++ b/assets/js/editor-components/external-link-card/index.tsx @@ -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 @@ -50,7 +50,7 @@ const ExternalLinkCard = ( { ) } { warning ? ( - + } /> { warning } ) : null } diff --git a/docs/internal-developers/testing/releases/963.md b/docs/internal-developers/testing/releases/963.md new file mode 100644 index 00000000000..de101bb3fd9 --- /dev/null +++ b/docs/internal-developers/testing/releases/963.md @@ -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: + +image + +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` + +image + +| Before | After | +| ------ | ----- | +| image | image | diff --git a/docs/internal-developers/testing/releases/964.md b/docs/internal-developers/testing/releases/964.md new file mode 100644 index 00000000000..f1e5b9f78df --- /dev/null +++ b/docs/internal-developers/testing/releases/964.md @@ -0,0 +1,3 @@ +# Testing notes and ZIP for release 9.6.4 + +No User Facing Testing required with this patch release. diff --git a/docs/internal-developers/testing/releases/965.md b/docs/internal-developers/testing/releases/965.md new file mode 100644 index 00000000000..bbaf048d576 --- /dev/null +++ b/docs/internal-developers/testing/releases/965.md @@ -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. diff --git a/docs/internal-developers/testing/releases/966.md b/docs/internal-developers/testing/releases/966.md new file mode 100644 index 00000000000..28287b4ff63 --- /dev/null +++ b/docs/internal-developers/testing/releases/966.md @@ -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. diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index bb0227d9170..4448b3cfcab 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -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) diff --git a/package.json b/package.json index 9b189182276..977d5b1c24d 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/readme.txt b/readme.txt index f93191866b8..86b368679cc 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.2 -Stable tag: 9.6.2 +Stable tag: 9.6.5 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -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 diff --git a/src/BlockTypes/ProductImageGallery.php b/src/BlockTypes/ProductImageGallery.php index 43e84ebbe32..93300d21fcb 100644 --- a/src/BlockTypes/ProductImageGallery.php +++ b/src/BlockTypes/ProductImageGallery.php @@ -1,9 +1,6 @@ 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]; diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index ad996c8c3df..c0dae3766f7 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.6.2 + * Version: 9.6.5 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block