From 5df5065011d6779a689358844212628757b6b5b9 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Tue, 26 Sep 2023 09:42:51 -0300 Subject: [PATCH 1/3] fix(checkout-button): handle 10+ product variations (#1536) --- src/blocks/checkout-button/edit.js | 2 +- src/modal-checkout/modal.scss | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/blocks/checkout-button/edit.js b/src/blocks/checkout-button/edit.js index 916ca9a1b..65f56ffae 100644 --- a/src/blocks/checkout-button/edit.js +++ b/src/blocks/checkout-button/edit.js @@ -167,7 +167,7 @@ function CheckoutButtonEdit( props ) { // Handle product variation data. if ( data?.variations?.length ) { setAttributes( { is_variable: true } ); - apiFetch( { path: `/wc/v2/products/${ data.id }/variations` } ) + apiFetch( { path: `/wc/v2/products/${ data.id }/variations?per_page=100` } ) .then( res => setVariations( res ) ) .catch( () => setVariations( [] ) ); } else { diff --git a/src/modal-checkout/modal.scss b/src/modal-checkout/modal.scss index d1792613a..9501696c0 100644 --- a/src/modal-checkout/modal.scss +++ b/src/modal-checkout/modal.scss @@ -51,7 +51,7 @@ opacity: 0.5; position: absolute; top: 50%; - transform: translate(-50%, -50%); + transform: translate( -50%, -50% ); width: 100%; > span { animation: spin 1s infinite linear; @@ -84,6 +84,8 @@ .newspack-blocks-variation-modal { &__content { padding: 32px; + overflow: auto; + border-radius: 5px; h3 { margin: 0 0 1em; } From 49406b9bf1075897939cad2e4c30f34efcf841da Mon Sep 17 00:00:00 2001 From: Derrick Koo Date: Thu, 28 Sep 2023 12:19:51 -0600 Subject: [PATCH 2/3] fix: query for CAP terms (#1535) --- includes/class-newspack-blocks.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/class-newspack-blocks.php b/includes/class-newspack-blocks.php index 8bfe39999..7b7fd1022 100644 --- a/includes/class-newspack-blocks.php +++ b/includes/class-newspack-blocks.php @@ -707,6 +707,7 @@ function ( $acc, $block ) use ( $block_name ) { if ( $authors && count( $authors ) ) { $co_authors_names = []; $author_names = []; + $author_emails = []; if ( $is_co_authors_plus_active ) { $co_authors_guest_authors = new CoAuthors_Guest_Authors(); @@ -736,7 +737,8 @@ function ( $acc, $block ) use ( $block_name ) { unset( $authors[ $index ] ); } } else { - $author_names[] = $author_data->user_login; + $author_names[] = $author_data->user_login; + $author_emails[] = $author_data->user_email; } } } @@ -771,6 +773,11 @@ function ( $acc, $block ) use ( $block_name ) { 'taxonomy' => 'author', 'terms' => $author_names, ], + [ + 'field' => 'name', + 'taxonomy' => 'author', + 'terms' => $author_emails, + ], ], ]; } From 868c89ca7fa3491929c9fe2247daf1f0fc8d7645 Mon Sep 17 00:00:00 2001 From: matticbot Date: Thu, 28 Sep 2023 18:22:24 +0000 Subject: [PATCH 3/3] chore(release): 1.75.1 [skip ci] ## [1.75.1](https://github.com/Automattic/newspack-blocks/compare/v1.75.0...v1.75.1) (2023-09-28) ### Bug Fixes * **checkout-button:** handle 10+ product variations ([#1536](https://github.com/Automattic/newspack-blocks/issues/1536)) ([5df5065](https://github.com/Automattic/newspack-blocks/commit/5df5065011d6779a689358844212628757b6b5b9)) * query for CAP terms ([#1535](https://github.com/Automattic/newspack-blocks/issues/1535)) ([49406b9](https://github.com/Automattic/newspack-blocks/commit/49406b9bf1075897939cad2e4c30f34efcf841da)) --- CHANGELOG.md | 8 ++++++++ newspack-blocks.php | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96323c537..bb98c2a28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [1.75.1](https://github.com/Automattic/newspack-blocks/compare/v1.75.0...v1.75.1) (2023-09-28) + + +### Bug Fixes + +* **checkout-button:** handle 10+ product variations ([#1536](https://github.com/Automattic/newspack-blocks/issues/1536)) ([5df5065](https://github.com/Automattic/newspack-blocks/commit/5df5065011d6779a689358844212628757b6b5b9)) +* query for CAP terms ([#1535](https://github.com/Automattic/newspack-blocks/issues/1535)) ([49406b9](https://github.com/Automattic/newspack-blocks/commit/49406b9bf1075897939cad2e4c30f34efcf841da)) + # [1.75.0](https://github.com/Automattic/newspack-blocks/compare/v1.74.2...v1.75.0) (2023-09-25) diff --git a/newspack-blocks.php b/newspack-blocks.php index a7ef9fa4a..86f4b5f8d 100755 --- a/newspack-blocks.php +++ b/newspack-blocks.php @@ -7,7 +7,7 @@ * Author URI: https://newspack.blog/ * Text Domain: newspack-blocks * Domain Path: /languages - * Version: 1.75.0 + * Version: 1.75.1 * * @package Newspack_Blocks */ @@ -15,7 +15,7 @@ define( 'NEWSPACK_BLOCKS__PLUGIN_FILE', __FILE__ ); define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' ); define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( NEWSPACK_BLOCKS__PLUGIN_FILE ) ); -define( 'NEWSPACK_BLOCKS__VERSION', '1.75.0' ); +define( 'NEWSPACK_BLOCKS__VERSION', '1.75.1' ); require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks.php'; require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks-api.php'; diff --git a/package-lock.json b/package-lock.json index 138b85a39..e6e76fad1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@automattic/newspack-blocks", - "version": "1.75.0", + "version": "1.75.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@automattic/newspack-blocks", - "version": "1.75.0", + "version": "1.75.1", "hasInstallScript": true, "license": "GPL-3.0-or-later", "dependencies": { diff --git a/package.json b/package.json index 0ec863827..a457ba91b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@automattic/newspack-blocks", - "version": "1.75.0", + "version": "1.75.1", "author": "Automattic", "devDependencies": { "@rushstack/eslint-patch": "^1.3.3",