diff --git a/docs/internal-developers/testing/releases/840.md b/docs/internal-developers/testing/releases/840.md
new file mode 100644
index 00000000000..dcd27987102
--- /dev/null
+++ b/docs/internal-developers/testing/releases/840.md
@@ -0,0 +1,138 @@
+# Testing notes and ZIP for release 8.4.0
+
+Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/9444105/woocommerce-gutenberg-products-block.zip)
+
+## Feature plugin and package inclusion in WooCommerce
+
+### Update the filter `Apply` buttons to match the new designs. ([6958](https://github.com/woocommerce/woocommerce-blocks/pull/6958))
+
+1. Create a new page and add the `All Products` block and the filter pattern containing all filter blocks.
+2. Save it and check the buttons look like the `After` screenshot on the editor and the frontend.
+
+| Before | After |
+| ------ | ----- |
+| | |
+
+### Update the design of the Filter Products by Attribute block. ([6920](https://github.com/woocommerce/woocommerce-blocks/pull/6920))
+
+1. Add the `Filter by Attribute` block to a page.
+2. Check that it looks like the new design in the editor and the front-end.
+3. Check that the `Reset` button appears when a checkbox is checked.
+4. Edit the page and change the Display Style to dropdown.
+5. Check that it looks like the new design in the editor and the front-end (it won't look exactly like the design, check [this conversation](p1660817888642199-slack-C02SGH7JBGS) for more context)
+
+| Before | After |
+| ------ | ----- |
+| | |
+| | |
+| | |
+
+### Update the design of the Filter by Attribute block settings panel. ([6912](https://github.com/woocommerce/woocommerce-blocks/pull/6912))
+
+1. Add the `Filter by Attribute` block to a page.
+2. Check the copy and the design matches with the new design.
+3. Check no regression has happened.
+
+### Terms and conditions, and Privacy policy links open in a new tab by default. ([6908](https://github.com/woocommerce/woocommerce-blocks/pull/6908))
+
+1. Insert Checkout page and save the page.
+2. On frontend, click on the terms or privacy links in the checkout block.
+3. They should open in a new tab.
+
+### Layout updates to the Active Filters block. ([6905](https://github.com/woocommerce/woocommerce-blocks/pull/6905))
+
+1. Add the Active Filters block alongside some other Filters blocks.
+2. Apply some filters to the page.
+3. Confirm the layout matches the **After** screenshot above.
+4. Confirm the **Remove Filter** buttons for each active filter have a hover state of an alternate shade of grey - also confirm they function as expected.
+
+| Before | After |
+| ------ | ----- |
+| | |
+| | |
+| | |
+
+### Update the design of the Filter Products by Stock block. ([6883](https://github.com/woocommerce/woocommerce-blocks/pull/6883))
+
+1. Add the Filter by Stock component to a page using the All Products block, and also a block template.
+2. Check that the control panel for this block looks like the design (minus Typography)
+3. On both the page and the template frontends select a checkbox and observe that it looks as it should do with the design.
+4. Check that a "Reset" button appears and clicking this resets the filter again.
+5. Now go to your Edit Page & Edit Template pages and enable "'Apply filters' button".
+6. On the frontends again, re-select your filter options and check that they are not applied immediately until you click "Apply"
+7. Check that when this block is used with the PHP template & the All Products block that regardless of whether the "Apply Filters" button is active, that clicking "Reset" immediately clears the selected filter options
+
+| Before | After |
+| ------ | ----- |
+| | |
+
+### Update the design of the Filter Products by Price block. ([6877](https://github.com/woocommerce/woocommerce-blocks/pull/6877))
+
+1. Add `Filter Products by Price` block to a page.
+2. Verify that the `Inline input fields` only shows when the `Price Range` is Editable.
+3. Toggle Inline input fields, see the block in the editor updates accordingly.
+4. Toggle Filter button, see the Reset and Apply button.
+5. Add the All Products block then save the page.
+6. On the front end, see the new style applied as in the editor.
+7. Change the price using the slider then click the Apply button.
+8. See the filter works as expected.
+9. Click on the Reset button, see the price filter is reset. (Even if the filter button is enabled, clicking on the reset button should reset the filter query).
+10. Tested again with PHP templates, ensure no regression.
+
+
+
+### Allow making the Cart/Checkout block page the default one from within the editor. ([6867](https://github.com/woocommerce/woocommerce-blocks/pull/6867))
+
+To test this feature you need the latest trunk of WooCommerce, or WooCommerce 6.9.0. For older versions of WC (pre 6.9.0), the notice would show the old text:
+
+
+
+1. Make sure you have a Cart and Checkout pages in WooCommerce -> Settings -> Advanced.
+2. Those pages urls can be `/cart` and `/checkout`.
+3. Open a new page, give it a title, insert Cart block.
+4. Select Cart block, you should see the notice, select an inner block, you should see the notice as well.
+5. Click on the notice, it will load for a couple of seconds, once it's green, visit your new page.
+6. Make sure it's on the previous url, so `/cart`.
+7. Go back to settings, make sure your new page is that value there.
+8. Do the same thing for Checkout block.
+9. Open a new page, add Cart block, save the page and publish it.
+10. Select the block or one of its inner blocks, start the flow again.
+11. It should work, confirm that by visiting the frontend.
+
+
+
+### Register product search as a core/search variation when available. ([6191](https://github.com/woocommerce/woocommerce-blocks/pull/6191))
+
+1. Ensure the Gutenberg version is ≥ 13.4 and it is deactivated.
+2. With a block theme (2022 for example), add the Product Search block to the header.
+3. See the Product Search is the independent block (as it is in `trunk`), not a variation of the Search block. See the block is editable in the editor and working as expected on the front end.
+4. Activate Gutenberg.
+5. On the front end, see the block is still working as expected and is still a WC block (notice the classes, and search icon).
+6. Edit the header, see the Deprecation notice, and a call to action button to upgrade the search block to search variation.
+7. Click on the CTA button to see if the block is converted to WC variation of the core search block.
+8. Save and see the block functions flawlessly on the front end.
+9. Edit the header again, try adding the Product Search block, only variation is available in the inserter. The legacy can't be found and inserted from the inserter.
+
+
+
+### Fixed a bug with a class name deriving from a translatable string. ([6914](https://github.com/woocommerce/woocommerce-blocks/pull/6914))
+
+1. Add an item to your cart that has multiple variants. E.g. Hoodie (Blue, Logo)
+2. Go to the Cart Block
+3. Inspect the text for one of the variants (e.g. Colour: Blue)
+4. Make sure there is a class called `wc-block-components-product-details__item` on the `
` element. This should be a child of ``
+5. Change the language of your store
+6. Refresh the cart page
+7. Repeat steps 3 and 4. You should see the same result.
+
+
+
+---
+
+[We're hiring!](https://woocommerce.com/careers/) Come work with us!
+
+🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/internal-developers/testing/releases/840.md)
+
+
diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md
index 93bc3c3d19e..67a6666229e 100644
--- a/docs/internal-developers/testing/releases/README.md
+++ b/docs/internal-developers/testing/releases/README.md
@@ -87,6 +87,7 @@ Every release includes specific testing instructions for new features and bug fi
- [8.2.1](./821.md)
- [8.3.0](./830.md)
- [8.3.1](./831.md)
+- [8.4.0](./840.md)
diff --git a/readme.txt b/readme.txt
index 358aadd659d..de0a64363ce 100644
--- a/readme.txt
+++ b/readme.txt
@@ -86,6 +86,24 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
== Changelog ==
+= 8.4.0 - 2022-08-29 =
+
+#### Enhancements
+
+- Update the filter `Apply` buttons to match the new designs. ([6958](https://github.com/woocommerce/woocommerce-blocks/pull/6958))
+- Update the design of the Filter Products by Attribute block. ([6920](https://github.com/woocommerce/woocommerce-blocks/pull/6920))
+- Update the design of the Filter by Attribute block settings panel. ([6912](https://github.com/woocommerce/woocommerce-blocks/pull/6912))
+- Terms and conditions, and Privacy policy links open in a new tab by default. ([6908](https://github.com/woocommerce/woocommerce-blocks/pull/6908))
+- Layout updates to the Active Filters block. ([6905](https://github.com/woocommerce/woocommerce-blocks/pull/6905))
+- Update the design of the Filter Products by Stock block. ([6883](https://github.com/woocommerce/woocommerce-blocks/pull/6883))
+- Update the design of the Filter Products by Price block. ([6877](https://github.com/woocommerce/woocommerce-blocks/pull/6877))
+- Allow making the Cart/Checkout block page the default one from within the editor. ([6867](https://github.com/woocommerce/woocommerce-blocks/pull/6867))
+- Register product search as a core/search variation when available. ([6191](https://github.com/woocommerce/woocommerce-blocks/pull/6191))
+
+#### Bug Fixes
+
+- Fixed a bug with a class name deriving from a translatable string. ([6914](https://github.com/woocommerce/woocommerce-blocks/pull/6914))
+
= 8.3.1 - 2022-08-17 =
#### Bug Fixes
diff --git a/src/Package.php b/src/Package.php
index 21464a18753..e89b2c87e44 100644
--- a/src/Package.php
+++ b/src/Package.php
@@ -1,4 +1,5 @@
get( NewPackage::class );
+ protected static function get_package()
+ {
+ return self::container()->get(NewPackage::class);
}
/**
@@ -38,8 +41,9 @@ protected static function get_package() {
*
* @since 2.5.0 Handled by new NewPackage.
*/
- public static function init() {
- self::container()->get( Bootstrap::class );
+ public static function init()
+ {
+ self::container()->get(Bootstrap::class);
}
/**
@@ -47,7 +51,8 @@ public static function init() {
*
* @return string
*/
- public static function get_version() {
+ public static function get_version()
+ {
return self::get_package()->get_version();
}
@@ -56,7 +61,8 @@ public static function get_version() {
*
* @return string
*/
- public static function get_path() {
+ public static function get_path()
+ {
return self::get_package()->get_path();
}
@@ -65,7 +71,8 @@ public static function get_path() {
*
* @return FeatureGating
*/
- public static function feature() {
+ public static function feature()
+ {
return self::get_package()->feature();
}
@@ -74,7 +81,8 @@ public static function feature() {
*
* @return boolean
*/
- public static function is_experimental_build() {
+ public static function is_experimental_build()
+ {
return self::get_package()->is_experimental_build();
}
@@ -101,22 +109,23 @@ public static function is_experimental_build() {
* Note: this means all dependencies will be
* reconstructed.
*/
- public static function container( $reset = false ) {
+ public static function container($reset = false)
+ {
static $container;
if (
- ! $container instanceof Container
- || $reset
- ) {
+ !$container instanceof Container
+ || $reset
+ ) {
$container = new Container();
// register Package.
$container->register(
NewPackage::class,
- function ( $container ) {
+ function ($container) {
// leave for automated version bumping.
$version = '8.5.0-dev';
return new NewPackage(
$version,
- dirname( __DIR__ ),
+ dirname(__DIR__),
new FeatureGating()
);
}
@@ -124,7 +133,7 @@ function ( $container ) {
// register Bootstrap.
$container->register(
Bootstrap::class,
- function ( $container ) {
+ function ($container) {
return new Bootstrap(
$container
);
@@ -134,8 +143,7 @@ function ( $container ) {
$container->register(
Migration::class,
function () {
- return new Migration(
- );
+ return new Migration();
}
);
}
diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php
index bafab0dfa78..352058365da 100644
--- a/woocommerce-gutenberg-products-block.php
+++ b/woocommerce-gutenberg-products-block.php
@@ -1,4 +1,5 @@
id;
$is_woocommerce_page =
- property_exists( $current_screen, 'parent_base' ) &&
+ property_exists($current_screen, 'parent_base') &&
'woocommerce' === $current_screen->parent_base;
return $is_plugins_page || $is_woocommerce_page;
}
-if ( version_compare( $GLOBALS['wp_version'], $minimum_wp_version, '<' ) ) {
+if (version_compare($GLOBALS['wp_version'], $minimum_wp_version, '<')) {
/**
* Outputs for an admin notice about running WooCommerce Blocks on outdated WordPress.
*
* @since 2.5.0
*/
- function woocommerce_blocks_admin_unsupported_wp_notice() {
- if ( should_display_compatibility_notices() ) {
- ?>
+ function woocommerce_blocks_admin_unsupported_wp_notice()
+ {
+ if (should_display_compatibility_notices()) {
+?>
- ';
printf(
/* translators: %1$s is referring to a php constant name, %2$s is referring to the wp-config.php file. */
- esc_html__( 'WooCommerce Blocks development mode requires the %1$s constant to be defined and true in your %2$s file. Otherwise you are loading the blocks package from WooCommerce core.', 'woo-gutenberg-products-block' ),
+ esc_html__('WooCommerce Blocks development mode requires the %1$s constant to be defined and true in your %2$s file. Otherwise you are loading the blocks package from WooCommerce core.', 'woo-gutenberg-products-block'),
'JETPACK_AUTOLOAD_DEV',
'wp-config.php'
);
@@ -112,16 +116,16 @@ function() {
* If the autoloader is not present, let's log the failure and display a nice admin notice.
*/
$autoloader = __DIR__ . '/vendor/autoload_packages.php';
-if ( is_readable( $autoloader ) ) {
+if (is_readable($autoloader)) {
require $autoloader;
} else {
- if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ if (defined('WP_DEBUG') && WP_DEBUG) {
error_log( // phpcs:ignore
sprintf(
/* translators: 1: composer command. 2: plugin directory */
- esc_html__( 'Your installation of the WooCommerce Blocks feature plugin is incomplete. Please run %1$s within the %2$s directory.', 'woo-gutenberg-products-block' ),
+ esc_html__('Your installation of the WooCommerce Blocks feature plugin is incomplete. Please run %1$s within the %2$s directory.', 'woo-gutenberg-products-block'),
'`composer install`',
- '`' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '`'
+ '`' . esc_html(str_replace(ABSPATH, '', __DIR__)) . '`'
)
);
}
@@ -130,27 +134,27 @@ function() {
*/
add_action(
'admin_notices',
- function() {
- ?>
-
-
- composer install',
- '' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '
'
- );
- ?>
-
-
-
+
+
+ composer install',
+ '' . esc_html(str_replace(ABSPATH, '', __DIR__)) . '
'
+ );
+ ?>
+
+
+ registered[ $handle ], $wp_scripts->registered[ $handle ]->src ) ) {
+ if (!isset($wp_scripts->registered[$handle], $wp_scripts->registered[$handle]->src)) {
return $file;
}
- $handle_src = explode( '/build/', $wp_scripts->registered[ $handle ]->src );
+ $handle_src = explode('/build/', $wp_scripts->registered[$handle]->src);
$handle_filename = $handle_src[1];
$locale = determine_locale();
$lang_dir = WP_LANG_DIR . '/plugins';
// Translations are always based on the unminified filename.
- if ( substr( $handle_filename, -7 ) === '.min.js' ) {
- $handle_filename = substr( $handle_filename, 0, -7 ) . '.js';
+ if (substr($handle_filename, -7) === '.min.js') {
+ $handle_filename = substr($handle_filename, 0, -7) . '.js';
}
- $core_path_md5 = md5( 'packages/woocommerce-blocks/build/' . $handle_filename );
+ $core_path_md5 = md5('packages/woocommerce-blocks/build/' . $handle_filename);
/**
* Return file path of the corresponding translation file in the WC Core is
@@ -213,7 +218,7 @@ function load_woocommerce_core_json_translation( $file, $handle, $domain ) {
return $lang_dir . '/woocommerce-' . $locale . '-' . $core_path_md5 . '.json';
}
-add_filter( 'load_script_translation_file', 'load_woocommerce_core_json_translation', 10, 3 );
+add_filter('load_script_translation_file', 'load_woocommerce_core_json_translation', 10, 3);
/**
* Filter translations so we can retrieve translations from Core when the original and the translated
@@ -224,33 +229,35 @@ function load_woocommerce_core_json_translation( $file, $handle, $domain ) {
* @param string $domain The text domain.
* @return string WC Blocks translation. In case it's the same as $text, Core translation.
*/
-function woocommerce_blocks_get_php_translation_from_core( $translation, $text, $domain ) {
- if ( 'woo-gutenberg-products-block' !== $domain ) {
+function woocommerce_blocks_get_php_translation_from_core($translation, $text, $domain)
+{
+ if ('woo-gutenberg-products-block' !== $domain) {
return $translation;
}
// When translation is the same, that could mean the string is not translated.
// In that case, load it from core.
- if ( $translation === $text ) {
- return translate( $text, 'woocommerce' ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction, WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.TextDomainMismatch
+ if ($translation === $text) {
+ return translate($text, 'woocommerce'); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction, WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.TextDomainMismatch
}
return $translation;
}
-add_filter( 'gettext', 'woocommerce_blocks_get_php_translation_from_core', 10, 3 );
+add_filter('gettext', 'woocommerce_blocks_get_php_translation_from_core', 10, 3);
/**
* Add notice to the admin dashboard if the plugin is outdated.
*
* @see https://github.com/woocommerce/woocommerce-blocks/issues/5587
*/
-function woocommerce_blocks_plugin_outdated_notice() {
+function woocommerce_blocks_plugin_outdated_notice()
+{
$is_active =
- is_plugin_active( 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ||
- is_plugin_active( 'woocommerce-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ||
- is_plugin_active( 'woocommerce-blocks/woocommerce-gutenberg-products-block.php' );
+ is_plugin_active('woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php') ||
+ is_plugin_active('woocommerce-gutenberg-products-block/woocommerce-gutenberg-products-block.php') ||
+ is_plugin_active('woocommerce-blocks/woocommerce-gutenberg-products-block.php');
- if ( ! $is_active ) {
+ if (!$is_active) {
return;
}
@@ -261,17 +268,17 @@ function woocommerce_blocks_plugin_outdated_notice() {
* the current path is from the WC Core, we can consider the plugin is
* outdated because Jetpack Autoloader always loads the newer package.
*/
- if ( ! strpos( $woocommerce_blocks_path, 'packages/woocommerce-blocks' ) ) {
+ if (!strpos($woocommerce_blocks_path, 'packages/woocommerce-blocks')) {
return;
}
- if ( should_display_compatibility_notices() ) {
- ?>
+ if (should_display_compatibility_notices()) {
+ ?>
-