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

Release: 10.9.1 #10646

Merged
merged 10 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .wordpress-org/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
}
}
}
.wc-block-grid__product-image .wc-block-grid__product-onsale,
.wc-block-grid .wc-block-grid__product-onsale {
@include font-size(small);
padding: em($gap-smallest) em($gap-small);
Expand Down
42 changes: 42 additions & 0 deletions docs/internal-developers/testing/releases/1091.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Testing notes and ZIP for release 10.9.1

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

## WooCommerce Core

### Bug Fixes

#### Remove client side navigation from Products beta block. [#10636](https://github.com/woocommerce/woocommerce-blocks/pull/10636)

1. Create a new post
2. Add Products (Beta) block & publish it
3. On Frontend, verify that
1. Client-side navigation isn't there anymore i.e. changing the page should also refresh the page
2. Verify that Product button(Add to cart) still works as expected.

## Testing notes for the development team

### Bug Fixes

1. Checkout to the PR branch and run `npm run start`.
2. Enable a blocks theme (like TT3).
3. Create a new page or post.
4. Add the Products (Beta), Products Collection, Products by Attribute, Products by Tag, Products by Category, Handpicked products, and All products blocks.
5. Check the Sale badge is shown on the top-right corner of the image on all of them, in the editor, and in the frontend.
6. Go to the classic shop page and check the Sale badge also shows in the top-right corner of the product image.
7. Repeat steps 3 to 6 with Storefront enabled.

#### Screenshots

<table>
<tr>
<td valign="top">Before:
<br><br>
<img width="1245" alt="Screenshot 2023-08-17 at 09 57 30" src="https://github.com/woocommerce/woocommerce-blocks/assets/186112/fe1eda4a-549c-4b08-b4aa-34e4a24fbf87">
</td>
<td valign="top">After:
<br><br>
<img width="1248" alt="Screenshot 2023-08-17 at 09 56 36" src="https://github.com/woocommerce/woocommerce-blocks/assets/186112/9b93adbb-c0b9-4134-b6b2-250bd9bbee42">
</td>
</tr>
</table>
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 @@ -170,6 +170,7 @@ Every release includes specific testing instructions for new features and bug fi
- [10.8.2](./1082.md)
- [10.8.3](./1083.md)
- [10.9.0](./1090.md)
- [10.9.1](./1091.md)

<!-- FEEDBACK -->

Expand Down
13 changes: 12 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,18 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/

== Changelog ==

= 10.9/0 - 2023-08-14 =
= 10.9.1 - 2023-08-17 =

#### Enhancements

- Update WooCommerce Blocks brand assets. ([10622](https://github.com/woocommerce/woocommerce-blocks/pull/10622))

#### Bug Fixes

- Fix "On sale" badge class. ([10634](https://github.com/woocommerce/woocommerce-blocks/pull/10634))
- Remove client side navigation from Products beta block. ([10636](https://github.com/woocommerce/woocommerce-blocks/pull/10636))

= 10.9.0 - 2023-08-14 =

#### Enhancements

Expand Down
2 changes: 1 addition & 1 deletion src/BlockTypes/ProductButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ protected function render( $attributes, $content, $block ) {
return apply_filters(
'woocommerce_loop_add_to_cart_link',
strtr(
'<div class="wp-block-button wc-block-components-product-button {classes} {custom_classes}"
'<div data-wc-interactive class="wp-block-button wc-block-components-product-button {classes} {custom_classes}"
{div_directives}
>
<{html_element}
Expand Down
76 changes: 0 additions & 76 deletions src/BlockTypes/ProductQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,82 +80,6 @@ protected function initialize() {
);
add_filter( 'rest_product_query', array( $this, 'update_rest_query' ), 10, 2 );
add_filter( 'rest_product_collection_params', array( $this, 'extend_rest_query_allowed_params' ), 10, 1 );
add_filter( 'render_block_core/query', array( $this, 'add_navigation_id_directive' ), 10, 3 );
add_filter( 'render_block_core/query-pagination', array( $this, 'add_navigation_link_directives' ), 10, 3 );
}

/**
* Mark the Product Query as an interactive region so it can be updated
* during client-side navigation.
*
* @param string $block_content The block content.
* @param array $block The full block, including name and attributes.
* @param \WP_Block $instance The block instance.
*/
public function add_navigation_id_directive( $block_content, $block, $instance ) {
if ( self::is_woocommerce_variation( $block ) ) {
// Enqueue the Interactivity API runtime.
wp_enqueue_script( 'wc-interactivity' );

$p = new \WP_HTML_Tag_Processor( $block_content );

// Add `data-wc-navigation-id to the query block.
if ( $p->next_tag( array( 'class_name' => 'wp-block-query' ) ) ) {
$p->set_attribute(
'data-wc-navigation-id',
'woo-products-' . $block['attrs']['queryId']
);
$p->set_attribute( 'data-wc-interactive', true );
$block_content = $p->get_updated_html();
}
}

return $block_content;
}

/**
* Add interactive links to all anchors inside the Query Pagination block.
*
* @param string $block_content The block content.
* @param array $block The full block, including name and attributes.
* @param \WP_Block $instance The block instance.
*/
public function add_navigation_link_directives( $block_content, $block, $instance ) {
if (
self::is_woocommerce_variation( $this->parsed_block ) &&
$instance->context['queryId'] === $this->parsed_block['attrs']['queryId']
) {
$p = new \WP_HTML_Tag_Processor( $block_content );
$p->next_tag( array( 'class_name' => 'wp-block-query-pagination' ) );

while ( $p->next_tag( 'a' ) ) {
$class_attr = $p->get_attribute( 'class' );
$class_list = preg_split( '/\s+/', $class_attr );

$is_previous = in_array( 'wp-block-query-pagination-previous', $class_list, true );
$is_next = in_array( 'wp-block-query-pagination-next', $class_list, true );
$is_previous_or_next = $is_previous || $is_next;

$navigation_link_payload = array(
'prefetch' => $is_previous_or_next,
'scroll' => false,
);

$p->set_attribute(
'data-wc-navigation-link',
wp_json_encode( $navigation_link_payload )
);

if ( $is_previous ) {
$p->set_attribute( 'key', 'pagination-previous' );
} elseif ( $is_next ) {
$p->set_attribute( 'key', 'pagination-next' );
}
}
$block_content = $p->get_updated_html();
}

return $block_content;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,80 +20,80 @@
await merchant.changeLanguage( 'en_EN' );
} );

it( 'User can view translated Cart block', async () => {
it.skip( 'User can view translated Cart block', async () => {
await shopper.goToShop();
await shopper.addToCartFromShopPage( '128GB USB Stick' );
await shopper.block.goToCart();

await page.waitForSelector( '.wp-block-woocommerce-filled-cart-block' );

const productHeader = await page.waitForSelector(
'.wc-block-cart-items .wc-block-cart-items__header span'
);
await expect( productHeader ).toMatch( 'Product' );

const removeLink = await page.waitForSelector(
'.wc-block-cart-item__remove-link'
);
await expect( removeLink ).toMatch( 'Verwijder item' );

const submitButton = await page.waitForSelector(
'.wc-block-cart__submit-button'
);

await expect( submitButton ).toMatch( 'Ga naar afrekenen' );

const orderSummary = await page.$(
'.wp-block-woocommerce-cart-order-summary-block'
);

await expect( orderSummary ).toMatch( 'Subtotaal' );
// Skipping translation for now, as it's not available in WooCommerce Core.
await expect( orderSummary ).toMatch( 'Een waardebon toevoegen' );
await expect( orderSummary ).toMatch( 'Totaal' );
} );

Check warning on line 54 in tests/e2e-jest/specs/shopper/cart-checkout/translations.test.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

tests/e2e-jest/specs/shopper/cart-checkout/translations.test.js#L23-L54

[jest/no-disabled-tests] Skipped test

it( 'User can view translated Checkout block', async () => {
it.skip( 'User can view translated Checkout block', async () => {
await shopper.block.goToCheckout();

const contactHeading = await page.$(
'#contact-fields .wc-block-components-checkout-step__title'
);
await expect( contactHeading ).toMatch( 'Contactgegevens' );

const shippingHeading = await page.$(
'#shipping-fields .wc-block-components-checkout-step__title'
);
await expect( shippingHeading ).toMatch( 'Verzendadres' );

const shippingOptionsHeading = await page.$(
'#shipping-option .wc-block-components-checkout-step__title'
);
await expect( shippingOptionsHeading ).toMatch( 'Verzendopties' );

const paymentMethodHeading = await page.$(
'#payment-method .wc-block-components-checkout-step__title'
);
await expect( paymentMethodHeading ).toMatch( 'Betaalopties' );

const returnToCart = await page.$(
'.wc-block-components-checkout-return-to-cart-button'
);
await expect( returnToCart ).toMatch( 'Ga terug naar winkelwagen' );

const submitButton = await page.$(
'.wc-block-components-checkout-place-order-button'
);
await expect( submitButton ).toMatch( 'Plaats bestelling' );

const orderSummary = await page.$(
'.wp-block-woocommerce-checkout-order-summary-block'
);
await expect( orderSummary ).toMatch( 'Besteloverzicht' );
await expect( orderSummary ).toMatch( 'Subtotaal' );
// Skipping translation for now, as it's not available in WooCommerce Core.
// await expect( orderSummary ).toMatch( 'Een waardebon toevoegen' );
await expect( orderSummary ).toMatch( 'Verzending' );
await expect( orderSummary ).toMatch( 'Totaal' );
} );

Check warning on line 98 in tests/e2e-jest/specs/shopper/cart-checkout/translations.test.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

tests/e2e-jest/specs/shopper/cart-checkout/translations.test.js#L56-L98

[jest/no-disabled-tests] Skipped test
} );
4 changes: 2 additions & 2 deletions tests/e2e-jest/specs/shopper/mini-cart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,18 +543,18 @@
);
} );

it( 'User can see translation in filled Mini-Cart', async () => {
it.skip( 'User can see translation in filled Mini-Cart', async () => {
await page.click(
selectors.frontend.productWithAddToCartButton
);

await expect( page ).toMatchElement(
'.wc-block-mini-cart__footer-cart',
{
text: 'Bekijk mijn winkelwagen',
}
);
} );

Check warning on line 557 in tests/e2e-jest/specs/shopper/mini-cart.test.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

tests/e2e-jest/specs/shopper/mini-cart.test.js#L546-L557

[jest/no-disabled-tests] Skipped test
} );

describe( 'Block Themes', () => {
Expand All @@ -575,18 +575,18 @@
);
} );

it( 'User can see translation in filled Mini-Cart', async () => {
it.skip( 'User can see translation in filled Mini-Cart', async () => {
await page.click(
selectors.frontend.productWithAddToCartButton
);

await expect( page ).toMatchElement(
'.wc-block-mini-cart__footer-cart',
{
text: 'Bekijk mijn winkelwagen',
}
);
} );

Check warning on line 589 in tests/e2e-jest/specs/shopper/mini-cart.test.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

tests/e2e-jest/specs/shopper/mini-cart.test.js#L578-L589

[jest/no-disabled-tests] Skipped test
} );
} );
} );
Loading