From d774dfb667e52c30d24282a1590b484a98b13481 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 4 Jul 2023 11:38:07 +0000 Subject: [PATCH 01/40] Empty commit for release pull request From 1b8f720b7a218f7da8bd7c0e047aca95bc7e9148 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 13:31:26 +0100 Subject: [PATCH 02/40] Add testing notes for 10.6.0 --- .../testing/releases/1060.md | 312 ++++++++++++++++++ 1 file changed, 312 insertions(+) create mode 100644 docs/internal-developers/testing/releases/1060.md diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md new file mode 100644 index 00000000000..790a78c857a --- /dev/null +++ b/docs/internal-developers/testing/releases/1060.md @@ -0,0 +1,312 @@ +# Testing notes and ZIP for release 10.6.0 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11801343/woocommerce-gutenberg-products-block.zip) + +## WooCommerce Core + +### Add Cart/Checkout/Order-Received Templates [#9301](https://github.com/woocommerce/woocommerce-blocks/pull/9301) + +1. On a new WooCommerce installation take note of the contents for Cart and Checkout pages +2. Enable a blocks theme eg. Twenty Twenty Three +3. Go to Appearance > Editor > Template Parts and verify the existence of Checkout Header template part +4. Verify that you can edit, save, and changes persist +5. Go to Appearance > Editor > Templates and verify the existence of Cart, Checkout and Order Confirmation templates +6. Verify for Cart and Checkout templates that the content matches the one noted in step 1. +7. Go to Appearance > Editor > Templates > Manage all templates and verify the Cart and Checkout show "Customized" +8. Edit said templates, save, and verify that changes persist. +9. Make a test purchase. Verify that the views for Cart, Checkout and Order Confirmation contain the new templates +10. Clear the "Customized" state for Checkout and make a new test order. Verify that no footer is present, and the header is the Checkout Header template part +11. Go to WooCommerce > Settings > Advanced and verify that for Cart and Checkout we have a freeform endpoint textbox, as opposed to the old page selection dropdown +12. Edit and save them, and verify that a new checkout flow displays Cart and Checkout on the newly chosen endpoints + +### Add/attributes filter count display toggle [#9833](https://github.com/woocommerce/woocommerce-blocks/pull/9833) + +1. Before checking out this branch add post/page and test the following blocks `Filter by Attributes`, `Filter by Stock` and `Filter by Rating` along with `Products (beta)` block. Just leave all default settings and publish post/page. +2. Now checkout this PR and load the post/page you created in step 1 and ensure there are no block validation errors in the console. +3. Add the 3 blocks again. Check that in each of the blocks, `Display product count` option is set to false/off. +4. Ensure you can toggle `Display product count` and it will hide/show the product counts in editor and frontend. + +### Banner pattern: improve spacing and centering in responsive designs [#9877](https://github.com/woocommerce/woocommerce-blocks/pull/9877) + +1. Create a new page or post. +2. Insert the `Banner` pattern and save. +3. Go to the front end and check the pattern looks like the screenshot above in all the different screen sizes. + +### Hero Split pattern: add shop link to the button [#9879](https://github.com/woocommerce/woocommerce-blocks/pull/9879) + +1. Create a new page or post. +2. Insert the `Hero Product - Split` pattern and save. +3. Go to the front end and check the `Shop now` button links to the shop. + +### Make use of product search [#9890](https://github.com/woocommerce/woocommerce-blocks/pull/9890) + +1. Add the following patterns to a post/page `WooCommerce Essential Header | Dark`, `WooCommerce Essential Header`, `WooCommerce Large Header | Dark` and `WooCommerce Large Header`. +2. Ensure you see a search bar that searches products. +3. Check this on the frontend as well. + +### Styling and improvements [#9893](https://github.com/woocommerce/woocommerce-blocks/pull/9893) + +1. Add `Hero Product 3 Split` pattern to a post/page. +2. Check that the `Shop Now` button has a specific background/text color. Test with different block themes like Tsubaki and TT3 and make sure the button is white and text is black. +3. Check in the front end and reduce the browser viewport to smallest possible and ensure the block of text in the area of the black background that there are margins all around so it is not bumping up to the edges. + +### `Featured Products 5-item grid` fix alignment [#9913](https://github.com/woocommerce/woocommerce-blocks/pull/9913) + +1. Create a new page or post. +2. Insert the `Featured Products 5-item grid` pattern. +3. Change the screen size to a smaller viewport and check the pattern looks like the `After` image above (there's no whitespace at the right of the image). + +### Shop by Price pattern: add price filters to buttons [#9915](https://github.com/woocommerce/woocommerce-blocks/pull/9915) + +1. Create a new page or post. +2. Insert the `Shop by price` pattern and save. +3. Go to the front end and check the pattern looks like the image below. +4. Check that the link inside each of the squares corresponds to its title (highest rated filters by rating, under $X filters by price, etc). +5. Check that the link under each of the squares is the same as the one in the title. + +Screenshot 2023-06-20 at 16 34 27 + +### Prevent saved payment methods showing if their main method `canPay` function returns `false` [#9917](https://github.com/woocommerce/woocommerce-blocks/pull/9917) + +1. Install the [Gocardless payment method](https://woocommerce.com/products/gocardless/) and set up a dev account there. +2. Using UK as your country, buy a product using GoCardless and opt to save the payment method. Check out. +3. Add another product to the cart and go to the Checkout block. +4. Enter a valid UK address and ensure the saved GoCardless method shows up as expected. +5. Change to an invalid address (Afghanistan for example) and ensure the saved GoCardless method is not visible. + +### Use the single product block on the Hero Product pattern [#9935](https://github.com/woocommerce/woocommerce-blocks/pull/9935) + +1. Create a new page or post. +2. Insert the `Hero product` pattern and save. +3. Check that the pattern is using the `Single Product` block and has a default product selected. +4. In the front end, check the pattern looks like the image above. + +### Add new `Discount banner with image` pattern [#9957](https://github.com/woocommerce/woocommerce-blocks/pull/9957) + +1. Create a new post or page. +2. Insert the `Discount banner with image` pattern and save. +3. In the front end, check the pattern looks like the image above and the `Shop now` button links to the shop page. + +### Add new `Product collection banner` pattern [#9953](https://github.com/woocommerce/woocommerce-blocks/pull/9953) + +1. Create a new post or page. +2. Insert the `Product collection banner` pattern and save. +3. In the front end, check the pattern looks like the image above and the `Shop now` button links to the shop page. + +### Add new `Small discount banner with image` pattern [#9947](https://github.com/woocommerce/woocommerce-blocks/pull/9947) + +1. Create a new post or page. +2. Insert the `Small discount banner with image` pattern and save. +3. In the front end, check the pattern looks like the image above and the links go to the shop page (the image is different because I used one of the images already included in the plugin). + +### Add new `Discount banner` pattern [#9936](https://github.com/woocommerce/woocommerce-blocks/pull/9936) + +1. Create a new post or page. +2. Insert the `Discount banner` pattern and save. +3. In the front end, check the pattern looks like the image above and the `Shop now` button links to the shop page. + +### Remove attributes data from save function for active filters [#10047](https://github.com/woocommerce/woocommerce-blocks/pull/10047) + +1. Before checking out this branch, add a new post and add the `Filter by Attributes` block and `Active Filters` block. Save/Update the post. +2. Checkout this branch and reload the post/page with developer tools opened. +3. Ensure there are no block validation errors. +4. Add the `Products (beta)` block (save/update) and ensure the `Active Filters` block functions are working as expected on the frontend by choosing different attributes. + +### Remove attributes data from save function for filter by price [#10039](https://github.com/woocommerce/woocommerce-blocks/pull/10039) + +1. Before checking out this branch, add a new post and add the `Filter by Price` block. Save/Update the post. +2. Checkout this branch and reload the post with developer tools opened. +3. Ensure there are no block validation errors. +4. Add the `Products (beta)` block (save/update) and ensure the `Filter by Price` functions are working as expected on the frontend. + +### Add size settings to the `Product Image` block [#10034](https://github.com/woocommerce/woocommerce-blocks/pull/10034) + +#### Product Image settings + +1. Create a new page or post. +2. Insert the `Single Product` block. +3. Click on the `Product Image` block and open the settings sidebar. +4. Check the `Image size` settings are shown in the sidebar. +5. Change the settings and check the changes are properly reflected on the editor and in the front end, after saving. + +#### Product Hero pattern + +1. Insert the `Product Hero` pattern. +2. Click the image and check the block used is the `Product Image`. +3. Save and check in the front end that the patterns renders fine. + +### Add to Cart with options block > Remove opinionated style for the price list in grouped products. [#9988](https://github.com/woocommerce/woocommerce-blocks/pull/9988) + +1. Make sure you have a block theme enabled, such as Twenty-twenty three. +2. Head over to Edit Site > Templates > Single Product +3. Make sure you have the blockyified version of this template up and running: if you don't, click on the "Transform into blocks" button and save. +4. Now on your site's FE, access any grouped product (such as Logo Collection) +5. Ensure the prices in the list are displayed with a smaller font size as demonstrated on the screenshot. + +### Fix notice banner links for Legacy notices [#9996](https://github.com/woocommerce/woocommerce-blocks/pull/9996) + +1. Install Back in Stock Notifications plugin. +2. Visit an out-of-stock product. +3. Click the “Notify me” button. +4. Confirm the notice banner link is displayed correctly. + +![image](https://github.com/woocommerce/woocommerce-blocks/assets/11503784/0f864388-d605-46cc-8749-041dca830eb3) + +### Per block stylesheets [#9831](https://github.com/woocommerce/woocommerce-blocks/pull/9831) + +Testing this PR means making sure there are no styling regressions in existing blocks. I did test all of them, but it's possible that I might have missed something. + +1. Create a post or page and add the All Products block. Verify styles are loaded correctly. +2. Visit the page in the frontend and verify styles are loaded correctly in the frontend as well. +3. Repeat steps 1 and 2 with all blocks listed on [this page](https://wordpress.org/plugins/woo-gutenberg-products-block/). Make sure to test each block individually. So, when possible, try with only one block on the page (in some cases, that's not possible, ie: filter blocks, in that case, try with as few blocks as possible on the page). The reason is that we want to make sure each block includes the style dependencies that it needs, so they need to be tested in isolation, otherwise styles from other blocks might leak into other blocks and "help fix issues". + +### Consistent Pattern Titles [#9814](https://github.com/woocommerce/woocommerce-blocks/pull/9814) + +1. Add a pattern to a page / post +2. Check naming of pattern + +### Product Gallery: Add an new block base code [#9937](https://github.com/woocommerce/woocommerce-blocks/pull/9937) + +1. Add a page +2. Search in the block inserter for the **Product Gallery** block. +3. Make sure it comes up correctly. + +### Remove the word ‘beta’ from the compatibility notice [#10019](https://github.com/woocommerce/woocommerce-blocks/pull/10019) + +1. Create a fresh site. +2. Create a test page and add the Cart block to it. +3. Select the Cart block and verify that the notice reads: + +> _"The Cart & Checkout Blocks are a feature to optimize for faster checkout. To make sure this feature is right for your store, [review the list of compatible extensions](https://woocommerce.com/document/cart-checkout-blocks-support-status/#section-3)."_ + +4. Create a test page and add the Checkout block to it. +5. Select the Checkout block and verify that the notice reads: + +> _"The Cart & Checkout Blocks are a feature to optimize for faster checkout. To make sure this feature is right for your store, [review the list of compatible extensions](https://woocommerce.com/document/cart-checkout-blocks-support-status/#section-3)."_ + +--- + +> **Note** +> When testing this on an existing testing site: +> +> - Make sure that there's no incompatible payment gateway is installed, as the incompatible payment gateway notice prevents the compatibility notice from appearing. +> - Make sure that there's no key called `wc-blocks_dismissed_sidebar_compatibility_notices` stored in local storage, as this also prevents the compatibility notice from appearing. + +### Hide "collection from" text when a location has an incomplete address. [#9808](https://github.com/woocommerce/woocommerce-blocks/pull/9808) + +1. Go to WooCommerce > Settings > Shipping > Local Pickup. Create 2 pickup locations—one should have a full address/pickup location, and one should have no address like so: + +![Screenshot 2023-06-13 at 12 48 21](https://github.com/woocommerce/woocommerce-blocks/assets/90977/2dcd6ed7-08ec-4351-8f30-1d6b887eec9d) + +2. Add items to your cart and go to checkout. +3. Select Local Pickup +4. Select the pickup location with an address. it should show "collection from" like so: + +![Screenshot 2023-06-13 at 12 50 13](https://github.com/woocommerce/woocommerce-blocks/assets/90977/8bd1fd97-ae82-40f8-a4cb-11b5a705488c) + +5. Select the pickup location with no address. It should not show the collection from section: + +![Screenshot 2023-06-13 at 12 50 19](https://github.com/woocommerce/woocommerce-blocks/assets/90977/80dda09b-e99a-4d00-81fb-b3916dddeb9a) + +6. Place the order and check the confirmation displays correctly without an address also: + +![Screenshot 2023-06-13 at 12 56 19](https://github.com/woocommerce/woocommerce-blocks/assets/90977/7aacfa0d-0ff7-408f-854e-01bfa59da502) + +### Cleanup code to lazy-load wc-settings in the Mini-Cart block [#10042](https://github.com/woocommerce/woocommerce-blocks/pull/10042) + +This PR doesn't add any new feature, so testing mostly refers to smoke testing that there are no regressions. + +1. Add the Mini Cart block to the header of your store. +2. In the frontend, verify you can open it, interact with its inner blocks (ie: change the quantity of a product, remove a product, etc.). + +### Prevent prefetched Cart payload causing wrong values with cached Mini-Cart block [#10029](https://github.com/woocommerce/woocommerce-blocks/pull/10029) + +**With your admin user:** + +1. Install _[WP-Optimize - Clean, Compress, Cache](https://wordpress.org/plugins/wp-optimize/)_ or a similar caching plugin. +2. Go to WP-Optimize > Settings > Cache and enable page caching. + +**In a private/incognito window without being logged in:** + +3. In the frontend visit any page. This will cache the page without products in the cart. + +**With your admin user:** + +4. Add some products to your cart. +5. Visit the same page from step 3. +6. Notice the Mini Cart totals do include the products you added in step 4, even though it's serving the cached version of step 3. +7. Hover the Mini-Cart button and verify the totals are still correct. + +Before | After +--- | --- +[before.webm](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/a7bed8d6-13d4-4b8a-b775-eea8feab9d32) | [after.webm](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/c3b75b3b-60fb-4683-be6a-3bc9d108dd42) + +8. Add another product to your cart. +9. Verify Mini-Cart totals updated correctly. +10. Navigate to any other page. +11. Verify Mini-Cart values are always correct and at no moment they render incorrect data. + +### Make filter by rating preview consistent with default settings [#10007](https://github.com/woocommerce/woocommerce-blocks/pull/10007) + +1. Ensure you don't have any product reviews on your store. +2. Add a new post and add the `Filter by Rating` block. +3. Because you don't have any reviews, it will show a preview of what the ratings filter would look like. +4. Ensure you don't see any product counts because by default, the `Display Product count` setting is disabled. + +### Mini Cart: Add Price, Icon and Product Count color settings [#9647](https://github.com/woocommerce/woocommerce-blocks/pull/9647) + +1. Add the Mini Cart block. +2. Select the "Styles" tab +3. Set custom colors for the Icon, Price, and Product count. +4. Make sure the changes are visible in the editor and the page. + +### Avoid usage of __experimentalUseFocusOutside [#10017](https://github.com/woocommerce/woocommerce-blocks/pull/10017) + +1. Add the Mini Cart block to the header of your site via (Appearance > Editor). +2. In the frontend and with the Cart empty, open the Mini Cart drawer, verify you can open and close the drawer without problems. Test closing the drawer by clicking on the overlay that appears above the rest of the page. +3. Add some products to your cart and open the Mini Cart drawer again. Verify you can open and close it, you can change the products' quantity, etc. +4. Now repeat steps 1-3 with another browser. Ideally test Chrome, Firefox and a Webkit-based browser (like Safari or GNOME Web). + +### Single Product Template: fix compatibility layer logic when the blocks aren't wrapped in a group block [#9982](https://github.com/woocommerce/woocommerce-blocks/pull/9982) + +1. Edit the Single Product Template. +2. Remove all the blocks. +3. Add three paragraph blocks. +4. Save it. +5. Visit a product. +6. Ensure that all three paragraph blocks are visible. + +### Product Image: use WC Core function to render image [#9984](https://github.com/woocommerce/woocommerce-blocks/pull/9984) + +1. Add a Products (Beta) block to a page. +2. Save and check the page on the front end. +3. See `` elements have `loading`, `srcset`, `size` attributes. + +### Single Product Block > Ensure the Product Summary and Title are always rendered with the correct context independent of their position [#9968](https://github.com/woocommerce/woocommerce-blocks/pull/9968) + +0. Make sure you have the Gutenberg plugin disabled +1. Create a new post +2. Add the Single Product block and move the Product Summary block to the last position, as demonstrated in the screenshot below: + +Screenshot 2023-06-22 at 18 37 47 + +4. Save the post and ensure the content is displayed as expected on the front end and matches the product summary (from the Single Product block) rather than the post's excerpt where it was inserted. +5. Now move the Product Title to the last position in the editor and save the post. +6. Ensure the title is displayed as expected on the front end it and matches the product title (from the Single Product block) rather than the title of the post where it was inserted. + +### Allow customer account block to center align [#9750](https://github.com/woocommerce/woocommerce-blocks/pull/9750) + +1. Add a post/page and insert the `Customer account` block. +2. With the toolbar, change the width alignment to `center`. Update/Publish. +3. Ensure you see the icon and text centered on the page. +4. Go to the frontend and check that it is also centered on the page. + +### Remove unnecessary white space from Testimonials 3 Columns pattern [#9786](https://github.com/woocommerce/woocommerce-blocks/pull/9786) + +1. Create a post or page. +2. Add the _Testimonials 3 Columns_ pattern. +3. Verify there is no white space at the beginning of each paragraph. + +Before | After +--- | --- +![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/d212291d-6aaf-4642-847d-62a336cbc922) | ![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/509f25b6-788a-46b2-95e2-2dc74b92d59b) From e7844219862a621b7ac29877ab0e02b5c018821b Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 14:04:51 +0100 Subject: [PATCH 03/40] Include correct testing zip --- docs/internal-developers/testing/releases/1060.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 790a78c857a..d99ed07b1df 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -1,6 +1,8 @@ # Testing notes and ZIP for release 10.6.0 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11801343/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11949549/woocommerce-gutenberg-products-block.zip) + +) ## WooCommerce Core From 542572220be40ef431107df2918b7eecdf2a2e49 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 15:20:30 +0100 Subject: [PATCH 04/40] Fix rogue parenthesis --- docs/internal-developers/testing/releases/1060.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index d99ed07b1df..79acbe44191 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -2,8 +2,6 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11949549/woocommerce-gutenberg-products-block.zip) -) - ## WooCommerce Core ### Add Cart/Checkout/Order-Received Templates [#9301](https://github.com/woocommerce/woocommerce-blocks/pull/9301) From d6972c760ed29b1e389ea34d1f00b22d332f9774 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 16:15:14 +0100 Subject: [PATCH 05/40] Include screenshot for 9877 --- docs/internal-developers/testing/releases/1060.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 79acbe44191..9373a22ed06 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -30,7 +30,10 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. 1. Create a new page or post. 2. Insert the `Banner` pattern and save. -3. Go to the front end and check the pattern looks like the screenshot above in all the different screen sizes. +3. Go to the front end and check the pattern looks like the screenshots below in all the different screen sizes. + +Screenshot 2023-06-19 at 12 23 41 +Screenshot 2023-06-19 at 12 23 49 ### Hero Split pattern: add shop link to the button [#9879](https://github.com/woocommerce/woocommerce-blocks/pull/9879) From 185acef38a104a7d08c4bffd915a36f5a91c79be Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 17:42:12 +0100 Subject: [PATCH 06/40] Update 9893 title to be more descriptive --- docs/internal-developers/testing/releases/1060.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 9373a22ed06..ecad986e2ab 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -47,7 +47,7 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. 2. Ensure you see a search bar that searches products. 3. Check this on the frontend as well. -### Styling and improvements [#9893](https://github.com/woocommerce/woocommerce-blocks/pull/9893) +### Update Hero Product 3 Split pattern with opinionated button styling and margin adjustments [#9893](https://github.com/woocommerce/woocommerce-blocks/pull/9893) 1. Add `Hero Product 3 Split` pattern to a post/page. 2. Check that the `Shop Now` button has a specific background/text color. Test with different block themes like Tsubaki and TT3 and make sure the button is white and text is black. From f658a20e395eb42becc86fc9c9f2a0c1d65cb39f Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 17:42:23 +0100 Subject: [PATCH 07/40] Add image to 9913 description --- docs/internal-developers/testing/releases/1060.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index ecad986e2ab..23deb4e1bf0 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -57,7 +57,9 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. 1. Create a new page or post. 2. Insert the `Featured Products 5-item grid` pattern. -3. Change the screen size to a smaller viewport and check the pattern looks like the `After` image above (there's no whitespace at the right of the image). +3. Change the screen size to a smaller viewport and check the pattern looks like the image below (there's no whitespace at the right of the image). + + ### Shop by Price pattern: add price filters to buttons [#9915](https://github.com/woocommerce/woocommerce-blocks/pull/9915) From 964df9bd3feba01c961855626d26931a8fd52f77 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 17:46:28 +0100 Subject: [PATCH 08/40] Remove 9917 test - not easily testable by GlobalStep --- docs/internal-developers/testing/releases/1060.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 23deb4e1bf0..9eb57a4a17b 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -71,14 +71,6 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. Screenshot 2023-06-20 at 16 34 27 -### Prevent saved payment methods showing if their main method `canPay` function returns `false` [#9917](https://github.com/woocommerce/woocommerce-blocks/pull/9917) - -1. Install the [Gocardless payment method](https://woocommerce.com/products/gocardless/) and set up a dev account there. -2. Using UK as your country, buy a product using GoCardless and opt to save the payment method. Check out. -3. Add another product to the cart and go to the Checkout block. -4. Enter a valid UK address and ensure the saved GoCardless method shows up as expected. -5. Change to an invalid address (Afghanistan for example) and ensure the saved GoCardless method is not visible. - ### Use the single product block on the Hero Product pattern [#9935](https://github.com/woocommerce/woocommerce-blocks/pull/9935) 1. Create a new page or post. From 5fa526262c6d048dbaadc0de94873140ca0dd20d Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 17:54:52 +0100 Subject: [PATCH 09/40] Add changelog to readme --- readme.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/readme.txt b/readme.txt index 0c6e54d4e2e..66e74e9569c 100644 --- a/readme.txt +++ b/readme.txt @@ -81,6 +81,46 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 10.6.0 - 2023-07-05 = + +#### Enhancements + +- Remove attributes data from saving in HTML for Active Filters block. ([10047](https://github.com/woocommerce/woocommerce-blocks/pull/10047)) +- Remove attributes data from saving in HTML for Filter by Price block. ([10039](https://github.com/woocommerce/woocommerce-blocks/pull/10039)) +- Product Image block: Add size settings to change the width, height, and scale. ([10034](https://github.com/woocommerce/woocommerce-blocks/pull/10034)) +- Remove the word ‘beta’ from the compatibility notice. ([10019](https://github.com/woocommerce/woocommerce-blocks/pull/10019)) +- Add new `Discount banner with image` pattern. ([9957](https://github.com/woocommerce/woocommerce-blocks/pull/9957)) +- Add new `Product collection banner` pattern. ([9953](https://github.com/woocommerce/woocommerce-blocks/pull/9953)) +- Add `Small discount banner with image` pattern. ([9947](https://github.com/woocommerce/woocommerce-blocks/pull/9947)) +- Add the new `Banner discount` pattern. ([9936](https://github.com/woocommerce/woocommerce-blocks/pull/9936)) +- Start using the Single Product block for the Hero Product pattern. ([9935](https://github.com/woocommerce/woocommerce-blocks/pull/9935)) +- Shop by price pattern: Update titles and links to filter by price and rating. ([9915](https://github.com/woocommerce/woocommerce-blocks/pull/9915)) +- Update `Hero Product 3 Split` pattern with opinionated button styling and margin adjustments. ([9893](https://github.com/woocommerce/woocommerce-blocks/pull/9893)) +- Update header patterns to use the product search block instead of the WP core search block. ([9890](https://github.com/woocommerce/woocommerce-blocks/pull/9890)) +- Hero Product – Split pattern: Add link to the shop page to the button. ([9879](https://github.com/woocommerce/woocommerce-blocks/pull/9879)) +- Banner pattern: Update colors and improve spacing and centering in small screens. ([9877](https://github.com/woocommerce/woocommerce-blocks/pull/9877)) +- Update `Display product count` option to default to `false` in Filter by Attributes, Filter by Stock and Filter by Rating blocks. ([9833](https://github.com/woocommerce/woocommerce-blocks/pull/9833)) +- Only load styles required by the blocks rendered on the page. ([9831](https://github.com/woocommerce/woocommerce-blocks/pull/9831)) +- Product Rating: Removes unnecessary Product Rating markup in case there are no real or mocked ratings present. ([9822](https://github.com/woocommerce/woocommerce-blocks/pull/9822)) +- Consistent Pattern Titles. ([9814](https://github.com/woocommerce/woocommerce-blocks/pull/9814)) +- Mini Cart: Add color settings for the Price, Icon, and Product Count. ([9647](https://github.com/woocommerce/woocommerce-blocks/pull/9647)) +- Added new Cart, Checkout, Order Confirmation templates and Checkout Header template part to the Site Editor. ([9301](https://github.com/woocommerce/woocommerce-blocks/pull/9301)) + +#### Bug Fixes + +- Prevent prefetched Cart payload causing wrong values with cached Mini-Cart block. ([10029](https://github.com/woocommerce/woocommerce-blocks/pull/10029)) +- Make filter by rating preview consistent with default settings. ([10007](https://github.com/woocommerce/woocommerce-blocks/pull/10007)) +- Fix notice banner links for Legacy notices. ([9996](https://github.com/woocommerce/woocommerce-blocks/pull/9996)) +- Add to Cart with Options block > Remove opinionated styles for the price list on grouped products. ([9988](https://github.com/woocommerce/woocommerce-blocks/pull/9988)) +- Add loading and responsive image attribute to image element of Product Image block. ([9984](https://github.com/woocommerce/woocommerce-blocks/pull/9984)) +- Single Product Template Compatibility Layer: Fix some blocks that don't show on the frontend side in a specific case. ([9982](https://github.com/woocommerce/woocommerce-blocks/pull/9982)) +- Fix: Single Product Block - Ensure the Product Summary and Title blocks are always rendered with the correct context independent of their position in the editor. ([9968](https://github.com/woocommerce/woocommerce-blocks/pull/9968)) +- Ensure saved payment methods do not show if the payment gateway they belong to cannot be used to make payments for the current cart configuration. ([9917](https://github.com/woocommerce/woocommerce-blocks/pull/9917)) +- Featured Products 5-item grid: Fix extra whitespace in small viewports. ([9913](https://github.com/woocommerce/woocommerce-blocks/pull/9913)) +- Local Pickup - Only show collection address when set. ([9808](https://github.com/woocommerce/woocommerce-blocks/pull/9808)) +- Remove unnecessary white space from Testimonials 3 Columns pattern. ([9786](https://github.com/woocommerce/woocommerce-blocks/pull/9786)) +- Fix customer account block not able to center align. ([9750](https://github.com/woocommerce/woocommerce-blocks/pull/9750)) + = 10.5.0 - 2023-06-19 = #### Enhancements From 1c669c756f8c89be82c6ae6d2f21a642da4ec059 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 17:55:54 +0100 Subject: [PATCH 10/40] Update version numbers --- composer.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 2 +- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index f5029eaea34..5003da8af52 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "WooCommerce blocks for the Gutenberg editor.", "homepage": "https://woocommerce.com/", "type": "wordpress-plugin", - "version": "10.6.0-dev", + "version": "10.6.0", "keywords": [ "gutenberg", "woocommerce", diff --git a/package-lock.json b/package-lock.json index ed05c82f1cf..543a3cfc2d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@woocommerce/block-library", - "version": "10.6.0-dev", + "version": "10.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@woocommerce/block-library", - "version": "10.6.0-dev", + "version": "10.6.0", "hasInstallScript": true, "license": "GPL-3.0+", "dependencies": { diff --git a/package.json b/package.json index 50a8dd3c2f1..ef664e8c480 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "10.6.0-dev", + "version": "10.6.0", "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 66e74e9569c..4634a03d077 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 6.2 Tested up to: 6.2 Requires PHP: 7.3 -Stable tag: 10.5.0 +Stable tag: 10.6.0 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/Package.php b/src/Package.php index cf0f1ad13e4..42a2dbe5a67 100644 --- a/src/Package.php +++ b/src/Package.php @@ -109,7 +109,7 @@ public static function container( $reset = false ) { NewPackage::class, function ( $container ) { // leave for automated version bumping. - $version = '10.6.0-dev'; + $version = '10.6.0'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index 0638184fd4b..b4441ccd3c2 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: 10.6.0-dev + * Version: 10.6.0 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block From 987e956b78a5698d91352d86a887f2091bb02d2f Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 17:58:09 +0100 Subject: [PATCH 11/40] Update WC tested and WC Requires fields --- woocommerce-gutenberg-products-block.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index b4441ccd3c2..148df4c703b 100644 --- a/woocommerce-gutenberg-products-block.php +++ b/woocommerce-gutenberg-products-block.php @@ -9,8 +9,8 @@ * Text Domain: woo-gutenberg-products-block * Requires at least: 6.2 * Requires PHP: 7.3 - * WC requires at least: 7.5 - * WC tested up to: 7.6 + * WC requires at least: 7.7 + * WC tested up to: 7.8 * * @package WooCommerce\Blocks * @internal This file is only used when running as a feature plugin. From 4d25463c165477015f9863bdef10f968918f38b2 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 18:19:18 +0100 Subject: [PATCH 12/40] Add image to 9935 --- docs/internal-developers/testing/releases/1060.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 9eb57a4a17b..62f0d641b68 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -76,7 +76,9 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. 1. Create a new page or post. 2. Insert the `Hero product` pattern and save. 3. Check that the pattern is using the `Single Product` block and has a default product selected. -4. In the front end, check the pattern looks like the image above. +4. In the front end, check the pattern looks like the image below. + +Screenshot 2023-06-21 at 14 17 30 ### Add new `Discount banner with image` pattern [#9957](https://github.com/woocommerce/woocommerce-blocks/pull/9957) From d761f161e6ebcf104253c7a1d4c236425f8c2c4f Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 18:20:32 +0100 Subject: [PATCH 13/40] Update zip link --- docs/internal-developers/testing/releases/1060.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 62f0d641b68..95a401604d8 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -1,6 +1,6 @@ # Testing notes and ZIP for release 10.6.0 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11949549/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11951416/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From 50cb8d0ffab984900a00939992312531c1cc5140 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 18:21:38 +0100 Subject: [PATCH 14/40] Add image for 9957 --- docs/internal-developers/testing/releases/1060.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 95a401604d8..dfcc4c35531 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -84,7 +84,9 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. 1. Create a new post or page. 2. Insert the `Discount banner with image` pattern and save. -3. In the front end, check the pattern looks like the image above and the `Shop now` button links to the shop page. +3. In the front end, check the pattern looks like the image below and the `Shop now` button links to the shop page. + + ### Add new `Product collection banner` pattern [#9953](https://github.com/woocommerce/woocommerce-blocks/pull/9953) From df661932a173f55f5a72f8f3fe5b69ddd965f1b7 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 18:23:46 +0100 Subject: [PATCH 15/40] Add images to 9947, 9936, and 9953 --- docs/internal-developers/testing/releases/1060.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index dfcc4c35531..cf94d19a243 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -92,19 +92,25 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. 1. Create a new post or page. 2. Insert the `Product collection banner` pattern and save. -3. In the front end, check the pattern looks like the image above and the `Shop now` button links to the shop page. +3. In the front end, check the pattern looks like the image below and the `Shop now` button links to the shop page. + + ### Add new `Small discount banner with image` pattern [#9947](https://github.com/woocommerce/woocommerce-blocks/pull/9947) 1. Create a new post or page. 2. Insert the `Small discount banner with image` pattern and save. -3. In the front end, check the pattern looks like the image above and the links go to the shop page (the image is different because I used one of the images already included in the plugin). +3. In the front end, check the pattern looks like the image below and the links go to the shop page (the image is different because I used one of the images already included in the plugin). + +Screenshot 2023-06-22 at 09 32 04 ### Add new `Discount banner` pattern [#9936](https://github.com/woocommerce/woocommerce-blocks/pull/9936) 1. Create a new post or page. 2. Insert the `Discount banner` pattern and save. -3. In the front end, check the pattern looks like the image above and the `Shop now` button links to the shop page. +3. In the front end, check the pattern looks like the image below and the `Shop now` button links to the shop page. + +Screenshot 2023-06-21 at 15 31 03 ### Remove attributes data from save function for active filters [#10047](https://github.com/woocommerce/woocommerce-blocks/pull/10047) From 535c346a079906868b87ab6a64aae69cf9455ac6 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 18:35:00 +0100 Subject: [PATCH 16/40] Add image for 9988 --- docs/internal-developers/testing/releases/1060.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index cf94d19a243..dc91edb1f31 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -150,6 +150,10 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. 4. Now on your site's FE, access any grouped product (such as Logo Collection) 5. Ensure the prices in the list are displayed with a smaller font size as demonstrated on the screenshot. +| Before | After | +| ------ | ----- | +| Screenshot 2023-06-26 at 12 33 18 | Screenshot 2023-06-26 at 12 32 15 | + ### Fix notice banner links for Legacy notices [#9996](https://github.com/woocommerce/woocommerce-blocks/pull/9996) 1. Install Back in Stock Notifications plugin. From 64bce39ef24e4790cc839de391adc85dc44ece76 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 4 Jul 2023 18:48:36 +0100 Subject: [PATCH 17/40] Remove 9937 (experimental) --- docs/internal-developers/testing/releases/1060.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index dc91edb1f31..0078d3e09b3 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -176,12 +176,6 @@ Testing this PR means making sure there are no styling regressions in existing b 1. Add a pattern to a page / post 2. Check naming of pattern -### Product Gallery: Add an new block base code [#9937](https://github.com/woocommerce/woocommerce-blocks/pull/9937) - -1. Add a page -2. Search in the block inserter for the **Product Gallery** block. -3. Make sure it comes up correctly. - ### Remove the word ‘beta’ from the compatibility notice [#10019](https://github.com/woocommerce/woocommerce-blocks/pull/10019) 1. Create a fresh site. From 84b738e67fe51c02b2864cd3632e7c844ea92260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alba=20Rinc=C3=B3n?= Date: Wed, 5 Jul 2023 10:30:20 +0200 Subject: [PATCH 18/40] Fix image over content (#10092) --- assets/js/atomic/blocks/product-elements/image/style.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/js/atomic/blocks/product-elements/image/style.scss b/assets/js/atomic/blocks/product-elements/image/style.scss index 7c08d449ee6..386227b1338 100644 --- a/assets/js/atomic/blocks/product-elements/image/style.scss +++ b/assets/js/atomic/blocks/product-elements/image/style.scss @@ -2,7 +2,6 @@ .wc-block-components-product-image { text-decoration: none; display: block; - position: relative; a { border-radius: inherit; From 10a27d62158e3770467e29b49512063d130ac1cf Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Wed, 5 Jul 2023 11:39:27 +0100 Subject: [PATCH 19/40] Add notes for #10092 --- docs/internal-developers/testing/releases/1060.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 0078d3e09b3..f839ec80d7c 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -315,3 +315,12 @@ Before | After Before | After --- | --- ![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/d212291d-6aaf-4642-847d-62a336cbc922) | ![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/509f25b6-788a-46b2-95e2-2dc74b92d59b) + + +### Fix `Product Image` inconsistent style between Editor and front end [#10092](https://github.com/woocommerce/woocommerce-blocks/pull/10092) + +1. Create a new page or post. +2. Insert a Single Product block. +3. Select the Product Image block and set the width to a value wider than its column. +4. Notice the image is shown under the right column blocks in the Editor. +5. Save and go to the front end and notice the image is shown also under the right column blocks. From 603deabb84ceb37fed6dd09f053b6ad8bdf32dde Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 5 Jul 2023 12:02:27 +0100 Subject: [PATCH 20/40] Fix cart and checkout conditionals when using a block based theme and templates (#10098) * Update conditionals to deal with templates instead of cart/checkout page objects * Include notice style in main entrypoint --- assets/js/index.js | 1 + src/Domain/Services/Notices.php | 11 ++--------- src/Utils/CartCheckoutUtils.php | 30 ++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index 5fdfbdcc91c..3324889f387 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -14,6 +14,7 @@ import '../css/editor.scss'; import '../css/style.scss'; import './filters/block-list-block'; import './filters/get-block-attributes'; +import './base/components/notice-banner/style.scss'; setCategories( [ ...getCategories().filter( diff --git a/src/Domain/Services/Notices.php b/src/Domain/Services/Notices.php index 990681489b0..12090af3cf1 100644 --- a/src/Domain/Services/Notices.php +++ b/src/Domain/Services/Notices.php @@ -2,6 +2,7 @@ namespace Automattic\WooCommerce\Blocks\Domain\Services; use Automattic\WooCommerce\Blocks\Domain\Package; +use Automattic\WooCommerce\Blocks\Utils\CartCheckoutUtils; /** * Service class for adding new-style Notices to WooCommerce core. @@ -41,15 +42,7 @@ public function __construct( Package $package ) { * is using the new block based cart/checkout. */ public function init() { - // Core page IDs. - $cart_page_id = wc_get_page_id( 'cart' ); - $checkout_page_id = wc_get_page_id( 'checkout' ); - - // Checks a specific page (by ID) to see if it contains the named block. - $has_block_cart = $cart_page_id && has_block( 'woocommerce/cart', $cart_page_id ); - $has_block_checkout = $checkout_page_id && has_block( 'woocommerce/checkout', $checkout_page_id ); - - if ( $has_block_cart || $has_block_checkout ) { + if ( CartCheckoutUtils::is_cart_block_default() || CartCheckoutUtils::is_checkout_block_default() ) { add_filter( 'woocommerce_kses_notice_allowed_tags', [ $this, 'add_kses_notice_allowed_tags' ] ); add_filter( 'wc_get_template', [ $this, 'get_notices_template' ], 10, 5 ); add_action( diff --git a/src/Utils/CartCheckoutUtils.php b/src/Utils/CartCheckoutUtils.php index 24f59c46f2d..e1d74d2c65e 100644 --- a/src/Utils/CartCheckoutUtils.php +++ b/src/Utils/CartCheckoutUtils.php @@ -12,6 +12,21 @@ class CartCheckoutUtils { * @return bool true if the WC cart page is using the Cart block. */ public static function is_cart_block_default() { + if ( wc_current_theme_is_fse_theme() ) { + // Ignore the pages and check the templates. + $templates_from_db = BlockTemplateUtils::get_block_templates_from_db( array( 'cart' ), 'wp_template' ); + + // If there is no template file, we're using default which does use the block. + if ( empty( $templates_from_db ) ) { + return true; + } + + foreach ( $templates_from_db as $template ) { + if ( has_block( 'woocommerce/cart', $template->content ) ) { + return true; + } + } + } $cart_page_id = wc_get_page_id( 'cart' ); return $cart_page_id && has_block( 'woocommerce/cart', $cart_page_id ); } @@ -22,6 +37,21 @@ public static function is_cart_block_default() { * @return bool true if the WC checkout page is using the Checkout block. */ public static function is_checkout_block_default() { + if ( wc_current_theme_is_fse_theme() ) { + // Ignore the pages and check the templates. + $templates_from_db = BlockTemplateUtils::get_block_templates_from_db( array( 'checkout' ), 'wp_template' ); + + // If there is no template file, we're using default which does use the block. + if ( empty( $templates_from_db ) ) { + return true; + } + + foreach ( $templates_from_db as $template ) { + if ( has_block( 'woocommerce/checkout', $template->content ) ) { + return true; + } + } + } $checkout_page_id = wc_get_page_id( 'checkout' ); return $checkout_page_id && has_block( 'woocommerce/checkout', $checkout_page_id ); } From eccf8b1b35be1f5177bf6958e0a8c0a3ce006500 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Wed, 5 Jul 2023 12:09:44 +0100 Subject: [PATCH 21/40] Add testing instructions for 10098 --- docs/internal-developers/testing/releases/1060.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index f839ec80d7c..771ac62b3b4 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -324,3 +324,13 @@ Before | After 3. Select the Product Image block and set the width to a value wider than its column. 4. Notice the image is shown under the right column blocks in the Editor. 5. Save and go to the front end and notice the image is shown also under the right column blocks. + +### Fix cart and checkout conditionals when using a block based theme and templates [#10098](https://github.com/woocommerce/woocommerce-blocks/pull/10098) + +1. Active a non-blocks theme e.g. 2019 +2. Go to Settings > Advanced and set the cart and checkout pages to pages that **do not contain blocks.** For example, set them to pages using the cart and checkout shortcodes +3. Save settings. Then switch to a block based theme, e.g. TT3 +4. Go to the store and view a product page. +5. Add to cart. Check that the notice styling is using the new design: + +![Screenshot 2023-07-05 at 11 37 57](https://github.com/woocommerce/woocommerce-blocks/assets/90977/c8fb8bc5-abd6-43e2-8e3c-1748497aa0f7) From ff9098b423fc42ce73ac5d0b5fdb8596642b2e21 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Wed, 5 Jul 2023 12:10:24 +0100 Subject: [PATCH 22/40] Add changelog entry for #10092 --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 4634a03d077..d9d9b1b8b74 100644 --- a/readme.txt +++ b/readme.txt @@ -120,6 +120,7 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ - Local Pickup - Only show collection address when set. ([9808](https://github.com/woocommerce/woocommerce-blocks/pull/9808)) - Remove unnecessary white space from Testimonials 3 Columns pattern. ([9786](https://github.com/woocommerce/woocommerce-blocks/pull/9786)) - Fix customer account block not able to center align. ([9750](https://github.com/woocommerce/woocommerce-blocks/pull/9750)) +- "Product Image": fix inconsistent style between Editor and front end. = 10.5.0 - 2023-06-19 = From d89343f45a230fbd63382e3a6c557aeec5b2975b Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Wed, 5 Jul 2023 12:23:46 +0100 Subject: [PATCH 23/40] Update zip to include patches --- docs/internal-developers/testing/releases/1060.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 771ac62b3b4..b21b406af6e 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -1,6 +1,6 @@ # Testing notes and ZIP for release 10.6.0 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11951416/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11957256/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From d3a352cc81df384eece7542911d5c5b2e602b3d2 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Wed, 5 Jul 2023 12:59:33 +0100 Subject: [PATCH 24/40] Update testing notes for 9814 --- .../testing/releases/1060.md | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index b21b406af6e..b6fd65cad72 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -173,8 +173,42 @@ Testing this PR means making sure there are no styling regressions in existing b ### Consistent Pattern Titles [#9814](https://github.com/woocommerce/woocommerce-blocks/pull/9814) -1. Add a pattern to a page / post -2. Check naming of pattern +1. Log in to your WordPress dashboard. +2. Create a new post / page. +3. Click on the "+" button in the top left corner of the editor to add a new pattern. Search and add the following patterns to the editor: + - Featured Products 5-Item Grid + - Product Filters + - Large Footer Dark + - Large Footer + - Simple Footer Dark + - Simple Footer + - Footer with 2 Menus Dark + - Footer with 2 Menus + - Footer with 3 Menus + - Centered Header Menu with Search + - Essential Header Dark + - Essential Header + - Large Header Dark + - Large Header + - Hero Product Split + - Just Arrived Full Hero + - Product Collections Featured Collection + - Product Collections Featured Collections + - Product Collections Newest Arrivals + - Product Details Product Listing + - Product Hero 2 Column 2 Row + - 1:1 Image 4-Column Product Row + - 3-Column Product Row + - 4-Column Product Row + - Large Image Product Gallery + - Minimal 5-Column Product Row + - Minimal Product List + - Product Gallery + - Product List with 1:1 Images + - Product List with Full Product Description + - Alternating Image and Text +4. On the top-left side, click to open the List View +5. Make sure the blocks are named correctly (as in the list above) and the word "WooCommerce" does not appear in front of the blocks title. ### Remove the word ‘beta’ from the compatibility notice [#10019](https://github.com/woocommerce/woocommerce-blocks/pull/10019) From ede650534aaed42b657942edaefdb0c5b18d7e0d Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Wed, 5 Jul 2023 13:00:51 +0100 Subject: [PATCH 25/40] Update notes for 10047 and 10039 --- .../testing/releases/1060.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index b6fd65cad72..5b6d944a4a5 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -114,17 +114,19 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. ### Remove attributes data from save function for active filters [#10047](https://github.com/woocommerce/woocommerce-blocks/pull/10047) -1. Before checking out this branch, add a new post and add the `Filter by Attributes` block and `Active Filters` block. Save/Update the post. -2. Checkout this branch and reload the post/page with developer tools opened. -3. Ensure there are no block validation errors. -4. Add the `Products (beta)` block (save/update) and ensure the `Active Filters` block functions are working as expected on the frontend by choosing different attributes. +1. Log in to your WordPress dashboard. +2. Create a new post / page. +3. Click on the "+" button in the top left corner of the editor to add a new block. Search and add the following blocks to the editor: `Products (beta)`, `Active Filters` and some filter block like the `Filter by attributes`. +4. On the top-right side, click on the Save button. +5. Visit the post/page that you just created and check that Active Filters block is working correctly when choosing different options from the Filter by Attributes block ### Remove attributes data from save function for filter by price [#10039](https://github.com/woocommerce/woocommerce-blocks/pull/10039) -1. Before checking out this branch, add a new post and add the `Filter by Price` block. Save/Update the post. -2. Checkout this branch and reload the post with developer tools opened. -3. Ensure there are no block validation errors. -4. Add the `Products (beta)` block (save/update) and ensure the `Filter by Price` functions are working as expected on the frontend. +1. Log in to your WordPress dashboard. +2. Create a new post / page. +3. Click on the "+" button in the top left corner of the editor to add a new block. Search and add the following blocks to the editor: `Products (beta)` and `Filter by Price`. +4. On the top-right side, click on the Save button. +5. Visit the post/page that you just created and check that filter by price is working correctly and changes made to it is reflected on the Products (beta) block. ### Add size settings to the `Product Image` block [#10034](https://github.com/woocommerce/woocommerce-blocks/pull/10034) From 4f17857a9047dbbe378eaa85f1cde170dd316126 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Wed, 5 Jul 2023 08:51:02 +0200 Subject: [PATCH 26/40] Fix filter count display toggle (#10096) * fix save method * improve check * Only display counts if showCounts is true --------- Co-authored-by: Alexandre Lara --- assets/js/blocks/attribute-filter/index.tsx | 7 +------ assets/js/blocks/attribute-filter/utils.ts | 2 +- assets/js/blocks/rating-filter/index.tsx | 7 +------ assets/js/blocks/rating-filter/utils.ts | 2 +- assets/js/blocks/stock-filter/index.tsx | 7 +------ assets/js/blocks/stock-filter/utils.ts | 2 +- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/assets/js/blocks/attribute-filter/index.tsx b/assets/js/blocks/attribute-filter/index.tsx index e66cdeb069d..f1e63575ff0 100644 --- a/assets/js/blocks/attribute-filter/index.tsx +++ b/assets/js/blocks/attribute-filter/index.tsx @@ -49,12 +49,7 @@ registerBlockType( metadata, { { ...useBlockProps.save( { className: classNames( 'is-loading', className ), } ) } - > - - + /> ); }, deprecated, diff --git a/assets/js/blocks/attribute-filter/utils.ts b/assets/js/blocks/attribute-filter/utils.ts index 2463243742e..f76609a4f58 100644 --- a/assets/js/blocks/attribute-filter/utils.ts +++ b/assets/js/blocks/attribute-filter/utils.ts @@ -127,7 +127,7 @@ export const parseAttributes = ( data: Record< string, unknown > ) => { isString( data?.attributeId ) ? data.attributeId : '0', 10 ), - showCounts: data?.showCounts !== 'false', + showCounts: data?.showCounts === 'true', queryType: ( isString( data?.queryType ) && data.queryType ) || metadata.attributes.queryType.default, diff --git a/assets/js/blocks/rating-filter/index.tsx b/assets/js/blocks/rating-filter/index.tsx index 21c053dd5ef..35319dea5ef 100644 --- a/assets/js/blocks/rating-filter/index.tsx +++ b/assets/js/blocks/rating-filter/index.tsx @@ -36,12 +36,7 @@ registerBlockType( metadata, { { ...useBlockProps.save( { className: classNames( 'is-loading', className ), } ) } - > - - + /> ); }, deprecated, diff --git a/assets/js/blocks/rating-filter/utils.ts b/assets/js/blocks/rating-filter/utils.ts index 5b5209993f7..a6ba5a02ba6 100644 --- a/assets/js/blocks/rating-filter/utils.ts +++ b/assets/js/blocks/rating-filter/utils.ts @@ -38,7 +38,7 @@ export const formatSlug = ( slug: string ) => export const parseAttributes = ( data: Record< string, unknown > ) => { return { showFilterButton: data?.showFilterButton === 'true', - showCounts: data?.showCounts !== 'false', + showCounts: data?.showCounts === 'true', isPreview: false, displayStyle: ( isString( data?.displayStyle ) && data.displayStyle ) || diff --git a/assets/js/blocks/stock-filter/index.tsx b/assets/js/blocks/stock-filter/index.tsx index e887e7cdb58..3c610e511e5 100644 --- a/assets/js/blocks/stock-filter/index.tsx +++ b/assets/js/blocks/stock-filter/index.tsx @@ -38,12 +38,7 @@ registerBlockType( metadata, { { ...useBlockProps.save( { className: classNames( 'is-loading', className ), } ) } - > - - + /> ); }, deprecated, diff --git a/assets/js/blocks/stock-filter/utils.ts b/assets/js/blocks/stock-filter/utils.ts index d692e459316..3addadffd3c 100644 --- a/assets/js/blocks/stock-filter/utils.ts +++ b/assets/js/blocks/stock-filter/utils.ts @@ -48,7 +48,7 @@ export const parseAttributes = ( data: Record< string, unknown > ) => { parseInt( data.headingLevel, 10 ) ) || metadata.attributes.headingLevel.default, showFilterButton: data?.showFilterButton === 'true', - showCounts: data?.showCounts !== 'false', + showCounts: data?.showCounts === 'true', isPreview: false, displayStyle: ( isString( data?.displayStyle ) && data.displayStyle ) || From fae164d6a0679efd8077f8483cf159bec9c39f1c Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Wed, 5 Jul 2023 16:18:40 +0100 Subject: [PATCH 27/40] Update zip to include patches --- docs/internal-developers/testing/releases/1060.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 5b6d944a4a5..b09d38befef 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -1,6 +1,6 @@ # Testing notes and ZIP for release 10.6.0 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11957256/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11959507/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From e02ddb2f41f3fe3bbea6fb25ad83ecf4e06c6bfb Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 6 Jul 2023 09:56:53 +0100 Subject: [PATCH 28/40] Update readme and bump date --- readme.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index d9d9b1b8b74..6b91dbb6321 100644 --- a/readme.txt +++ b/readme.txt @@ -81,7 +81,7 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == -= 10.6.0 - 2023-07-05 = += 10.6.0 - 2023-07-06 = #### Enhancements @@ -120,7 +120,7 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ - Local Pickup - Only show collection address when set. ([9808](https://github.com/woocommerce/woocommerce-blocks/pull/9808)) - Remove unnecessary white space from Testimonials 3 Columns pattern. ([9786](https://github.com/woocommerce/woocommerce-blocks/pull/9786)) - Fix customer account block not able to center align. ([9750](https://github.com/woocommerce/woocommerce-blocks/pull/9750)) -- "Product Image": fix inconsistent style between Editor and front end. +- "Product Image": fix inconsistent style between Editor and front end. ([10092](https://github.com/woocommerce/woocommerce-blocks/pull/10092)) = 10.5.0 - 2023-06-19 = From e6c0e84fed7ff5cece8c894836d01d78f8afb210 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 6 Jul 2023 10:10:26 +0100 Subject: [PATCH 29/40] Add 1060 to readme --- docs/internal-developers/testing/releases/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index 2a1eac71f56..bccdc5828f8 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -157,6 +157,7 @@ Every release includes specific testing instructions for new features and bug fi - [10.4.4](./1044.md) - [10.4.5](./1045.md) - [10.5.0](./1050.md) +- [10.6.0](./1060.md) From d58958157ac524947f5aa541a8058b43ed4475ef Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 6 Jul 2023 10:30:12 +0100 Subject: [PATCH 30/40] Remove 9831 from testing notes and changelog --- docs/internal-developers/testing/releases/1060.md | 8 -------- readme.txt | 1 - 2 files changed, 9 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index b09d38befef..90f76e08b0f 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -165,14 +165,6 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. ![image](https://github.com/woocommerce/woocommerce-blocks/assets/11503784/0f864388-d605-46cc-8749-041dca830eb3) -### Per block stylesheets [#9831](https://github.com/woocommerce/woocommerce-blocks/pull/9831) - -Testing this PR means making sure there are no styling regressions in existing blocks. I did test all of them, but it's possible that I might have missed something. - -1. Create a post or page and add the All Products block. Verify styles are loaded correctly. -2. Visit the page in the frontend and verify styles are loaded correctly in the frontend as well. -3. Repeat steps 1 and 2 with all blocks listed on [this page](https://wordpress.org/plugins/woo-gutenberg-products-block/). Make sure to test each block individually. So, when possible, try with only one block on the page (in some cases, that's not possible, ie: filter blocks, in that case, try with as few blocks as possible on the page). The reason is that we want to make sure each block includes the style dependencies that it needs, so they need to be tested in isolation, otherwise styles from other blocks might leak into other blocks and "help fix issues". - ### Consistent Pattern Titles [#9814](https://github.com/woocommerce/woocommerce-blocks/pull/9814) 1. Log in to your WordPress dashboard. diff --git a/readme.txt b/readme.txt index 6b91dbb6321..eb5a9692c78 100644 --- a/readme.txt +++ b/readme.txt @@ -100,7 +100,6 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ - Hero Product – Split pattern: Add link to the shop page to the button. ([9879](https://github.com/woocommerce/woocommerce-blocks/pull/9879)) - Banner pattern: Update colors and improve spacing and centering in small screens. ([9877](https://github.com/woocommerce/woocommerce-blocks/pull/9877)) - Update `Display product count` option to default to `false` in Filter by Attributes, Filter by Stock and Filter by Rating blocks. ([9833](https://github.com/woocommerce/woocommerce-blocks/pull/9833)) -- Only load styles required by the blocks rendered on the page. ([9831](https://github.com/woocommerce/woocommerce-blocks/pull/9831)) - Product Rating: Removes unnecessary Product Rating markup in case there are no real or mocked ratings present. ([9822](https://github.com/woocommerce/woocommerce-blocks/pull/9822)) - Consistent Pattern Titles. ([9814](https://github.com/woocommerce/woocommerce-blocks/pull/9814)) - Mini Cart: Add color settings for the Price, Icon, and Product Count. ([9647](https://github.com/woocommerce/woocommerce-blocks/pull/9647)) From 6046a1247cc9698bc700ddc979b75d3465f6b35c Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 6 Jul 2023 11:00:15 +0100 Subject: [PATCH 31/40] Update testing zip --- docs/internal-developers/testing/releases/1060.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 90f76e08b0f..25ce51416b8 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -1,6 +1,7 @@ # Testing notes and ZIP for release 10.6.0 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11959507/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11966970/woocommerce-gutenberg-products-block.zip) + ## WooCommerce Core From 002637456a13010853e501ba1559f413ee7e7ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alba=20Rinc=C3=B3n?= Date: Wed, 5 Jul 2023 10:30:20 +0200 Subject: [PATCH 32/40] Revert "Fix image over content (#10092)" This reverts commit 84b738e67fe51c02b2864cd3632e7c844ea92260. --- assets/js/atomic/blocks/product-elements/image/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/atomic/blocks/product-elements/image/style.scss b/assets/js/atomic/blocks/product-elements/image/style.scss index 386227b1338..7c08d449ee6 100644 --- a/assets/js/atomic/blocks/product-elements/image/style.scss +++ b/assets/js/atomic/blocks/product-elements/image/style.scss @@ -2,6 +2,7 @@ .wc-block-components-product-image { text-decoration: none; display: block; + position: relative; a { border-radius: inherit; From 61ed689d42fc403c1c43c410c92f8d63b70ab4b3 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 6 Jul 2023 15:02:41 +0100 Subject: [PATCH 33/40] Update testing notes and readme to remove 10092 (reverted) --- docs/internal-developers/testing/releases/1060.md | 9 --------- readme.txt | 1 - 2 files changed, 10 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 25ce51416b8..ae6b3fc4981 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -345,15 +345,6 @@ Before | After --- | --- ![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/d212291d-6aaf-4642-847d-62a336cbc922) | ![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/509f25b6-788a-46b2-95e2-2dc74b92d59b) - -### Fix `Product Image` inconsistent style between Editor and front end [#10092](https://github.com/woocommerce/woocommerce-blocks/pull/10092) - -1. Create a new page or post. -2. Insert a Single Product block. -3. Select the Product Image block and set the width to a value wider than its column. -4. Notice the image is shown under the right column blocks in the Editor. -5. Save and go to the front end and notice the image is shown also under the right column blocks. - ### Fix cart and checkout conditionals when using a block based theme and templates [#10098](https://github.com/woocommerce/woocommerce-blocks/pull/10098) 1. Active a non-blocks theme e.g. 2019 diff --git a/readme.txt b/readme.txt index eb5a9692c78..fe376ab15f6 100644 --- a/readme.txt +++ b/readme.txt @@ -119,7 +119,6 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ - Local Pickup - Only show collection address when set. ([9808](https://github.com/woocommerce/woocommerce-blocks/pull/9808)) - Remove unnecessary white space from Testimonials 3 Columns pattern. ([9786](https://github.com/woocommerce/woocommerce-blocks/pull/9786)) - Fix customer account block not able to center align. ([9750](https://github.com/woocommerce/woocommerce-blocks/pull/9750)) -- "Product Image": fix inconsistent style between Editor and front end. ([10092](https://github.com/woocommerce/woocommerce-blocks/pull/10092)) = 10.5.0 - 2023-06-19 = From 7637cc0ed773ba32cc9cdc2786c6f8945a0354b5 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 6 Jul 2023 15:07:13 +0100 Subject: [PATCH 34/40] Update testing zip --- docs/internal-developers/testing/releases/1060.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index ae6b3fc4981..7c014db85d5 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -1,7 +1,6 @@ # Testing notes and ZIP for release 10.6.0 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11966970/woocommerce-gutenberg-products-block.zip) - +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11968999/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From db05e7fafac24ec455f347e864e4d0c3732d43ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Thu, 6 Jul 2023 16:39:19 +0200 Subject: [PATCH 35/40] Fix Filter blocks e2e tests (#10116) * Revert "fix save method" This reverts commit f6623c55320bf55ee7fa3c23eb294f06d79ee4a5. * Revert "Revert "fix save method"" This reverts commit 739db2e3b0b62e10fbe1ebabd1ec6bbae8425b3c. * Update Filter by Attribute and Filter by Stock e2e test fixtures * Update Filter by Attribute 'can hide product count' test --- .../__fixtures__/filter-products-by-attribute.fixture.json | 2 +- .../__fixtures__/filter-products-by-stock.fixture.json | 2 +- tests/e2e/specs/backend/attribute-filter.test.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/specs/backend/__fixtures__/filter-products-by-attribute.fixture.json b/tests/e2e/specs/backend/__fixtures__/filter-products-by-attribute.fixture.json index 8a80d46777b..71a4d05070c 100644 --- a/tests/e2e/specs/backend/__fixtures__/filter-products-by-attribute.fixture.json +++ b/tests/e2e/specs/backend/__fixtures__/filter-products-by-attribute.fixture.json @@ -1 +1 @@ -{"title":"Filter by Attribute Block","pageContent":"

Filter by Capacity

\n
\n"} +{"title":"Filter by Attribute Block","pageContent":"

Filter by Capacity

\n
\n"} diff --git a/tests/e2e/specs/backend/__fixtures__/filter-products-by-stock.fixture.json b/tests/e2e/specs/backend/__fixtures__/filter-products-by-stock.fixture.json index bbdab9df40a..81676996ffc 100644 --- a/tests/e2e/specs/backend/__fixtures__/filter-products-by-stock.fixture.json +++ b/tests/e2e/specs/backend/__fixtures__/filter-products-by-stock.fixture.json @@ -1 +1 @@ -{"title":"Filter Products by Stock Block","pageContent":"

Filter by stock status

"} +{"title":"Filter Products by Stock Block","pageContent":"

Filter by stock status

"} diff --git a/tests/e2e/specs/backend/attribute-filter.test.js b/tests/e2e/specs/backend/attribute-filter.test.js index 5b42cb1f7a0..a8650caf7cc 100644 --- a/tests/e2e/specs/backend/attribute-filter.test.js +++ b/tests/e2e/specs/backend/attribute-filter.test.js @@ -87,13 +87,13 @@ describe( `${ block.name } Block`, () => { } ); it( 'can hide product count', async () => { - await expect( page ).toMatchElement( + await expect( page ).not.toMatchElement( '.wc-filter-element-label-list-count' ); await expect( page ).toClick( 'label', { text: 'Display product count', } ); - await expect( page ).not.toMatchElement( + await expect( page ).toMatchElement( '.wc-filter-element-label-list-count' ); // reset From 4bcaaa18ed5290ffeef8cd6c2079a9a2abefb85a Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 6 Jul 2023 16:02:20 +0100 Subject: [PATCH 36/40] Update testing zip --- docs/internal-developers/testing/releases/1060.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 7c014db85d5..6aab215d0f8 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -1,6 +1,6 @@ # Testing notes and ZIP for release 10.6.0 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11968999/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11969551/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From 8bc9835b2a6eab6bad210b96ab87c474018c63df Mon Sep 17 00:00:00 2001 From: Thomas Roberts <5656702+opr@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:13:59 +0100 Subject: [PATCH 37/40] Revert "Merge branch 'trunk' into release/10.6.0" This reverts commit 058ae2e3384fe87670be0ad9e615edb125799650. --- assets/css/style.scss | 1 + .../blocks/product-elements/image/style.scss | 1 + .../blocks/product-elements/price/block.tsx | 1 + .../blocks/product-elements/price/style.scss | 11 ++ .../product-details/block.tsx | 4 + .../product-details/index.tsx | 1 - .../product-reviews/block.tsx | 4 + .../product-reviews/index.tsx | 1 - .../blocks/product-elements/rating/style.scss | 108 ++++++++++++++++- .../base/components/country-input/style.scss | 4 - .../components/form-token-field/vendor.scss | 1 - .../base/components/notice-banner/style.scss | 4 +- .../base/components/product-price/style.scss | 12 -- .../base/components/product-rating/index.tsx | 1 - .../base/components/product-rating/style.scss | 114 ------------------ assets/js/blocks/breadcrumbs/index.tsx | 1 - .../payment-methods/payment-methods.js | 1 - .../cart-cross-sells-products/index.tsx | 1 - .../inner-blocks/cart-totals-block/edit.tsx | 1 + .../inner-blocks/cart-totals-block/index.tsx | 1 - .../inner-blocks/empty-cart-block/edit.tsx | 1 + .../inner-blocks/empty-cart-block/index.tsx | 1 - .../proceed-to-checkout-block/block.tsx | 1 + .../proceed-to-checkout-block/index.tsx | 1 - .../proceed-to-checkout-block/style.scss | 1 + assets/js/blocks/catalog-sorting/index.tsx | 1 - .../checkout-actions-block/block.tsx | 2 +- .../checkout-actions-block/index.tsx | 1 - .../checkout-fields-block/frontend.tsx | 5 + .../checkout-fields-block/index.tsx | 1 - .../checkout-order-note-block/index.tsx | 1 - .../checkout-payment-block/block.tsx | 4 + .../checkout-pickup-options-block/block.tsx | 1 + .../checkout-pickup-options-block/index.tsx | 1 - .../checkout-shipping-method-block/block.tsx | 1 + .../checkout-shipping-method-block/index.tsx | 1 - .../checkout-shipping-methods-block/block.tsx | 5 + .../checkout-shipping-methods-block/index.tsx | 1 - .../checkout-terms-block/frontend.tsx | 1 + .../checkout-terms-block/index.tsx | 2 - .../checkout-totals-block/frontend.tsx | 5 + .../checkout-totals-block/index.tsx | 1 - .../js/blocks/checkout/order-notes/index.tsx | 5 + .../style.scss | 2 +- assets/js/blocks/customer-account/index.tsx | 1 - .../inspector-controls/index.tsx | 2 - assets/js/blocks/product-gallery/index.tsx | 4 +- .../product-gallery-large-image/block.json | 13 -- .../product-gallery-large-image/edit.tsx | 34 ------ .../product-gallery-large-image/icon.tsx | 18 --- .../product-gallery-large-image/index.tsx | 22 ---- .../product-gallery-large-image/style.scss | 23 ---- .../js/blocks/product-results-count/index.tsx | 1 - assets/js/blocks/product-tag/index.tsx | 2 +- assets/js/blocks/product-template/index.tsx | 1 - .../feedback-prompt/index.tsx | 11 -- .../search-list-control.tsx | 1 - bin/webpack-configs.js | 61 +++++++--- bin/webpack-entries.js | 35 +++--- .../components/checkbox-control/style.scss | 2 +- src/Assets/Api.php | 17 +-- src/AssetsController.php | 4 +- src/BlockTypes/AbstractBlock.php | 7 +- src/BlockTypes/AbstractInnerBlock.php | 8 -- src/BlockTypes/AbstractProductGrid.php | 10 -- src/BlockTypes/AddToCartForm.php | 9 -- src/BlockTypes/AttributeFilter.php | 9 -- src/BlockTypes/Cart.php | 9 -- src/BlockTypes/Checkout.php | 9 -- src/BlockTypes/ClassicTemplate.php | 8 -- src/BlockTypes/FilterWrapper.php | 9 -- src/BlockTypes/MiniCart.php | 9 -- src/BlockTypes/MiniCartContents.php | 9 -- src/BlockTypes/ProceedToCheckoutBlock.php | 1 + src/BlockTypes/ProductCollection.php | 9 -- src/BlockTypes/ProductGallery.php | 9 -- src/BlockTypes/ProductGalleryLargeImage.php | 80 ------------ src/BlockTypes/ProductPrice.php | 9 -- src/BlockTypes/ProductRating.php | 9 -- src/BlockTypes/RatingFilter.php | 9 -- src/BlockTypes/RelatedProducts.php | 11 +- src/BlockTypes/StockFilter.php | 9 -- src/BlockTypes/StoreNotices.php | 9 -- src/BlockTypesController.php | 1 - .../products.block_theme.side_effects.spec.ts | 11 +- .../__fixtures__/active-filters.fixture.json | 2 +- .../filter-products-by-price.fixture.json | 2 +- woocommerce-gutenberg-products-block.php | 1 + 88 files changed, 249 insertions(+), 590 deletions(-) create mode 100644 assets/js/atomic/blocks/product-elements/price/style.scss delete mode 100644 assets/js/base/components/product-rating/style.scss rename assets/js/blocks/checkout/{inner-blocks/checkout-order-note-block => order-notes}/style.scss (79%) delete mode 100644 assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/block.json delete mode 100644 assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/edit.tsx delete mode 100644 assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/icon.tsx delete mode 100644 assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/index.tsx delete mode 100644 assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/style.scss delete mode 100644 src/BlockTypes/ProductGalleryLargeImage.php diff --git a/assets/css/style.scss b/assets/css/style.scss index 756c24984ec..68c0cd14e91 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -337,6 +337,7 @@ @include visually-hidden-focus-reveal(); } + .wp-block-group.woocommerce.product .up-sells.upsells.products { max-width: var(--wp--style--global--wide-size); } diff --git a/assets/js/atomic/blocks/product-elements/image/style.scss b/assets/js/atomic/blocks/product-elements/image/style.scss index 386227b1338..7c08d449ee6 100644 --- a/assets/js/atomic/blocks/product-elements/image/style.scss +++ b/assets/js/atomic/blocks/product-elements/image/style.scss @@ -2,6 +2,7 @@ .wc-block-components-product-image { text-decoration: none; display: block; + position: relative; a { border-radius: inherit; diff --git a/assets/js/atomic/blocks/product-elements/price/block.tsx b/assets/js/atomic/blocks/product-elements/price/block.tsx index 3f66056631b..8561b00c3d6 100644 --- a/assets/js/atomic/blocks/product-elements/price/block.tsx +++ b/assets/js/atomic/blocks/product-elements/price/block.tsx @@ -17,6 +17,7 @@ import type { HTMLAttributes } from 'react'; * Internal dependencies */ import type { BlockAttributes } from './types'; +import './style.scss'; type Props = BlockAttributes & HTMLAttributes< HTMLDivElement >; diff --git a/assets/js/atomic/blocks/product-elements/price/style.scss b/assets/js/atomic/blocks/product-elements/price/style.scss new file mode 100644 index 00000000000..5ff42437d25 --- /dev/null +++ b/assets/js/atomic/blocks/product-elements/price/style.scss @@ -0,0 +1,11 @@ +.wc-block-components-product-price { + display: block; + + .wc-block-all-products & { + margin-bottom: $gap-small; + } + + ins { + text-decoration: none; + } +} diff --git a/assets/js/atomic/blocks/product-elements/product-details/block.tsx b/assets/js/atomic/blocks/product-elements/product-details/block.tsx index 2d2f95bfd03..74c46267b3a 100644 --- a/assets/js/atomic/blocks/product-elements/product-details/block.tsx +++ b/assets/js/atomic/blocks/product-elements/product-details/block.tsx @@ -5,6 +5,10 @@ import classnames from 'classnames'; import { __ } from '@wordpress/i18n'; import { useBlockProps } from '@wordpress/block-editor'; +/** + * Internal dependencies + */ + interface SingleProductTab { id: string; title: string; diff --git a/assets/js/atomic/blocks/product-elements/product-details/index.tsx b/assets/js/atomic/blocks/product-elements/product-details/index.tsx index 4a71b9963ae..0c3e05a1747 100644 --- a/assets/js/atomic/blocks/product-elements/product-details/index.tsx +++ b/assets/js/atomic/blocks/product-elements/product-details/index.tsx @@ -10,7 +10,6 @@ import { productDetails } from '@woocommerce/icons'; */ import metadata from './block.json'; import edit from './edit'; -import './style.scss'; registerBlockSingleProductTemplate( { blockName: metadata.name, diff --git a/assets/js/atomic/blocks/product-elements/product-reviews/block.tsx b/assets/js/atomic/blocks/product-elements/product-reviews/block.tsx index da8d08aee9a..965cd18f8a0 100644 --- a/assets/js/atomic/blocks/product-elements/product-reviews/block.tsx +++ b/assets/js/atomic/blocks/product-elements/product-reviews/block.tsx @@ -9,6 +9,10 @@ import { __ } from '@wordpress/i18n'; import { useBlockProps } from '@wordpress/block-editor'; import { Notice } from '@wordpress/components'; +/** + * Internal dependencies + */ + export const ProductReviews = () => { const blockProps = useBlockProps(); diff --git a/assets/js/atomic/blocks/product-elements/product-reviews/index.tsx b/assets/js/atomic/blocks/product-elements/product-reviews/index.tsx index 3dd9446baee..20cbbe7ecd1 100644 --- a/assets/js/atomic/blocks/product-elements/product-reviews/index.tsx +++ b/assets/js/atomic/blocks/product-elements/product-reviews/index.tsx @@ -8,7 +8,6 @@ import { registerBlockSingleProductTemplate } from '@woocommerce/atomic-utils'; */ import metadata from './block.json'; import edit from './edit'; -import './style.scss'; registerBlockSingleProductTemplate( { blockName: metadata.name, diff --git a/assets/js/atomic/blocks/product-elements/rating/style.scss b/assets/js/atomic/blocks/product-elements/rating/style.scss index 37ad3a77033..40b6adfdfbe 100644 --- a/assets/js/atomic/blocks/product-elements/rating/style.scss +++ b/assets/js/atomic/blocks/product-elements/rating/style.scss @@ -1,12 +1,110 @@ .wc-block-components-product-rating { - .wc-block-components-product-rating__container { - > * { - vertical-align: middle; + display: block; + line-height: 1; + + &__stars { + display: inline-block; + overflow: hidden; + position: relative; + width: 5.3em; + height: 1.618em; + line-height: 1.618; + font-size: 1em; + /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */ + font-family: star; + font-weight: 400; + + &.wc-block-grid__product-rating__stars { + margin: 0; + } + + &::before { + content: "\53\53\53\53\53"; + top: 0; + left: 0; + right: 0; + position: absolute; + opacity: 0.5; + color: inherit; + white-space: nowrap; } + span { + overflow: hidden; + top: 0; + left: 0; + right: 0; + position: absolute; + color: inherit; + padding-top: 1.5em; + } + span::before { + content: "\53\53\53\53\53"; + top: 0; + left: 0; + right: 0; + position: absolute; + color: inherit; + white-space: nowrap; + } + } + + .wc-block-all-products & { + margin-top: 0; + margin-bottom: $gap-small; + } + + &__container { + display: flex; + align-items: center; + column-gap: $gap-smaller; } - .wc-block-components-product-rating__stars { + &__norating-container { + display: inline-flex; + flex-direction: row; + align-items: center; + gap: $gap-smaller; + } + + &__norating { display: inline-block; - margin: 0; + overflow: hidden; + position: relative; + width: 1.5em; + height: 1.618em; + line-height: 1.618; + font-size: 1em; + /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */ + font-family: star; + font-weight: 400; + -webkit-text-stroke: 2px var(--wp--preset--color--black, #000); + &::before { + content: "\53"; + top: 0; + left: 0; + right: 0; + position: absolute; + color: transparent; + white-space: nowrap; + text-align: center; + } + } +} + +.wc-block-all-products, +.wp-block-query { + .is-loading { + .wc-block-components-product-rating { + @include placeholder(); + width: 7em; + } + } + + .wc-block-components-product-rating__container { + display: block; + } + + .wc-block-components-product-rating__stars.wc-block-grid__product-rating__stars { + margin: inherit; } } diff --git a/assets/js/base/components/country-input/style.scss b/assets/js/base/components/country-input/style.scss index 003c302203e..576951e4ba6 100644 --- a/assets/js/base/components/country-input/style.scss +++ b/assets/js/base/components/country-input/style.scss @@ -1,7 +1,3 @@ -@import "node_modules/@wordpress/base-styles/breakpoints"; -@import "node_modules/@wordpress/base-styles/mixins"; -@import "node_modules/wordpress-components/src/combobox-control/style"; - .wc-block-components-country-input { margin-top: em($gap-large); } diff --git a/assets/js/base/components/form-token-field/vendor.scss b/assets/js/base/components/form-token-field/vendor.scss index 273d47af58c..1da6718e9c3 100644 --- a/assets/js/base/components/form-token-field/vendor.scss +++ b/assets/js/base/components/form-token-field/vendor.scss @@ -8,6 +8,5 @@ @import "node_modules/@wordpress/base-styles/mixins"; @import "node_modules/wordpress-components/src/popover/style"; @import "node_modules/wordpress-components/src/tooltip/style"; - @import "node_modules/wordpress-components/src/form-token-field/style"; /* stylelint-enable no-invalid-position-at-import-rule */ } diff --git a/assets/js/base/components/notice-banner/style.scss b/assets/js/base/components/notice-banner/style.scss index b3a9bc9f5de..395de052cb4 100644 --- a/assets/js/base/components/notice-banner/style.scss +++ b/assets/js/base/components/notice-banner/style.scss @@ -43,7 +43,7 @@ } // Legacy notice compatibility. - .wc-forward { + .wc-forward.wp-element-button { float: right; color: $gray-800 !important; background: transparent; @@ -52,8 +52,6 @@ border: 0; appearance: none; opacity: 0.6; - text-decoration-line: underline; - text-underline-position: under; &:hover, &:focus, diff --git a/assets/js/base/components/product-price/style.scss b/assets/js/base/components/product-price/style.scss index 8e72d6413e8..e3b7db30178 100644 --- a/assets/js/base/components/product-price/style.scss +++ b/assets/js/base/components/product-price/style.scss @@ -13,18 +13,6 @@ } /*rtl:end:ignore*/ -.wc-block-components-product-price { - display: block; - - .wc-block-all-products .wc-block-components-product-price { - margin-bottom: $gap-small; - } - - ins { - text-decoration: none; - } -} - .wc-block-components-product-price__value { &.is-discounted { margin-left: 0.5em; diff --git a/assets/js/base/components/product-rating/index.tsx b/assets/js/base/components/product-rating/index.tsx index 5b9bd6a91e1..bc391b3fe70 100644 --- a/assets/js/base/components/product-rating/index.tsx +++ b/assets/js/base/components/product-rating/index.tsx @@ -7,7 +7,6 @@ import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ -import './style.scss'; const Rating = ( { className, diff --git a/assets/js/base/components/product-rating/style.scss b/assets/js/base/components/product-rating/style.scss deleted file mode 100644 index f373d67c12e..00000000000 --- a/assets/js/base/components/product-rating/style.scss +++ /dev/null @@ -1,114 +0,0 @@ -.wc-block-components-product-rating { - display: block; - line-height: 1; - - &__stars { - display: inline-block; - overflow: hidden; - position: relative; - width: 5.3em; - height: 1.618em; - line-height: 1.618; - font-size: 1em; - /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */ - font-family: star; - font-weight: 400; - - &.wc-block-grid__product-rating__stars { - margin: 0; - } - - &::before { - content: "\53\53\53\53\53"; - top: 0; - left: 0; - right: 0; - position: absolute; - opacity: 0.5; - color: inherit; - white-space: nowrap; - } - span { - overflow: hidden; - top: 0; - left: 0; - right: 0; - position: absolute; - color: inherit; - padding-top: 1.5em; - } - span::before { - content: "\53\53\53\53\53"; - top: 0; - left: 0; - right: 0; - position: absolute; - color: inherit; - white-space: nowrap; - } - } - - .wc-block-all-products & { - margin-top: 0; - margin-bottom: $gap-small; - } - - &__container { - > * { - vertical-align: middle; - } - } - - &__reviews_count { - margin-left: $gap-smaller; - } - - &__norating-container { - display: inline-flex; - flex-direction: row; - align-items: center; - gap: $gap-smaller; - } - - &__norating { - display: inline-block; - overflow: hidden; - position: relative; - width: 1.5em; - height: 1.618em; - line-height: 1.618; - font-size: 1em; - /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */ - font-family: star; - font-weight: 400; - -webkit-text-stroke: 2px var(--wp--preset--color--black, #000); - &::before { - content: "\53"; - top: 0; - left: 0; - right: 0; - position: absolute; - color: transparent; - white-space: nowrap; - text-align: center; - } - } -} - -.wc-block-all-products, -.wp-block-query { - .is-loading { - .wc-block-components-product-rating { - @include placeholder(); - width: 7em; - } - } - - .wc-block-components-product-rating__container { - display: block; - } - - .wc-block-components-product-rating__stars.wc-block-grid__product-rating__stars { - margin: inherit; - } -} diff --git a/assets/js/blocks/breadcrumbs/index.tsx b/assets/js/blocks/breadcrumbs/index.tsx index ee6d49066b5..194aa54e9ad 100644 --- a/assets/js/blocks/breadcrumbs/index.tsx +++ b/assets/js/blocks/breadcrumbs/index.tsx @@ -10,7 +10,6 @@ import { Icon, queryPagination } from '@wordpress/icons'; */ import metadata from './block.json'; import edit from './edit'; -import './style.scss'; const featurePluginSupport = { ...metadata.supports, diff --git a/assets/js/blocks/cart-checkout-shared/payment-methods/payment-methods.js b/assets/js/blocks/cart-checkout-shared/payment-methods/payment-methods.js index b4b207cfc8b..a35312dc3f6 100644 --- a/assets/js/blocks/cart-checkout-shared/payment-methods/payment-methods.js +++ b/assets/js/blocks/cart-checkout-shared/payment-methods/payment-methods.js @@ -12,7 +12,6 @@ import { PAYMENT_STORE_KEY } from '@woocommerce/block-data'; import NoPaymentMethods from './no-payment-methods'; import PaymentMethodOptions from './payment-method-options'; import SavedPaymentMethodOptions from './saved-payment-method-options'; -import './style.scss'; /** * PaymentMethods component. diff --git a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx index 1b303359d4a..552ad127e34 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx @@ -8,7 +8,6 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; -import './style.scss'; registerBlockType( 'woocommerce/cart-cross-sells-products-block', { icon: { diff --git a/assets/js/blocks/cart/inner-blocks/cart-totals-block/edit.tsx b/assets/js/blocks/cart/inner-blocks/cart-totals-block/edit.tsx index f78a07ee392..6707e86914f 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-totals-block/edit.tsx +++ b/assets/js/blocks/cart/inner-blocks/cart-totals-block/edit.tsx @@ -9,6 +9,7 @@ import type { TemplateArray } from '@wordpress/blocks'; /** * Internal dependencies */ +import './style.scss'; import { useForcedLayout, getAllowedBlocks, diff --git a/assets/js/blocks/cart/inner-blocks/cart-totals-block/index.tsx b/assets/js/blocks/cart/inner-blocks/cart-totals-block/index.tsx index d5f041722d3..0cb78ff525f 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-totals-block/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/cart-totals-block/index.tsx @@ -8,7 +8,6 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; -import './style.scss'; registerBlockType( 'woocommerce/cart-totals-block', { icon: { diff --git a/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx b/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx index 2eecb03f2c1..d55c95784ea 100644 --- a/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx +++ b/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx @@ -15,6 +15,7 @@ import { useForcedLayout, getAllowedBlocks, } from '../../../cart-checkout-shared'; +import './style.scss'; const browseStoreTemplate = SHOP_URL ? [ diff --git a/assets/js/blocks/cart/inner-blocks/empty-cart-block/index.tsx b/assets/js/blocks/cart/inner-blocks/empty-cart-block/index.tsx index dc1c28cdb9d..2902049d61e 100644 --- a/assets/js/blocks/cart/inner-blocks/empty-cart-block/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/empty-cart-block/index.tsx @@ -9,7 +9,6 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; -import './style.scss'; registerBlockType( 'woocommerce/empty-cart-block', { icon: { diff --git a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx index 760138f9c10..6dc2e34644a 100644 --- a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx +++ b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx @@ -16,6 +16,7 @@ import { useCartEventsContext } from '@woocommerce/base-context/providers'; /** * Internal dependencies */ +import './style.scss'; import { defaultButtonLabel } from './constants'; /** diff --git a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/index.tsx b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/index.tsx index 8ccfdcb9c75..ba3058f0776 100644 --- a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/index.tsx @@ -9,7 +9,6 @@ import { registerBlockType } from '@wordpress/blocks'; */ import attributes from './attributes'; import { Edit, Save } from './edit'; -import './style.scss'; registerBlockType( 'woocommerce/proceed-to-checkout-block', { icon: { diff --git a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss index ec97ee8c1d8..06ef7f37a35 100644 --- a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss +++ b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss @@ -44,3 +44,4 @@ } } } + diff --git a/assets/js/blocks/catalog-sorting/index.tsx b/assets/js/blocks/catalog-sorting/index.tsx index 0fd0be1eb50..b83b17bf6af 100644 --- a/assets/js/blocks/catalog-sorting/index.tsx +++ b/assets/js/blocks/catalog-sorting/index.tsx @@ -10,7 +10,6 @@ import { totals } from '@woocommerce/icons'; */ import metadata from './block.json'; import edit from './edit'; -import './style.scss'; registerBlockType( metadata, { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx index 5896878c053..6e1302e6816 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx @@ -17,8 +17,8 @@ import { /** * Internal dependencies */ -import { defaultPlaceOrderButtonLabel } from './constants'; import './style.scss'; +import { defaultPlaceOrderButtonLabel } from './constants'; const Block = ( { cartPageId, diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/index.tsx index 8f5712b1b04..8fe72c17446 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/index.tsx @@ -10,7 +10,6 @@ import type { BlockConfiguration } from '@wordpress/blocks'; */ import attributes from './attributes'; import { Edit, Save } from './edit'; -import './style.scss'; const blockConfig: BlockConfiguration = { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx index ad682af396e..27cbaa28746 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx @@ -4,6 +4,11 @@ import classnames from 'classnames'; import { Main } from '@woocommerce/base-components/sidebar-layout'; +/** + * Internal dependencies + */ +import './style.scss'; + const FrontendBlock = ( { children, className, diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/index.tsx index b31c89ffad3..d78238e3729 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/index.tsx @@ -8,7 +8,6 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; -import './style.scss'; registerBlockType( 'woocommerce/checkout-fields-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx index 2696f82b730..71a1ebfdd70 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx @@ -8,7 +8,6 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; -import './style.scss'; registerBlockType( 'woocommerce/checkout-order-note-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/block.tsx index c204a044262..de7f2979e4f 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/block.tsx @@ -1,3 +1,7 @@ +/** + * External dependencies + */ + /** * Internal dependencies */ diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx index 91771f5109e..c5fe3756deb 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx @@ -26,6 +26,7 @@ import { LocalPickupSelect } from '@woocommerce/base-components/cart-checkout/lo /** * Internal dependencies */ +import './style.scss'; import ShippingRatesControlPackage from '../../../../base/components/cart-checkout/shipping-rates-control-package'; const getPickupLocation = ( diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/index.tsx index f173f14e506..89a01ceffc5 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/index.tsx @@ -9,7 +9,6 @@ import { registerBlockType } from '@wordpress/blocks'; */ import { Edit, Save } from './edit'; import attributes from './attributes'; -import './style.scss'; registerBlockType( 'woocommerce/checkout-pickup-options-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx index 190cb4fa3f2..b090729fb6f 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx @@ -17,6 +17,7 @@ import { isPackageRateCollectable } from '@woocommerce/base-utils'; /** * Internal dependencies */ +import './style.scss'; import { RatePrice, getLocalPickupPrices, getShippingPrices } from './shared'; import type { minMaxPrices } from './shared'; import { defaultLocalPickupText, defaultShippingText } from './constants'; diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/index.tsx index 6df154b730c..1a0e1859673 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/index.tsx @@ -9,7 +9,6 @@ import { registerBlockType } from '@wordpress/blocks'; */ import { Edit, Save } from './edit'; import attributes from './attributes'; -import './style.scss'; registerBlockType( 'woocommerce/checkout-shipping-method-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx index e0ad9bc0c72..68be42ddde5 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx @@ -25,6 +25,11 @@ import type { import NoticeBanner from '@woocommerce/base-components/notice-banner'; import type { ReactElement } from 'react'; +/** + * Internal dependencies + */ +import './style.scss'; + /** * Renders a shipping rate control option. * diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx index cb898b4663a..972723db9e8 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx @@ -9,7 +9,6 @@ import { registerBlockType } from '@wordpress/blocks'; */ import { Edit, Save } from './edit'; import attributes from './attributes'; -import './style.scss'; registerBlockType( 'woocommerce/checkout-shipping-methods-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx index 46ffce5c4cc..b3de54291b9 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx @@ -14,6 +14,7 @@ import { VALIDATION_STORE_KEY } from '@woocommerce/block-data'; * Internal dependencies */ import { termsConsentDefaultText, termsCheckboxDefaultText } from './constants'; +import './style.scss'; const FrontendBlock = ( { text, diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx index 11d01e0a451..60ff1e045de 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx @@ -3,12 +3,10 @@ */ import { Icon, customPostType } from '@wordpress/icons'; import { registerBlockType } from '@wordpress/blocks'; - /** * Internal dependencies */ import { Edit, Save } from './edit'; -import './style.scss'; registerBlockType( 'woocommerce/checkout-terms-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx index 43f65fab2ac..504483205a5 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx @@ -5,6 +5,11 @@ import classnames from 'classnames'; import { Sidebar } from '@woocommerce/base-components/sidebar-layout'; import { StoreNoticesContainer } from '@woocommerce/blocks-checkout'; +/** + * Internal dependencies + */ +import './style.scss'; + const FrontendBlock = ( { children, className, diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/index.tsx index 95f48f855fc..aa3581bbf9d 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/index.tsx @@ -8,7 +8,6 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; -import './style.scss'; registerBlockType( 'woocommerce/checkout-totals-block', { icon: { diff --git a/assets/js/blocks/checkout/order-notes/index.tsx b/assets/js/blocks/checkout/order-notes/index.tsx index e4345e3c340..e68d616c953 100644 --- a/assets/js/blocks/checkout/order-notes/index.tsx +++ b/assets/js/blocks/checkout/order-notes/index.tsx @@ -6,6 +6,11 @@ import { useState } from '@wordpress/element'; import { CheckboxControl } from '@woocommerce/blocks-checkout'; import { Textarea } from '@woocommerce/base-components/textarea'; +/** + * Internal dependencies + */ +import './style.scss'; + interface CheckoutOrderNotesProps { disabled: boolean; onChange: ( orderNotes: string ) => void; diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/style.scss b/assets/js/blocks/checkout/order-notes/style.scss similarity index 79% rename from assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/style.scss rename to assets/js/blocks/checkout/order-notes/style.scss index 5920676ae91..02b0c71dc48 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/style.scss +++ b/assets/js/blocks/checkout/order-notes/style.scss @@ -17,6 +17,6 @@ margin-top: $gap; } -.wc-block-components-form .wc-block-checkout__order-notes.wc-block-components-checkout-step { +.wc-block-checkout__order-notes.wc-block-components-checkout-step { padding-left: 0; } diff --git a/assets/js/blocks/customer-account/index.tsx b/assets/js/blocks/customer-account/index.tsx index 3f849b2c0f9..b1fc7e85f72 100644 --- a/assets/js/blocks/customer-account/index.tsx +++ b/assets/js/blocks/customer-account/index.tsx @@ -11,7 +11,6 @@ import { __ } from '@wordpress/i18n'; */ import metadata from './block.json'; import edit from './edit'; -import './style.scss'; registerBlockType( metadata, { icon: { diff --git a/assets/js/blocks/product-collection/inspector-controls/index.tsx b/assets/js/blocks/product-collection/inspector-controls/index.tsx index 449ba990524..7f4425cc9af 100644 --- a/assets/js/blocks/product-collection/inspector-controls/index.tsx +++ b/assets/js/blocks/product-collection/inspector-controls/index.tsx @@ -5,7 +5,6 @@ import type { BlockEditProps } from '@wordpress/blocks'; import { InspectorControls } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; import { useMemo } from '@wordpress/element'; -import { ProductCollectionFeedbackPrompt } from '@woocommerce/editor-components/feedback-prompt'; import { // @ts-expect-error Using experimental features // eslint-disable-next-line @wordpress/no-unsafe-wp-apis @@ -98,7 +97,6 @@ const ProductCollectionInspectorControls = ( /> ) : null } - ); }; diff --git a/assets/js/blocks/product-gallery/index.tsx b/assets/js/blocks/product-gallery/index.tsx index a7663318698..0ba762283ff 100644 --- a/assets/js/blocks/product-gallery/index.tsx +++ b/assets/js/blocks/product-gallery/index.tsx @@ -10,18 +10,18 @@ import { isExperimentalBuild } from '@woocommerce/block-settings'; import { Edit, Save } from './edit'; import metadata from './block.json'; import icon from './icon'; -import './inner-blocks/product-gallery-large-image'; if ( isExperimentalBuild() ) { registerBlockSingleProductTemplate( { blockName: metadata.name, + // @ts-expect-error: `metadata` currently does not have a type definition in WordPress core blockMetadata: metadata, blockSettings: { icon, + // @ts-expect-error `edit` can be extended to include other attributes edit: Edit, save: Save, ancestor: [ 'woocommerce/single-product' ], }, - isAvailableOnPostEditor: true, } ); } diff --git a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/block.json b/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/block.json deleted file mode 100644 index 35552107136..00000000000 --- a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/block.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "woocommerce/product-gallery-large-image", - "version": "1.0.0", - "title": "Large Image", - "description": "Display the Large Image of a product.", - "category": "woocommerce", - "keywords": [ "WooCommerce" ], - "usesContext": [ "postId" ], - "textdomain": "woo-gutenberg-products-block", - "ancestor": [ "woocommerce/product-gallery" ] -} diff --git a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/edit.tsx b/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/edit.tsx deleted file mode 100644 index ca6e2a2b5cb..00000000000 --- a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/edit.tsx +++ /dev/null @@ -1,34 +0,0 @@ -/** - * External dependencies - */ -import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings'; -import { useBlockProps } from '@wordpress/block-editor'; -import { Disabled } from '@wordpress/components'; - -export const Edit = (): JSX.Element => { - const blockProps = useBlockProps( { - className: 'wc-block-editor-product-gallery_large-image', - } ); - const Placeholder = () => { - return ( -
- Placeholder -
- ); - }; - - return ( -
- - - -
- ); -}; - -export const Save = (): JSX.Element => { - return
; -}; diff --git a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/icon.tsx b/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/icon.tsx deleted file mode 100644 index 3cc6ac1133e..00000000000 --- a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/icon.tsx +++ /dev/null @@ -1,18 +0,0 @@ -const Icon = () => ( - - - -); - -export default Icon; diff --git a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/index.tsx b/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/index.tsx deleted file mode 100644 index 46f7c25bf95..00000000000 --- a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/** - * External dependencies - */ -import { registerBlockType } from '@wordpress/blocks'; -import { isExperimentalBuild } from '@woocommerce/block-settings'; - -/** - * Internal dependencies - */ -import icon from './icon'; -import { Edit, Save } from './edit'; -import metadata from './block.json'; -import './style.scss'; - -if ( isExperimentalBuild() ) { - // @ts-expect-error: `metadata` currently does not have a type definition in WordPress core - registerBlockType( metadata, { - icon, - edit: Edit, - save: Save, - } ); -} diff --git a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/style.scss b/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/style.scss deleted file mode 100644 index 1f82c1b43fd..00000000000 --- a/assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/style.scss +++ /dev/null @@ -1,23 +0,0 @@ -.woocommerce .wp-block-woocommerce-product-gallery-large-image { - position: relative; - // This is necessary to calculate the correct width of the gallery. https://www.lockedownseo.com/parent-div-100-height-child-floated-elements/#:~:text=Solution%20%232%3A%20Float%20Parent%20Container - clear: both; - - span.onsale { - right: unset; - z-index: 1; - left: -1rem; - } -} - -// This is necessary to calculate the correct width of the gallery. https://www.lockedownseo.com/parent-div-100-height-child-floated-elements/#:~:text=Solution%20%232%3A%20Float%20Parent%20Container -.woocommerce .wp-block-woocommerce-product-gallery-large-image::after { - clear: both; - content: ""; - display: table; -} - - -.woocommerce .wp-block-woocommerce-product-gallery-large-image .woocommerce-product-gallery.images { - width: auto; -} diff --git a/assets/js/blocks/product-results-count/index.tsx b/assets/js/blocks/product-results-count/index.tsx index 0fd0be1eb50..b83b17bf6af 100644 --- a/assets/js/blocks/product-results-count/index.tsx +++ b/assets/js/blocks/product-results-count/index.tsx @@ -10,7 +10,6 @@ import { totals } from '@woocommerce/icons'; */ import metadata from './block.json'; import edit from './edit'; -import './style.scss'; registerBlockType( metadata, { icon: { diff --git a/assets/js/blocks/product-tag/index.tsx b/assets/js/blocks/product-tag/index.tsx index 3e0f742b704..fae42bf2c6c 100644 --- a/assets/js/blocks/product-tag/index.tsx +++ b/assets/js/blocks/product-tag/index.tsx @@ -8,9 +8,9 @@ import { Icon, tag } from '@wordpress/icons'; /** * Internal dependencies */ +import './editor.scss'; import metadata from './block.json'; import { Edit } from './edit'; -import './editor.scss'; /** * Register and run the "Products by Tag" block. diff --git a/assets/js/blocks/product-template/index.tsx b/assets/js/blocks/product-template/index.tsx index 6fc7771cc96..1686814d123 100644 --- a/assets/js/blocks/product-template/index.tsx +++ b/assets/js/blocks/product-template/index.tsx @@ -11,7 +11,6 @@ import metadata from './block.json'; import edit from './edit'; import save from './save'; import icon from './icon'; -import './style.scss'; const blockConfig: BlockConfiguration = { ...metadata, diff --git a/assets/js/editor-components/feedback-prompt/index.tsx b/assets/js/editor-components/feedback-prompt/index.tsx index 44487defd1e..ef1b2c0aad4 100644 --- a/assets/js/editor-components/feedback-prompt/index.tsx +++ b/assets/js/editor-components/feedback-prompt/index.tsx @@ -95,14 +95,3 @@ export const ProductQueryFeedbackPrompt = () => ( url={ 'https://airtable.com/shrFX5FAqmCY6hVYI' } /> ); - -export const ProductCollectionFeedbackPrompt = () => ( - -); diff --git a/assets/js/editor-components/search-list-control/search-list-control.tsx b/assets/js/editor-components/search-list-control/search-list-control.tsx index 27b057742c1..225e7e6d204 100644 --- a/assets/js/editor-components/search-list-control/search-list-control.tsx +++ b/assets/js/editor-components/search-list-control/search-list-control.tsx @@ -34,7 +34,6 @@ import type { ListItemsProps, SearchListItemsContainerProps, } from './types'; -import './style.scss'; const defaultRenderListItem = ( args: renderItemArgs ): JSX.Element => { return ; diff --git a/bin/webpack-configs.js b/bin/webpack-configs.js index 8bda9599f84..b5fb6f3f82d 100644 --- a/bin/webpack-configs.js +++ b/bin/webpack-configs.js @@ -660,32 +660,62 @@ const getStylingConfig = ( options = {} ) => { chunks: 'all', priority: 10, }, + vendorsStyle: { + test: /[\/\\]node_modules[\/\\].*?style\.s?css$/, + name: 'wc-blocks-vendors-style', + chunks: 'all', + priority: 7, + }, + blocksStyle: { + // Capture all stylesheets with name `style` or name that starts with underscore (abstracts). + test: /(style|_.*)\.scss$/, + name: 'wc-blocks-style', + chunks: 'all', + priority: 5, + }, }, }, }, module: { rules: [ { - test: /\.(j|t)sx?$/, - use: { - loader: 'babel-loader?cacheDirectory', - options: { - presets: [ '@wordpress/babel-preset-default' ], - plugins: [ - isProduction - ? require.resolve( - 'babel-plugin-transform-react-remove-prop-types' - ) - : false, - ].filter( Boolean ), + test: /[\/\\]node_modules[\/\\].*?style\.s?css$/, + use: [ + MiniCssExtractPlugin.loader, + { loader: 'css-loader', options: { importLoaders: 1 } }, + 'postcss-loader', + { + loader: 'sass-loader', + options: { + sassOptions: { + includePaths: [ 'node_modules' ], + }, + additionalData: ( content ) => { + const styleImports = [ + 'colors', + 'breakpoints', + 'variables', + 'mixins', + 'animations', + 'z-index', + ] + .map( + ( imported ) => + `@import "~@wordpress/base-styles/${ imported }";` + ) + .join( ' ' ); + return styleImports + content; + }, + }, }, - }, + ], }, { test: /\.s?css$/, + exclude: /node_modules/, use: [ MiniCssExtractPlugin.loader, - 'css-loader', + { loader: 'css-loader', options: { importLoaders: 1 } }, 'postcss-loader', { loader: 'sass-loader', @@ -731,7 +761,6 @@ const getStylingConfig = ( options = {} ) => { ], }, plugins: [ - ...getSharedPlugins( { bundleAnalyzerReportTitle: 'Styles' } ), new ProgressBarPlugin( getProgressBarPluginConfig( 'Styles' ) ), new WebpackRTLPlugin( { filename: `[name]${ fileSuffix }-rtl.css`, @@ -747,7 +776,7 @@ const getStylingConfig = ( options = {} ) => { ], resolve: { ...resolve, - extensions: [ '.js', '.jsx', '.ts', '.tsx' ], + extensions: [ '.js', '.ts', '.tsx' ], }, }; }; diff --git a/bin/webpack-entries.js b/bin/webpack-entries.js index be584009914..0d61c431eb4 100644 --- a/bin/webpack-entries.js +++ b/bin/webpack-entries.js @@ -50,10 +50,6 @@ const blocks = { 'product-gallery': { isExperimental: true, }, - 'product-gallery-large-image': { - customDir: 'product-gallery/inner-blocks/product-gallery-large-image', - isExperimental: true, - }, 'product-new': {}, 'product-on-sale': {}, 'product-query': { @@ -114,20 +110,27 @@ const getBlockEntries = ( relativePath ) => { const entries = { styling: { - // Packages styles - 'packages-style': glob.sync( './packages/**/index.js' ), + // @wordpress/components styles + 'custom-select-control-style': + './node_modules/wordpress-components/src/custom-select-control/style.scss', + 'snackbar-notice-style': + './node_modules/wordpress-components/src/snackbar/style.scss', + 'combobox-control-style': + './node_modules/wordpress-components/src/combobox-control/style.scss', + 'form-token-field-style': + './node_modules/wordpress-components/src/form-token-field/style.scss', - // Shared blocks code - 'wc-blocks': './assets/js/index.js', + 'general-style': glob.sync( './assets/**/*.scss', { + ignore: [ + // Block styles are added below. + './assets/js/blocks/*/*.scss', + ], + } ), - // Blocks - 'product-image-gallery': - './assets/js/atomic/blocks/product-elements/product-image-gallery/index.ts', - 'product-reviews': - './assets/js/atomic/blocks/product-elements/product-reviews/index.tsx', - 'product-details': - './assets/js/atomic/blocks/product-elements/product-details/index.tsx', - ...getBlockEntries( '{index,block,frontend}.{t,j}s{,x}' ), + 'packages-style': glob.sync( './packages/**/*.scss' ), + + 'reviews-style': './assets/js/blocks/reviews/editor.scss', + ...getBlockEntries( '**/*.scss' ), }, core: { wcBlocksRegistry: './assets/js/blocks-registry/index.js', diff --git a/packages/checkout/components/checkbox-control/style.scss b/packages/checkout/components/checkbox-control/style.scss index 47843f0c52c..71173748314 100644 --- a/packages/checkout/components/checkbox-control/style.scss +++ b/packages/checkout/components/checkbox-control/style.scss @@ -1,7 +1,7 @@ .wc-block-components-checkbox { @include reset-color(); @include reset-typography(); - margin-top: em($gap); + margin-top: em($gap-large); label { align-items: flex-start; diff --git a/src/Assets/Api.php b/src/Assets/Api.php index 9550be10897..7f950752248 100644 --- a/src/Assets/Api.php +++ b/src/Assets/Api.php @@ -233,22 +233,17 @@ function() use ( $handle ) { * @since 2.5.0 * @since 2.6.0 Change src to be relative source. * - * @param string $handle Name of the stylesheet. Should be unique. - * @param string $relative_src Relative source of the stylesheet to the plugin path. - * @param array $deps Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array. - * @param string $media Optional. The media for which this stylesheet has been defined. Default 'all'. Accepts media types like - * 'all', 'print' and 'screen', or media queries like '(orientation: portrait)' and '(max-width: 640px)'. - * @param boolean $rtl Optional. Whether or not to register RTL styles. + * @param string $handle Name of the stylesheet. Should be unique. + * @param string $relative_src Relative source of the stylesheet to the plugin path. + * @param array $deps Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array. + * @param string $media Optional. The media for which this stylesheet has been defined. Default 'all'. Accepts media types like + * 'all', 'print' and 'screen', or media queries like '(orientation: portrait)' and '(max-width: 640px)'. */ - public function register_style( $handle, $relative_src, $deps = [], $media = 'all', $rtl = false ) { + public function register_style( $handle, $relative_src, $deps = [], $media = 'all' ) { $filename = str_replace( plugins_url( '/', __DIR__ ), '', $relative_src ); $src = $this->get_asset_url( $relative_src ); $ver = $this->get_file_version( $filename ); wp_register_style( $handle, $src, $deps, $ver, $media ); - - if ( $rtl ) { - wp_style_add_data( $handle, 'rtl', 'replace' ); - } } /** diff --git a/src/AssetsController.php b/src/AssetsController.php index bdfa549152f..6691c1ff586 100644 --- a/src/AssetsController.php +++ b/src/AssetsController.php @@ -47,9 +47,9 @@ protected function init() { * Register block scripts & styles. */ public function register_assets() { - $this->register_style( 'wc-blocks-packages-style', plugins_url( $this->api->get_block_asset_build_path( 'packages-style', 'css' ), __DIR__ ), [], 'all', true ); - $this->register_style( 'wc-blocks-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks', 'css' ), __DIR__ ), [], 'all', true ); + $this->register_style( 'wc-blocks-vendors-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-vendors-style', 'css' ), __DIR__ ) ); $this->register_style( 'wc-blocks-editor-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-editor-style', 'css' ), __DIR__ ), [ 'wp-edit-blocks' ], 'all', true ); + $this->register_style( 'wc-blocks-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-style', 'css' ), __DIR__ ), [ 'wc-blocks-vendors-style' ], 'all', true ); $this->api->register_script( 'wc-blocks-middleware', 'build/wc-blocks-middleware.js', [], false ); $this->api->register_script( 'wc-blocks-data-store', 'build/wc-blocks-data.js', [ 'wc-blocks-middleware' ] ); diff --git a/src/BlockTypes/AbstractBlock.php b/src/BlockTypes/AbstractBlock.php index ba0c35a249b..75ff4f0e6d8 100644 --- a/src/BlockTypes/AbstractBlock.php +++ b/src/BlockTypes/AbstractBlock.php @@ -300,12 +300,11 @@ protected function get_block_type_script( $key = null ) { /** * Get the frontend style handle for this block type. * - * @return string[]|null + * @see $this->register_block_type() + * @return string|null */ protected function get_block_type_style() { - $this->asset_api->register_style( 'wc-blocks-style-' . $this->block_name, $this->asset_api->get_block_asset_build_path( $this->block_name, 'css' ), [], 'all', true ); - - return [ 'wc-blocks-style', 'wc-blocks-style-' . $this->block_name ]; + return 'wc-blocks-style'; } /** diff --git a/src/BlockTypes/AbstractInnerBlock.php b/src/BlockTypes/AbstractInnerBlock.php index 6cf4aa3902a..07d75d591a9 100644 --- a/src/BlockTypes/AbstractInnerBlock.php +++ b/src/BlockTypes/AbstractInnerBlock.php @@ -54,12 +54,4 @@ protected function get_block_type_script( $key = null ) { return parent::get_block_type_script( $key ); } - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } } diff --git a/src/BlockTypes/AbstractProductGrid.php b/src/BlockTypes/AbstractProductGrid.php index 3348a506cbc..8fe0641ac0b 100644 --- a/src/BlockTypes/AbstractProductGrid.php +++ b/src/BlockTypes/AbstractProductGrid.php @@ -686,14 +686,4 @@ protected function enqueue_data( array $attributes = [] ) { $this->asset_data_registry->add( 'default_rows', wc_get_theme_support( 'product_blocks::default_rows', 3 ), true ); $this->asset_data_registry->add( 'stock_status_options', wc_get_product_stock_status_options(), true ); } - - /** - * Get the frontend style handle for this block type. - * - * @return string[] - */ - protected function get_block_type_style() { - // Currently these blocks rely on the styles from the All Products block. - return [ 'wc-blocks-style', 'wc-blocks-style-all-products' ]; - } } diff --git a/src/BlockTypes/AddToCartForm.php b/src/BlockTypes/AddToCartForm.php index 0ec14752e72..2bb0c3de4de 100644 --- a/src/BlockTypes/AddToCartForm.php +++ b/src/BlockTypes/AddToCartForm.php @@ -176,15 +176,6 @@ protected function get_block_type_script( $key = null ) { return null; } - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } - /** * It isn't necessary register block assets because it is a server side block. */ diff --git a/src/BlockTypes/AttributeFilter.php b/src/BlockTypes/AttributeFilter.php index 82be8c7eb9a..0979f6d2353 100644 --- a/src/BlockTypes/AttributeFilter.php +++ b/src/BlockTypes/AttributeFilter.php @@ -25,13 +25,4 @@ protected function enqueue_data( array $attributes = [] ) { parent::enqueue_data( $attributes ); $this->asset_data_registry->add( 'attributes', array_values( wc_get_attribute_taxonomies() ), true ); } - - /** - * Get the frontend style handle for this block type. - * - * @return string[] - */ - protected function get_block_type_style() { - return array_merge( parent::get_block_type_style(), [ 'wc-blocks-packages-style' ] ); - } } diff --git a/src/BlockTypes/Cart.php b/src/BlockTypes/Cart.php index 79068f52071..227351a0047 100644 --- a/src/BlockTypes/Cart.php +++ b/src/BlockTypes/Cart.php @@ -100,15 +100,6 @@ protected function get_block_type_script( $key = null ) { return $key ? $script[ $key ] : $script; } - /** - * Get the frontend style handle for this block type. - * - * @return string[] - */ - protected function get_block_type_style() { - return array_merge( parent::get_block_type_style(), [ 'wc-blocks-packages-style' ] ); - } - /** * Enqueue frontend assets for this block, just in time for rendering. * diff --git a/src/BlockTypes/Checkout.php b/src/BlockTypes/Checkout.php index c2019574b69..758725cff81 100644 --- a/src/BlockTypes/Checkout.php +++ b/src/BlockTypes/Checkout.php @@ -55,15 +55,6 @@ protected function get_block_type_script( $key = null ) { return $key ? $script[ $key ] : $script; } - /** - * Get the frontend style handle for this block type. - * - * @return string[] - */ - protected function get_block_type_style() { - return array_merge( parent::get_block_type_style(), [ 'wc-blocks-packages-style' ] ); - } - /** * Enqueue frontend assets for this block, just in time for rendering. * diff --git a/src/BlockTypes/ClassicTemplate.php b/src/BlockTypes/ClassicTemplate.php index bc24b6c34ed..1ac9fcb49c5 100644 --- a/src/BlockTypes/ClassicTemplate.php +++ b/src/BlockTypes/ClassicTemplate.php @@ -390,12 +390,4 @@ function( $value ) use ( $stock_status ) { return $meta_query; } - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } } diff --git a/src/BlockTypes/FilterWrapper.php b/src/BlockTypes/FilterWrapper.php index 3bd42018298..58d027234bd 100644 --- a/src/BlockTypes/FilterWrapper.php +++ b/src/BlockTypes/FilterWrapper.php @@ -11,13 +11,4 @@ class FilterWrapper extends AbstractBlock { * @var string */ protected $block_name = 'filter-wrapper'; - - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } } diff --git a/src/BlockTypes/MiniCart.php b/src/BlockTypes/MiniCart.php index 60b33ae98de..84fb4096d7f 100644 --- a/src/BlockTypes/MiniCart.php +++ b/src/BlockTypes/MiniCart.php @@ -108,15 +108,6 @@ protected function get_block_type_script( $key = null ) { return $key ? $script[ $key ] : $script; } - /** - * Get the frontend style handle for this block type. - * - * @return string[] - */ - protected function get_block_type_style() { - return array_merge( parent::get_block_type_style(), [ 'wc-blocks-packages-style' ] ); - } - /** * Extra data passed through from server to client for block. * diff --git a/src/BlockTypes/MiniCartContents.php b/src/BlockTypes/MiniCartContents.php index ee9f1fa16f4..37ee9ee31ec 100644 --- a/src/BlockTypes/MiniCartContents.php +++ b/src/BlockTypes/MiniCartContents.php @@ -45,15 +45,6 @@ protected function get_block_type_script( $key = null ) { return null; } - /** - * Get the frontend style handle for this block type. - * - * @return string[] - */ - protected function get_block_type_style() { - return array_merge( parent::get_block_type_style(), [ 'wc-blocks-packages-style' ] ); - } - /** * Render the markup for the Mini-Cart Contents block. * diff --git a/src/BlockTypes/ProceedToCheckoutBlock.php b/src/BlockTypes/ProceedToCheckoutBlock.php index 5a7b19177aa..e2a883eeca3 100644 --- a/src/BlockTypes/ProceedToCheckoutBlock.php +++ b/src/BlockTypes/ProceedToCheckoutBlock.php @@ -12,6 +12,7 @@ class ProceedToCheckoutBlock extends AbstractInnerBlock { */ protected $block_name = 'proceed-to-checkout-block'; + /** * Extra data passed through from server to client for block. * diff --git a/src/BlockTypes/ProductCollection.php b/src/BlockTypes/ProductCollection.php index bcbc1cafcb6..615924ac29c 100644 --- a/src/BlockTypes/ProductCollection.php +++ b/src/BlockTypes/ProductCollection.php @@ -46,15 +46,6 @@ protected function get_block_type_script( $key = null ) { return null; } - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } - /** * Initialize this block type. * diff --git a/src/BlockTypes/ProductGallery.php b/src/BlockTypes/ProductGallery.php index ecb9b2470ce..9f1d6d60c3a 100644 --- a/src/BlockTypes/ProductGallery.php +++ b/src/BlockTypes/ProductGallery.php @@ -11,13 +11,4 @@ class ProductGallery extends AbstractBlock { * @var string */ protected $block_name = 'product-gallery'; - - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } } diff --git a/src/BlockTypes/ProductGalleryLargeImage.php b/src/BlockTypes/ProductGalleryLargeImage.php deleted file mode 100644 index ae7de3e0d0c..00000000000 --- a/src/BlockTypes/ProductGalleryLargeImage.php +++ /dev/null @@ -1,80 +0,0 @@ -context['postId']; - - if ( ! isset( $post_id ) ) { - return ''; - } - - global $product; - - $previous_product = $product; - $product = wc_get_product( $post_id ); - if ( ! $product instanceof \WC_Product ) { - $product = $previous_product; - - return ''; - } - - if ( class_exists( 'WC_Frontend_Scripts' ) ) { - $frontend_scripts = new \WC_Frontend_Scripts(); - $frontend_scripts::load_scripts(); - } - - ob_start(); - woocommerce_show_product_sale_flash(); - $sale_badge_html = ob_get_clean(); - - ob_start(); - remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); - woocommerce_show_product_images(); - $product_image_gallery_html = ob_get_clean(); - add_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); - - $product = $previous_product; - $classname = $attributes['className'] ?? ''; - return sprintf( - '', - esc_attr( $classname ), - $sale_badge_html, - $product_image_gallery_html - ); - } -} diff --git a/src/BlockTypes/ProductPrice.php b/src/BlockTypes/ProductPrice.php index 2b2235d08ff..038bd4be373 100644 --- a/src/BlockTypes/ProductPrice.php +++ b/src/BlockTypes/ProductPrice.php @@ -46,15 +46,6 @@ protected function get_block_type_supports() { ); } - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } - /** * Overwrite parent method to prevent script registration. * diff --git a/src/BlockTypes/ProductRating.php b/src/BlockTypes/ProductRating.php index d9dfec13379..ab7369a1cf9 100644 --- a/src/BlockTypes/ProductRating.php +++ b/src/BlockTypes/ProductRating.php @@ -80,15 +80,6 @@ protected function register_block_type_assets() { return null; } - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return array_merge( parent::get_block_type_style(), [ 'wc-blocks-packages-style' ] ); - } - /** * Register the context. */ diff --git a/src/BlockTypes/RatingFilter.php b/src/BlockTypes/RatingFilter.php index 2e44896319d..5968c6aac62 100644 --- a/src/BlockTypes/RatingFilter.php +++ b/src/BlockTypes/RatingFilter.php @@ -22,13 +22,4 @@ class RatingFilter extends AbstractBlock { protected function get_block_type_script( $key = null ) { return null; } - - /** - * Get the frontend style handle for this block type. - * - * @return string[] - */ - protected function get_block_type_style() { - return array_merge( parent::get_block_type_style(), [ 'wc-blocks-packages-style' ] ); - } } diff --git a/src/BlockTypes/RelatedProducts.php b/src/BlockTypes/RelatedProducts.php index f27f2bfb9c3..e89e22a57d2 100644 --- a/src/BlockTypes/RelatedProducts.php +++ b/src/BlockTypes/RelatedProducts.php @@ -51,15 +51,6 @@ protected function register_block_type_assets() { return null; } - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } - /** * Update the query for the product query block. * @@ -131,6 +122,8 @@ public function render_block( string $content, array $block ) { return $content; } + + /** * Determines whether the block is a related products block. * diff --git a/src/BlockTypes/StockFilter.php b/src/BlockTypes/StockFilter.php index 82fe9b696ee..3f0784d80e3 100644 --- a/src/BlockTypes/StockFilter.php +++ b/src/BlockTypes/StockFilter.php @@ -33,13 +33,4 @@ protected function enqueue_data( array $stock_statuses = [] ) { public static function get_stock_status_query_var_values() { return array_keys( wc_get_product_stock_status_options() ); } - - /** - * Get the frontend style handle for this block type. - * - * @return string[] - */ - protected function get_block_type_style() { - return array_merge( parent::get_block_type_style(), [ 'wc-blocks-packages-style' ] ); - } } diff --git a/src/BlockTypes/StoreNotices.php b/src/BlockTypes/StoreNotices.php index d346d31d05e..f20ca6ee478 100644 --- a/src/BlockTypes/StoreNotices.php +++ b/src/BlockTypes/StoreNotices.php @@ -57,13 +57,4 @@ protected function render( $attributes, $content, $block ) { protected function get_block_type_script( $key = null ) { return null; } - - /** - * Get the frontend style handle for this block type. - * - * @return null - */ - protected function get_block_type_style() { - return null; - } } diff --git a/src/BlockTypesController.php b/src/BlockTypesController.php index 5a62e04fb52..1695cea0d22 100644 --- a/src/BlockTypesController.php +++ b/src/BlockTypesController.php @@ -191,7 +191,6 @@ protected function get_block_types() { 'ProductCategories', 'ProductCategory', 'ProductGallery', - 'ProductGalleryLargeImage', 'ProductImage', 'ProductImageGallery', 'ProductNew', diff --git a/tests/e2e-pw/tests/products/products.block_theme.side_effects.spec.ts b/tests/e2e-pw/tests/products/products.block_theme.side_effects.spec.ts index 171dd358d09..314f85e505c 100644 --- a/tests/e2e-pw/tests/products/products.block_theme.side_effects.spec.ts +++ b/tests/e2e-pw/tests/products/products.block_theme.side_effects.spec.ts @@ -151,12 +151,11 @@ for ( const { parentClientId ); - await Promise.all( [ - editor.saveSiteEditorEntities(), - page.waitForResponse( ( response ) => - response.url().includes( 'wp-json/wp/v2/templates/' ) - ), - ] ); + await editor.saveSiteEditorEntities(); + + await page.waitForResponse( ( response ) => + response.url().includes( 'wp-json/wp/v2/templates/' ) + ); // @todo This is a workaround to wait for the save button to be enabled. It works only without Gutenberg enabled. We have to refactor this. await page diff --git a/tests/e2e/specs/backend/__fixtures__/active-filters.fixture.json b/tests/e2e/specs/backend/__fixtures__/active-filters.fixture.json index 157c101e084..a07cc1b7a8a 100644 --- a/tests/e2e/specs/backend/__fixtures__/active-filters.fixture.json +++ b/tests/e2e/specs/backend/__fixtures__/active-filters.fixture.json @@ -1 +1 @@ -{"title":"Active Filters Block","pageContent":"

Active filters

"} +{"title":"Active Filters Block","pageContent":"

Active filters

"} diff --git a/tests/e2e/specs/backend/__fixtures__/filter-products-by-price.fixture.json b/tests/e2e/specs/backend/__fixtures__/filter-products-by-price.fixture.json index 084ef7e90b5..8a837d3b968 100644 --- a/tests/e2e/specs/backend/__fixtures__/filter-products-by-price.fixture.json +++ b/tests/e2e/specs/backend/__fixtures__/filter-products-by-price.fixture.json @@ -1 +1 @@ -{"title":"Filter by Price Block","pageContent":"

Filter by price

"} +{"title":"Filter by Price Block","pageContent":"

Filter by price

"} diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index 95531b572d3..148df4c703b 100644 --- a/woocommerce-gutenberg-products-block.php +++ b/woocommerce-gutenberg-products-block.php @@ -112,6 +112,7 @@ function () { ); } + /** * Autoload packages. * From a1c188c26d74f65c9118302c6fc1e87df4fae01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Thu, 6 Jul 2023 16:39:19 +0200 Subject: [PATCH 38/40] Cherry pick 1a7365d (#10116) --- .../__fixtures__/filter-products-by-attribute.fixture.json | 2 +- .../backend/__fixtures__/filter-products-by-stock.fixture.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/backend/__fixtures__/filter-products-by-attribute.fixture.json b/tests/e2e/specs/backend/__fixtures__/filter-products-by-attribute.fixture.json index 71a4d05070c..b9060024a19 100644 --- a/tests/e2e/specs/backend/__fixtures__/filter-products-by-attribute.fixture.json +++ b/tests/e2e/specs/backend/__fixtures__/filter-products-by-attribute.fixture.json @@ -1 +1 @@ -{"title":"Filter by Attribute Block","pageContent":"

Filter by Capacity

\n
\n"} +{"title":"Filter Products by Stock Block","pageContent":"

Filter by stock status

"} diff --git a/tests/e2e/specs/backend/__fixtures__/filter-products-by-stock.fixture.json b/tests/e2e/specs/backend/__fixtures__/filter-products-by-stock.fixture.json index 81676996ffc..27645325576 100644 --- a/tests/e2e/specs/backend/__fixtures__/filter-products-by-stock.fixture.json +++ b/tests/e2e/specs/backend/__fixtures__/filter-products-by-stock.fixture.json @@ -1 +1 @@ -{"title":"Filter Products by Stock Block","pageContent":"

Filter by stock status

"} +{"title":"Filter by Attribute Block","pageContent":"

Filter by Capacity

\n
\n"} From e3c9814b69422223e69927641b5bee6ec358e6bd Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 6 Jul 2023 21:38:54 +0100 Subject: [PATCH 39/40] Update zip to include patches --- docs/internal-developers/testing/releases/1060.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/1060.md b/docs/internal-developers/testing/releases/1060.md index 6aab215d0f8..b000073b8b4 100644 --- a/docs/internal-developers/testing/releases/1060.md +++ b/docs/internal-developers/testing/releases/1060.md @@ -1,6 +1,6 @@ # Testing notes and ZIP for release 10.6.0 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11969551/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11972116/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From 1c6e2ebd6522cf44deaa262c730cb9059ddfe3f1 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Fri, 7 Jul 2023 11:43:14 +0100 Subject: [PATCH 40/40] Update release date in readme --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index fe376ab15f6..5cf66cca757 100644 --- a/readme.txt +++ b/readme.txt @@ -81,7 +81,7 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == -= 10.6.0 - 2023-07-06 = += 10.6.0 - 2023-07-07 = #### Enhancements