Commit Graph

5673 Commits

Author SHA1 Message Date
Roy Ho 537c1070ce Update 1060.md (https://github.com/woocommerce/woocommerce-blocks/pull/10274) 2023-07-19 06:31:18 -07:00
Albert Juhé Lluveras f22c462d5f Remove opinionated styles from Hero Product 3 Split pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10260)
* Remove opinionated styles from Hero Product 3 Split pattern

* Make strings in Hero Product 3 Split pattern translatable
2023-07-19 14:38:12 +02:00
Patricia Hillebrandt 2ca0a113da Store Customization > Hero Product Split pattern - Update the pattern to become wireframed (https://github.com/woocommerce/woocommerce-blocks/pull/10270)
* Remove opinionated styles from the Hero Product Split pattern.

* Remove additional has-text-color and has-background
2023-07-19 14:21:41 +02:00
Alba Rincón 0b81176d3b Remove styles from `Newest arrivals` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10256)
* Remove styles from `Newest arrivals` pattern

* Remove id

* Replace row with columns to be able to stack blocks on mobile

* Make string translatable

* Make button string translatable
2023-07-19 13:24:32 +02:00
Alba Rincón afecefbdf3 Remove styles from the `Testimonials 3 cols` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10258)
* Remove styles from the `Testimonials 3 cols` pattern

* Make strings translatable
2023-07-19 13:24:21 +02:00
Mike Jolley 464d5b4385 Prepend CSS src with correct url scheme (https://github.com/woocommerce/woocommerce-blocks/pull/10240)
* Prepend src with correct url scheme

* set_url_scheme
2023-07-19 11:23:25 +01:00
Patricia Hillebrandt e1222b8033 Remove opinionated styles from the Minimal Header pattern. (https://github.com/woocommerce/woocommerce-blocks/pull/10227) 2023-07-19 12:05:44 +02:00
Mike Jolley bd537e1008 Get latest cart when triggering events (https://github.com/woocommerce/woocommerce-blocks/pull/10254) 2023-07-19 10:42:25 +01:00
Patricia Hillebrandt f017fbe1b1 Remove opinionated styles from the Centered Header Menu with Search pattern. (https://github.com/woocommerce/woocommerce-blocks/pull/10226) 2023-07-19 11:35:35 +02:00
Alba Rincón 5eef9bff65 Add new `Product Average Rating` block (https://github.com/woocommerce/woocommerce-blocks/pull/10207)
* Add new Product Average Rating block

* Add new blocks to the feature flag docs

* Translate 'No ratings'

* Fix condition

* Small improvements after review

* Avoid duplication of styles

* Update supports in php class
2023-07-19 11:21:30 +02:00
Karol Manijak 67dbd22dfe Fix incorrect filter application in Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/10263)
* Fix the incorrectly applied filter in Product Collection

* Get the block name from metadata
2023-07-19 11:15:37 +02:00
Albert Juhé Lluveras e38c33c2de Remove opinionated styles from Product Hero pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10255) 2023-07-19 11:14:11 +02:00
Manish Menaria 1ea6355a04 Enable auto-expand for product selection in HandPickedProductsControl (https://github.com/woocommerce/woocommerce-blocks/pull/10250)
This commit adds a new `__experimentalExpandOnFocus` attribute to the component within the `HandPickedProductsControl`. The value is set to `true`, enabling automatic expansion of the list when the user focuses on the product selection field.

This change aims to improve the user experience by making it easier for the user to see all available options when they focus on the selection list.
2023-07-19 12:07:24 +05:30
Albert Juhé Lluveras 4e68edff91 Remove work-around code in EditableButton component to fix typing Space (https://github.com/woocommerce/woocommerce-blocks/pull/10248) 2023-07-18 18:04:50 +02:00
Roy Ho cd666ee081 Add class specificity to fix indent (https://github.com/woocommerce/woocommerce-blocks/pull/10245) 2023-07-18 06:21:13 -07:00
Albert Juhé Lluveras f43ced978b Remove Featured Category Cover Image pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10252)
* Remove Featured Category Cover Image pattern

* Remove Featured Category Cover Image pattern image
2023-07-18 15:10:53 +02:00
Thomas Roberts 9e686e0a71 Update changelog and testing notes after release 10.6.1 2023-07-18 11:12:11 +01:00
Albert Juhé Lluveras bf20e670dd Create Mini-Cart template part area (https://github.com/woocommerce/woocommerce-blocks/pull/10203)
* Create Mini-Cart template part area

* Update Mini-Cart template part name to exclude it

* Update src/BlockTemplatesController.php

Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>

* Update src/BlockTemplatesController.php

Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>

* Keep both variations of the template part name when excluding them

* Revert "Keep both variations of the template part name when excluding them"

This reverts commit c3f293511536d1ebbac0f50caaf74cded28d0025.

---------

Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2023-07-18 09:12:43 +02:00
Karol Manijak 333c850567 Newest Products: fix Stock Status filter (https://github.com/woocommerce/woocommerce-blocks/pull/10201)
* Newest Products: fix Stock Status filter

* Change the default of Product Stock Control to ALL available stock statuses
2023-07-18 08:39:09 +02:00
Thomas Roberts 5b6fde512e Update changelog and testing notes after release 10.4.6 2023-07-17 19:35:13 +01:00
Mike Jolley ac1d7a251e Replace sanitization functions to enforce string values (https://github.com/woocommerce/woocommerce-blocks/pull/10242) 2023-07-17 08:47:25 -07:00
Seghir Nadir 23cb8fe320 Don't send headers early in Store API (https://github.com/woocommerce/woocommerce-blocks/pull/10241) 2023-07-17 16:16:02 +01:00
Albert Juhé Lluveras 42db1bb4ab Remove opinionated font sizes from Essential Header patterns (https://github.com/woocommerce/woocommerce-blocks/pull/10219)
* Remove opinionated styles from Essential Header pattern

* Remove opinionated font sizes from Essential Header Dark pattern
2023-07-17 14:49:00 +02:00
Seghir Nadir 0eab61f93f Merge pull request from GHSA-gxfx-93xq-pr6p
* Add cors check

* refactor logic

* Refactor add_cors_headers to allow null and allowed hosts

* Move remove_filter inline

* Revert unrelated code style changes

* Add explainer to docblock

* Remove access for null origin

* Move CORS handling to auth class so it applies API wide

* Move only Authentication to priority 11

* Handle preflight requests so cart-tokens work

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-07-17 12:51:34 +01:00
Karol Manijak 3f7284f978 Remove unused variables from ProductImage.php (https://github.com/woocommerce/woocommerce-blocks/pull/10213) 2023-07-17 11:51:46 +02:00
Daniel Dudzic 2412e9dadb Mini Cart: Remove deprecated print_inline_script() (https://github.com/woocommerce/woocommerce-blocks/pull/10165)
* Mini Cart: Replace the deprecated print_inline_script() with supported get_inline_script_data(). Fixes woocommerce/woocommerce-blocks#10004

* Mini Cart: Add version check for the new get_inline_script_data() function

* Update the variable names and fix a typo

* Mini Cart: Add regex to check for the WP version

* Abstract the WP version comparison regex to a separate Utils class
2023-07-14 23:22:34 +00:00
Daniel Dudzic e5b4bdf3a5 Product Gallery Large Image: Add the php experimental flag (https://github.com/woocommerce/woocommerce-blocks/pull/10158) 2023-07-14 16:31:12 -03:00
Albert Juhé Lluveras 55a6e38598 Prevent Mini-Cart template part preview in Site Editor being too high (https://github.com/woocommerce/woocommerce-blocks/pull/10204)
* Prevent Mini-Cart template part preview in Site Editor being too high

* Remove Mini-Cart Contents styles related to Style Book
2023-07-14 16:12:40 +02:00
Albert Juhé Lluveras a3ac0e2c62 Fix SearchListControl styles (https://github.com/woocommerce/woocommerce-blocks/pull/10192)
* Fix SearchListControl checkbox styles

* Encode SearchListControl labels

* Fix SearchListControl styling

* Update snapshots
2023-07-14 13:50:23 +02:00
Daniel Dudzic 2240504d51 Mini Cart: Fix styling of the Start Shopping button in the drawer. Fixes woocommerce/woocommerce-blocks#10035 (https://github.com/woocommerce/woocommerce-blocks/pull/10169) 2023-07-14 11:47:23 +00:00
Luigi Teschio 9e9425b092 fix migration (https://github.com/woocommerce/woocommerce-blocks/pull/10205) 2023-07-14 11:16:06 +00:00
Karol Manijak 041d4ad4b1 Stop reading Product IDs from asset store in filter blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10195)
* Remove queries that fetch all products for manipulating the results returned by the Store API for certain use-cases.

* Remove the code that's supposed to read product ids for filter context and logic around that in useCollectionData

* Fix incorrect merge

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-07-14 11:18:10 +02:00
Patricia Hillebrandt 53668eb066 Product Filters > Fix Performance issue and Fatal error on stores with a high volume of products (https://github.com/woocommerce/woocommerce-blocks/pull/10198)
* Remove queries that fetch all products for manipulating the results returned by the Store API for certain use-cases.

* Keep support for Product Collection block
2023-07-14 10:34:55 +02:00
Alba Rincón 3d8331363c `Rating Stars` block improvements (https://github.com/woocommerce/woocommerce-blocks/pull/10148)
* Rating start block improvements

Fix classes, register in single product, remove unused code

* Allow to use block on product & product collection

* Fix star missalignment

* Restrict the block to be insertable only in single product
2023-07-14 09:41:58 +02:00
Alba Rincón d82a4b671f Add new `Ratings counter` block (https://github.com/woocommerce/woocommerce-blocks/pull/10114)
* Add new rating counter block

* Fix colors and register globally

* Add missing import

* Remove unused file

* Reorder blocks alphabetically

* Remove unnecessary html

* Change registration, fix classes

* Fix margin

* Remove icon from block.json, add ancestors

* Move icon and remove unused constants

* Fix classes

* Remove condition

* Allow to use block on product & product collection

* Enable block only on single product

* Move ancestors to block.json
2023-07-14 08:57:19 +02:00
Manish Menaria bd892c4781 Add E2E tests for 'Inherit query from template' control in Product Collection block (https://github.com/woocommerce/woocommerce-blocks/pull/10174)
Key updates:

1. Additional CSS class to Inherit Query Control: A CSS class named `wc-block-product-collection__inherit-query-control` has been added to the ToggleControl component. This provides a precise target for E2E tests and potential custom styles.

2. E2E tests for 'Inherit query from template' control: Numerous scenarios have been covered to ensure the control's correct behavior. These scenarios include verifying visibility under different circumstances and checking its functionality in a Product Catalog template.

3. E2E test code enhancements: The E2E test code now exports the `SELECTORS` object to assist in locating different elements during the tests. This includes the new 'Inherit query from template' control. The `setShowOnlyProductsOnSale()` function has been refactored to improve readability and provide more granular control over its operations.

4. Test scenario for 'Show only products on sale': The existing E2E test for this functionality has been extended to check that it retains its state when the 'Inherit query from template' control is toggled.

These changes increase the robustness of our E2E tests, providing better coverage for the 'Inherit query from template' control in the Product Collection block.
2023-07-14 10:52:19 +05:30
Bernie Reiter 1aaf7384d2 README: Update required Node version to 16.15, add note on version management tools (https://github.com/woocommerce/woocommerce-blocks/pull/10175)
* README: Set required Node version to v16.15

* Add note about Node version management tools.
2023-07-12 18:10:13 +02:00
Karol Manijak de0cc88147 Automatic migration path from Products to Product Collection - step 3 - allow reverting migration (https://github.com/woocommerce/woocommerce-blocks/pull/10144)
* Add logic to revert migration from Product to Product Collection
2023-07-12 17:01:49 +02:00
Alex Florisca 52506cbe81 Fix margin issue with the Proceed to checkout button on the site editor (https://github.com/woocommerce/woocommerce-blocks/pull/10182)
* Fix margin issue with the Proceed to checkout button on the site editor

* Remove unecessary selector
2023-07-12 15:28:37 +01:00
Patricia Hillebrandt 64405c7a43 Mini Cart block > Update block registration to rely on a metadata file. (https://github.com/woocommerce/woocommerce-blocks/pull/10168)
* Introduce the block.json file for the mini-cart block.

* Update the index.tsx file to use the new metadata file for registering the mini cart.
2023-07-12 16:20:19 +02:00
Darren Ethier 2efe99126f Account for classic theme support of template parts (https://github.com/woocommerce/woocommerce-blocks/pull/9780)
* allow for handling classic theme template part support

Note this logic is currently not right - just a quick implementation for testing POC

* Account for classic theme support of template parts

* Update supports_block_templates signature so it accepts the template type instead of a bool

* Simplify logic in supports_block_templates

* Test

* Fix supports_block_templates check to test correct template type

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-07-12 15:51:30 +02:00
Karol Manijak dbfa57bd67 Automatic migration path from Products to Product Collection - step 2 - display notice (https://github.com/woocommerce/woocommerce-blocks/pull/10139)
* Display upgrade notice after successful replacement
2023-07-12 11:19:35 +02:00
Karol Manijak 9b0c610ced Automatic migration path from Products to Product Collection - step 1 - automatic migration (https://github.com/woocommerce/woocommerce-blocks/pull/10115)
* Foundation of the Products block replacement with Product Collection

* Provide logic to replace Products with Product Collection

* Make sure the blocks can be replaced

* Add types and refactor replacement a bit

* Fix the query attributes transform

* Add upgrade Notice to the Product Collection block

* Force upgrade notice to be displayed at the top of the Inspector Controls

* Externalise migration code so it can be reused in both ways

* Add util to get block IDs byt its name

* Add a way to revert the Product Collection blocks to Products

* Move the subscription to another place where it's triggered only once

* Add default values

* Remove attributes from Products block if they're not used to avoid incorrect query

* WIP logic of unseen/seen/reverted notice

* Change the state reading

* Revert changes regarding notice displaying logic

* Change the logc of firing replacement and bail early if there's no core/query blocks

* Add todos

* Implement inner blocks migration

* Implement the revert transformation of inner blocks

* Refactor types

* Add layout transformation from Products to Product Collection

* Add layout migration from Product Collection to Products

* Disable migration by default

* Simplify some parts of code

* Remove additional keyword from Product Collection to move it to another PR

* Adjust the logic to introduce the first step: conversion from Products to Product Collection

* Disable automatic migration
2023-07-12 10:01:36 +02:00
Luigi Teschio 98a61d3a4d Enable declaration-block-no-duplicate-properties stylelint rule (https://github.com/woocommerce/woocommerce-blocks/pull/10163) 2023-07-11 13:03:05 +00:00
Karol Manijak d7d550f983 Product Collection - check the value before consuming it to avoid frontend warning (https://github.com/woocommerce/woocommerce-blocks/pull/10162) 2023-07-11 14:40:15 +02:00
Luigi Teschio 45d994d47f Revert "Fix image over content (https://github.com/woocommerce/woocommerce-blocks/pull/10092)" (https://github.com/woocommerce/woocommerce-blocks/pull/10160)
This reverts commit b82c0de69d.
2023-07-11 12:16:12 +00:00
DAnn2012 edd3588ef2 Fix minimum required PHP version in readme.txt file (https://github.com/woocommerce/woocommerce-blocks/pull/10085) 2023-07-11 14:04:57 +02:00
Niels Lange 73f1ebf605 Return null or object for ImageAttachmentSchema response (https://github.com/woocommerce/woocommerce-blocks/pull/9962)
* Return null or object for ImageAttachmentSchema response

* Adjust docblock

* Update unit tests for ImageAttachmentSchema
2023-07-11 13:43:58 +02:00
Karol Manijak c55343b736 Product Collection - refactor inspector controls props (https://github.com/woocommerce/woocommerce-blocks/pull/10154)
* Refactor Columns Control inspector controls in Product Collection

* Refactor Order By inspector controls in Product Collection

* Reorder imports in Product Collection Inspector Controls

* Refactor On Sale inspector controls in Product Collection

* Refactor Stock Status inspector controls in Product Collection

* Refactor Keyword inspector controls in Product Collection

* Unify interface of query controlling Inspector Controls

* Unify interfaces of Inspector Controls that modify Query in Product Collection

* Unify other Query modifying Controls

* Simplify types
2023-07-11 13:05:49 +02:00
Manish Menaria d4c3d43f9d Product Collection - Add more E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/10090)
* Add E2E tests for category-based product filtering

This commit refactors the product filtering in the product collection E2E tests and adds the ability to filter products based on their category.

Changes:
1. The method `setHandpickedProducts` was renamed to `setFilterComboboxValue` to reflect the fact that it's now used for more than just handpicked products. This method is now used to set the values of different filters.
2. The `addFilter` method was extended to support the 'Show Taxonomies' filter. It also includes a delay to ensure the correct rendering of the UI before further interactions.
3. A new test was added for filtering products based on their category using the 'Show Taxonomies' filter.
4. The tests for filtering products by handpicked selection and keyword were updated to use the new `setFilterComboboxValue` method.

These changes improve the robustness of the E2E tests and increase their coverage by including category-based filtering.

* Add product attribute filters to end-to-end tests

- A new test case has been added in the `product-collection.block_theme.spec.ts` to test the functionality of filtering products based on their attributes like color and size. This is done using the `addFilter` and `setProductAttribute` methods.

- Additionally, the `addFilter` method in `product-collection.page.ts` has been updated to include the 'Show Product Attributes' filter.

- A new method `setProductAttribute` has been introduced to set the attribute value which will trigger the filter action.

These updates enhance the test coverage by verifying the functionality of product attribute filters in the product collection.

* Add responsiveness test for product collection block

This commit introduces a new end-to-end test to ensure that the product collection block responds correctly to changes in screen size.

The new test in `product-collection.block_theme.spec.ts` verifies that the number of product columns adjusts as expected for different viewport sizes. In the initial viewport size, the width of a product should be less than the parent width as multiple columns are expected. When the viewport size is reduced, the product width should be approximately equal to the parent width, indicating a single column layout.

These changes provide more robust testing of the product collection block's responsiveness, helping to ensure a consistent user experience across different device sizes.

* Refactor product assertions and add setViewportSize method in ProductCollection tests

This commit refactors the Product Collection tests to enhance test readability and consistency. It switches the product count checks from `productImages` to `products` which is more semantically correct.

Additionally, a new method `setViewportSize` has been added in the `ProductCollectionPage` class for adjusting the viewport size in the tests.

- Changed product count assertions to use `products` instead of `productImages`
- Added `setViewportSize` method to `ProductCollectionPage`
- Updated existing tests to use the newly added `setViewportSize` method

* Add test case for product filtering based on stock status in Product Collection tests

This commit adds a new test case in the Product Collection suite to test product filtering based on their stock status. The test case checks if the filter for 'Out of stock' status works correctly.

Note: This test case is currently commented out because there are no products with 'Out of stock' status in the test data. The assertions will need to be uncommented once the test data includes 'Out of stock' products.

* Add new test case for toolbar settings

This commit does two main things:

1) Adds a new test case under 'Toolbar settings' to test 'Items per page', 'offset' & 'max page to show' settings in the product collection block.

2) It extends the ProductCollectionPage class to add methods for setting display settings and for handling pagination. It also defines a new 'pagination' locator to find the pagination navigation on the page.

This update will allow us to more effectively test the behavior of the product collection block when dealing with large collections and pagination. Note: the 'Product can be filtered based on stock status' test has been marked as skipped until there are products with 'Out of stock' status in the test data.

* Refactor e2e test files for Product Collection

Changes in `product-collection.block_theme.spec.ts`:
- Marked the test 'Products can be filtered based on category' as a 'fixme'. This test is currently failing due to a bug in the product collection block.

Changes in `product-collection.page.ts`:
- Reorganized constant block data into a more extensive set of selectors.
- Introduced a new method `locateSidebarSettings` to locate the sidebar settings region, improving readability and reusability.
- Used the new method `locateSidebarSettings` in various places where settings values are being set.
- Refactored other methods to better locate elements based on the reorganized selectors.
- Adjusted the product-related locators to rely on these newly defined selectors.

* Fix: Frontend Category Filtering in Product Collection Block (https://github.com/woocommerce/woocommerce-blocks/pull/10132)

* Fix: Product collection - Product category filter isn't working on frontend

* Remove fixme from test

* Refactor variables names
2023-07-11 16:05:29 +05:30
Alexandre Lara 3f97a61a38 Update experimental flags 2023-07-10 11:50:05 -03:00
Alexandre Lara 052d21259b Add php experimental flag for Product Gallery block (https://github.com/woocommerce/woocommerce-blocks/pull/10141) 2023-07-10 11:40:12 -03:00
Karol Manijak fd378be6eb Add "grid" and "list" view switch for Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/10145)
* Add Display Layout controls to Product Collection

* Adjust the layout type name

* Add explicit display layout types

* Change the function name to setDisplayLayout so it's more explicit

* Pass only the necessary props to nested inspector controls

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-07-10 13:39:09 +02:00
Manish Menaria 708ed47a85 Enhance: Bring back user to 1st page when filters are changed (https://github.com/woocommerce/woocommerce-blocks/pull/9952)
* Add support for filter blocks

This commit updates the `ProductCollection` block implementation to add support for filter blocks, including the Price filter, Attributes filter, Rating filter, and In stock filter.

The changes include:

1. Adding a new property `$attributes_filter_query_args` to store the query arguments related to the filter by attributes block.

2. Adding a new method `add_support_for_filter_blocks()` to enable support for filter blocks. This method sets the necessary asset data to enable filtering and refreshes the page when a filter is applied.

3. Adding new methods to handle specific filter queries, including `get_filter_by_price_query()`, `get_filter_by_attributes_query()`, `get_filter_by_stock_status_query()`, and `get_filter_by_rating_query()`. These methods generate the respective queries based on the applied filters.

4. Refactoring the `get_final_query_args()` method to include the newly added filter queries using the `get_queries_by_applied_filters()` method.

These changes enhance the functionality of the `ProductCollection` block by allowing users to filter products based on price, attributes, rating, and stock status.

* Go to first page when filters are updated

* Enhance ProductCollection block to support filter blocks

This commit enhances the ProductCollection block to support various filter blocks such as Price filter block, Attributes filter block, Rating filter block, and In stock filter block.

The `build_query` method has been refactored into two separate methods: `build_frontend_query` and `get_final_frontend_query` to make the code more modular and readable. The `add_support_for_filter_blocks` method has been modified to support the generation of product IDs for filter blocks.

The method `update_rest_query` has been renamed to `update_rest_query_in_editor` for better clarity and understanding of its function. Similarly, `get_final_query_args` has been refactored to include the `$is_exclude_applied_filters` parameter which helps in generating product IDs for the filter blocks.

Moreover, the filter hook `pre_render_block` has been added to support the filtering of blocks before they are rendered.

This update will enhance the user experience by providing more filtering options in the ProductCollection block.

* Remove changes related to redirect to 1st page

* Go to first page when filters are updated

This commit refactors the changeUrl function in the `filters.ts` file. The purpose of this refactor is to remove the page number from the URL whenever filters are changed. This ensures that the user is always taken to the first page of results.

The commit includes the following changes:
- Added comments explaining the different page number formats in the URL.
- Updated the `newUrl` parameter by removing the page number using regular expressions.
- The page is then reloaded with the updated URL using `window.location.href`.

These changes improve the URL handling in the `changeUrl` function and enhance the user experience when interacting with filters.

* Optimize URL updates to prevent unnecessary page reloads

This commit optimizes the `changeUrl` utility function to prevent unnecessary page reloads.

Changes:
1. It checks if there are no query parameters in the URL and the URL ends with a '?'.
2. If these conditions are met, it removes the trailing '?' from the URL.

The reason for this change is that a '?' in the URL typically indicates that query parameters will follow. If there are no query parameters, the '?' is unnecessary and can cause the page to reload, which can negatively affect performance. Therefore, by removing the '?', we prevent this unnecessary page reload.

* Simplify trailing '?' removal in URL handling

This commit simplifies the removal of trailing '?' characters from URLs.
The previous implementation checked if there were any query parameters
before removing a trailing '?'.

However, upon review, it was determined that this check was unnecessary,
as a trailing '?' could be removed safely even if query parameters were
present, without any negative impact.

This change simplifies the code and prevents unnecessary computation
checking for the existence of query parameters.
2023-07-10 11:34:11 +05:30
Karol Manijak bf157c5996 Add additional Products (Beta) keyword to Product Collection so it appear next to Products in the inserter (https://github.com/woocommerce/woocommerce-blocks/pull/10112) 2023-07-07 15:50:29 +02:00
Thomas Roberts 074a502612 Regenerate composer.lock after release 2023-07-07 13:52:26 +01:00
Thomas Roberts a214bd6f6c Bump versions post-release. 10.7.0-dev 2023-07-07 12:14:02 +01:00
Thomas Roberts 516238df96 Bump versions, readme, changelog, and testing notes 2023-07-07 12:12:56 +01:00
Alba Rincón 3309fb309e Adjust `Banner` padding to improve mobile experience (https://github.com/woocommerce/woocommerce-blocks/pull/10107) 2023-07-07 11:49:47 +02:00
Patricia Hillebrandt 6ea6687144 Call wc_setup_product_data if the global product variable is not an instance of WC_Product. (https://github.com/woocommerce/woocommerce-blocks/pull/10128) 2023-07-07 11:40:46 +02:00
Alba Rincón 5a9b13295a Fix image to avoid overlapping on mobile devices (https://github.com/woocommerce/woocommerce-blocks/pull/10108) 2023-07-07 08:26:34 +02:00
Albert Juhé Lluveras cc0cf1a905 Load product-query stylesheet when rendering the Products block (https://github.com/woocommerce/woocommerce-blocks/pull/10109)
* Load product-query stylesheet when rendering the Products block

* Simplify code
2023-07-06 17:16:33 +02:00
Daniel Dudzic f6a4b3c143 Product Gallery: Add Large Image inner block (https://github.com/woocommerce/woocommerce-blocks/pull/10045)
* Product Gallery: Add an new block base code

* Product Gallery: Add experimental flag

* Product Gallery: Add Large Image block code

* Product Gallery Large Image: Remove unsed types

* Product Gallery: Move the block from registerBlockType to registerBlockSingleProductTemplate

* Product Gallery: Update icon

* Product Gallery: Add missing icon import

* Product Gallery Large Image: Add experimental mode check

* Product Gallery Large Image: Deregister unnecessary block settings

* Product Gallery Large Image: Add experimental flag to the Product Gallery Large Image and remove the icon override

* Product Gallery Large Image: Add zoom and correct styling

* Product Gallery Large Image: Remove commented out unnecessary code

* Product Gallery Large Image: Re-add the removed action after capturing the large image html

* Product Gallery Large Image: Update Large Image icon and description. Move metadata to the block.json file.
2023-07-06 15:08:39 +00:00
Albert Juhé Lluveras ad973e9b46 Fix Filter blocks e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/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
2023-07-06 16:39:19 +02:00
Alba Rincón 3ccfec1eee Fix `Product Rating` styles & alignment (https://github.com/woocommerce/woocommerce-blocks/pull/10097)
* Fix alignment not working on the editor

* Fix style regression on rating
2023-07-06 09:25:29 +02:00
Roy Ho 5c72cfdb4d Update/fixtures html (https://github.com/woocommerce/woocommerce-blocks/pull/10080)
* Remove data attributes from fixture for active filters

* Remove data attributes from fixture for filter by price

* Remove data attributes from fixture for filter by attribute

* Remove data attributes from fixture for filter by stock
2023-07-05 06:16:36 -07:00
Mike Jolley 599274e3d6 Fix cart and checkout conditionals when using a block based theme and templates (https://github.com/woocommerce/woocommerce-blocks/pull/10098)
* Update conditionals to deal with templates instead of cart/checkout page objects

* Include notice style in main entrypoint
2023-07-05 04:02:27 -07:00
Karol Manijak 283dfc652f Add feedback form to the Product Collection block (https://github.com/woocommerce/woocommerce-blocks/pull/10079)
* Add feedback form to the Product Collection block

* Change the airtable link to the new one related to Product Collection
2023-07-05 10:34:25 +02:00
Alba Rincón b82c0de69d Fix image over content (https://github.com/woocommerce/woocommerce-blocks/pull/10092) 2023-07-05 10:30:20 +02:00
Luigi Teschio 78d320bc47 Products block: Improve stability E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/10075) 2023-07-05 07:45:38 +00:00
Luigi Teschio 7ca65db5b0 Fix filter count display toggle (https://github.com/woocommerce/woocommerce-blocks/pull/10096)
* fix save method

* improve check

* Only display counts if showCounts is true

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-07-05 08:51:02 +02:00
Tarun Vijwani 6b8e4c38e0 Fix notice banner links for Legacy notices (https://github.com/woocommerce/woocommerce-blocks/pull/9996) 2023-07-04 04:16:26 -07:00
Albert Juhé Lluveras df3ff6793e Per block stylesheets (https://github.com/woocommerce/woocommerce-blocks/pull/9831)
* Clean up blank lines

* Update Webpack config

* Update PHP logic to load block styles

* Style fixes

* Style fixes (II)

* Style fixes (III)

* Style fixes (IV)

* Fix missing stylesheets in the Site Editor

* Fix wrong return values in some PHP method docs

* Fix missing ProductPrice stylesheet causing 404 in tests

* Fix missing ProductGallery stylesheet causing 404 in tests
2023-07-04 13:06:48 +02:00
Paulo Arromba 50aee9846b Render Checkout on Pay for Order for FSE themes with checkout flow templates (https://github.com/woocommerce/woocommerce-blocks/pull/10076)
* Render Checkout on Pay for Order for FSE themes with checkout flow templates.
Few typos corrected

* Render Checkout on Pay for Order for FSE themes with checkout flow templates.
Few typos corrected

* Backup and restore notices so they display on the pay page still

* Cache and restore notices during hydration to avoid breaking real notices on pages/shortcodes

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-07-04 11:34:24 +01:00
Alba Rincón 25a5737ec7 Fix image not rendering on the editor and empty styles (https://github.com/woocommerce/woocommerce-blocks/pull/10089) 2023-07-04 11:02:35 +02:00
Mike Jolley d6037a2efb Check for gutenberg_render_block_core_template_part (https://github.com/woocommerce/woocommerce-blocks/pull/10078) 2023-07-03 15:43:24 +01:00
Daniel Dudzic 3700c1c42d Product Gallery: Add an new block base code (https://github.com/woocommerce/woocommerce-blocks/pull/9937)
* Product Gallery: Add an new block base code

* Product Gallery: Add experimental flag

* Product Gallery: Move the block from registerBlockType to registerBlockSingleProductTemplate

* Product Gallery: Update icon
2023-07-03 14:21:31 +00:00
Roy Ho 48f7a9fdda Remove attributes data from save function for active filters (https://github.com/woocommerce/woocommerce-blocks/pull/10047) 2023-07-03 06:52:31 -07:00
Roy Ho f8cf9fe97a Remove attributes data from save function for filter by price (https://github.com/woocommerce/woocommerce-blocks/pull/10039) 2023-07-03 05:39:45 -07:00
Luigi Teschio aa48386834 Mark order confirmation template E2E test as flaky (https://github.com/woocommerce/woocommerce-blocks/pull/10041) 2023-07-03 12:26:47 +00:00
Niels Lange 0b01b8c60d Remove the word ‘beta’ from the compatibility notice (https://github.com/woocommerce/woocommerce-blocks/pull/10019)
* Remove the word ‘beta’ from the compatibility notice

* Optimise wording
2023-07-03 12:56:12 +02:00
Daniel Dudzic 8cacfce738 Rating: Fix TS error (https://github.com/woocommerce/woocommerce-blocks/pull/10001) 2023-07-03 10:50:06 +00:00
Alba Rincón b1bc51e3f0 Add new `Product Rating Stars` block (https://github.com/woocommerce/woocommerce-blocks/pull/10005)
* Add new `Product Rating Stars` block

* Make block experimental

* Fix dep
2023-07-03 11:48:50 +02:00
Alba Rincón fd86fd2e57 Add size settings to the `Product Image` block (https://github.com/woocommerce/woocommerce-blocks/pull/10034)
* Add height & width setting to the image sidebar settings

* Extract settings and add scale options

* Add width settings

* Apply settings on the frontend

* Style placeholder image

* Replace post featured image with product image

* Allow the width to be wider than container

* Fix image on top of other elements
2023-07-03 11:33:44 +02:00
Mike Jolley a6b8e0e542 Hide "collection from" text when a location has an incomplete address. (https://github.com/woocommerce/woocommerce-blocks/pull/9808)
* Hide "collection from" text when a location has an incomplete address.

* Fix display on confirmation page

* has_valid_pickup_location helper

* Missing isset

* Update test

* Fix pickup text assertion

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-07-03 10:10:18 +01:00
Hritik Chaudhary c1f2949a5d Converted product-tag and removed its proptypes (https://github.com/woocommerce/woocommerce-blocks/pull/9758)
* Converted product-tag and removed its proptypes

* addressed review comments

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-07-03 10:54:46 +02:00
Albert Juhé Lluveras 74e39331fb Cleanup code to lazy-load wc-settings in the Mini-Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/10042) 2023-07-03 09:26:31 +02:00
Albert Juhé Lluveras b5080e379d Prevent prefetched Cart payload causing wrong values with cached Mini-Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/10029)
* Prevent prefetched Cart payload causing wrong values with cached Mini-Cart block

* Pass Cart Totals object entirely

* Code cleanup

* Fixes and code cleanup

* Update Mini-Cart local storage when adding or removing products from cart
2023-06-30 16:05:27 +02:00
Luigi c5f3728060 Merge branch 'release/10.4.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-06-30 14:56:28 +02:00
github-actions[bot] 80fabe4991 Release: 10.4.5 (https://github.com/woocommerce/woocommerce-blocks/pull/10038)
* Product Rating block > Ensure the customer reviews text is linked to the relevant reviews (https://github.com/woocommerce/woocommerce-blocks/pull/9998)

* Fix reviews count not showing on Single Product page

* Fix css style

* Product Rating block: Ensure the Customer reviews text is linked to the relevant reviews when used within the Single Product Template. When used within the Single Product Block, the link directs the user to the product template. Additionally, clear out\ PHPCS warnings.

* remove unnecessary call to wc_get_star_rating_html

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Product Rating block: Fix reviews count not showing on Single Product page (https://github.com/woocommerce/woocommerce-blocks/pull/9995)

* Fix reviews count not showing on Single Product page

* Fix css style

* Single Product: Fix Product SKU not loading for different variations (https://github.com/woocommerce/woocommerce-blocks/pull/9990)

* Single Product: Fix incorrect add to cart form markup (https://github.com/woocommerce/woocommerce-blocks/pull/9986)

* Product Image Gallery block: Fix overflow when multiple images are used (https://github.com/woocommerce/woocommerce-blocks/pull/10013)

* Fix Product Image Gallery block overflow when multiple images are used

* Increase css specificity for the Product Image Gallery images

* Fix whitespace

* Fix style issue when using smaller images in the product image gallery

* Empty commit for release pull request

* update version

* add testing instructions

* update zip link

* Product Rating: append #reviews on the Single Product Block (https://github.com/woocommerce/woocommerce-blocks/pull/10040)

* Product Rating: append #reviews on the Single Product Block

* refactor after feedback

* fix version

* update zip link

* Single Product Block: avoid to register incompatibility blocks with the Single Product Block on the post/page editor (https://github.com/woocommerce/woocommerce-blocks/pull/10044)

* update testing instructions

* update zip link

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
2023-06-30 14:53:38 +02:00
Luigi Teschio cf8b73d79f Single Product Block: avoid to register incompatibility blocks with the Single Product Block on the post/page editor (https://github.com/woocommerce/woocommerce-blocks/pull/10044) 2023-06-30 14:06:12 +02:00
Luigi Teschio 6a35063dd1 Product Rating: append #reviews on the Single Product Block (https://github.com/woocommerce/woocommerce-blocks/pull/10040)
* Product Rating: append #reviews on the Single Product Block

* refactor after feedback
2023-06-30 11:31:14 +02:00
Luigi Teschio a06dd1d7c9 Add FrontendUtils class (https://github.com/woocommerce/woocommerce-blocks/pull/10033)
* Add FrontendUtils class

* fix conflicts

* use locator

* restore click usage

* fix util
2023-06-30 09:08:14 +02:00
Alexandre Lara 388605027b Product Image Gallery block: Fix overflow when multiple images are used (https://github.com/woocommerce/woocommerce-blocks/pull/10013)
* Fix Product Image Gallery block overflow when multiple images are used

* Increase css specificity for the Product Image Gallery images

* Fix whitespace

* Fix style issue when using smaller images in the product image gallery
2023-06-29 20:24:33 +02:00
Paulo Arromba f1df8fb975 Add Cart/Checkout/Order-Received Templates (https://github.com/woocommerce/woocommerce-blocks/pull/9301)
* WIP: dirty attempt to dry run Cart & Checkout templates

* Added Cart and Checkout to the template hierarchies

* Merge branch 'trunk' into poc/cart_and_checkout_fse_templates

* Updated cart & Checkout templates

* Order Received FSE template (https://github.com/woocommerce/woocommerce-blocks/pull/8937)

* Order Received template bootstrap

* typo

* WIP: new block

* add logic here

* Order received classic template

* reverted constants.ts

* Added the post title (buggy)

* Corrected page title

* Updated constants.ts

* Fixed template typo

* removed placeholder for order received block

* add order-received template description

* updated placeholder description

* Formatting fixes

* Template description.

* replaced hardcoded string with OrderReceivedTemplate::SLUG

---------

Co-authored-by: Luigi <gigitux@gmail.com>

* Code formatting (https://github.com/woocommerce/woocommerce-blocks/pull/8350)

* Code formatting

* page_template_hierarchy priority to 1 (https://github.com/woocommerce/woocommerce-blocks/pull/9323)

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Migrate Cart and Checkout Pages to the Template Editor when using a FSE theme (https://github.com/woocommerce/woocommerce-blocks/pull/9339)

* Introduce woocommerce_blocks_template_content hook

* Migrate cart and checkout page content to the template editor

* Add redirection from edit page to edit template

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Removed header and footer from checkout template. (https://github.com/woocommerce/woocommerce-blocks/pull/9378)

* Removed header and footer from checkout template.

* Removed header and footer from checkout template migration

* Permalink solution for the checkout endpoint/template (https://github.com/woocommerce/woocommerce-blocks/pull/9406)

* Checkout endpoint work

* Move setting field to util

* Include link to edit the template

* Remove todo

* Refactor checkout templates to share logic (https://github.com/woocommerce/woocommerce-blocks/pull/9411)

* Sync endpoints with pages (https://github.com/woocommerce/woocommerce-blocks/pull/9426)

* Switch to page syncing

* Update settings descriptions

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Migrate pages to templates once (https://github.com/woocommerce/woocommerce-blocks/pull/9488)

* Migrate content on init, once

* Skip migration if page does not exist

* Put back HTML for header and footer parts

* Fix page redirect due to wrong ID

* fix loading template part

* Removed unnecessary var

* update cart and checkout html templates

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Include a notice to redirect user to template editor (https://github.com/woocommerce/woocommerce-blocks/pull/9508)

* Template Placeholder Design for the Order Received Template (https://github.com/woocommerce/woocommerce-blocks/pull/9602)

* Load frontend styles in editor iframe

* Update placeholder to include skeleton and updated icons

* Update classic template configs

* 1px border for .wp-block-woocommerce-classic-template__placeholder-copy

* Show copy on focus

* Sample data

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Add simplified header on checkout template (https://github.com/woocommerce/woocommerce-blocks/pull/9607)

* Added simplified header on checkout template

* Moved simplified header to template part

* updated constants.ts

* added template part to checkout.html

* Add missing translation

* frontpage_template_hierarchy no longer needed

* Allow plugin based template parts (https://github.com/woocommerce/woocommerce-blocks/pull/9667)

* Merge branch 'trunk' into add/9288_cart-checkout-order-received_fse_templates

* Synced templates on blockified folder

* Add blockified order-received.html

* removed WooCommerce prefix

* Refactor/rebrand order received template to order confirmation (https://github.com/woocommerce/woocommerce-blocks/pull/9734)

* rebrand order received to order confirmation

* updated descriptions for templates

* updated descriptions for order confirmation placeholder

* Resolve merge conflict

* Resolve merge conflicts

* Resolve more merge conflicts after rebase

* Fix formatting

* Use patterns for localisation (https://github.com/woocommerce/woocommerce-blocks/pull/9883)

* e2e tests for cart and checkout templates (https://github.com/woocommerce/woocommerce-blocks/pull/9939)

* Merge branch 'trunk' into poc/cart_and_checkout_fse_templates

* Merge branch 'trunk' into add/9288_cart-checkout-order-received_fse_templates

* Resolve merge conflicts

* Add e2e for permalink settings

* Test that templates exist

* Add test to check that templates can be edited

* Add tests to confirm templates can be edited

* Ensure cart has contents before running tests on frontend views

* Commend out problem test

* Make sure search has multiple results

* Remove useThrottle - bad rebase

* Revert changes to docs after rebase

* Revert function call for noReviewsPlaceholder

* Bad rebase

* Reverts

* Remove revertTemplate

* Spacing

* Wait for networkidle after navigation

* Always wait for network

* Use button roles in site editor

* More specific button locator

* Update option comparison

* Fix template content

* Disable failing tests

* Disable failing classic template tests

* Use enterEditMode

* More enterEditMode usage

* enterEditMode

* Use test.skip

* More robust selectors

* Alt iframe selector

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Skip flakey test

---------

Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-06-29 14:41:22 +01:00
Roy Ho 6d36b2547b Make filter by rating preview consistent with default settings (https://github.com/woocommerce/woocommerce-blocks/pull/10007)
* Make filter by rating preview consistent with default settings

* Remove unneeded classnames
2023-06-29 06:15:52 -07:00
Albert Juhé Lluveras 559f712e35 Avoid usage of __experimentalUseFocusOutside (https://github.com/woocommerce/woocommerce-blocks/pull/10017)
* Avoid usage of __experimentalUseFocusOutside

* Remove unnecessary fix in QuantitySelector

* Add explanatory comment
2023-06-28 14:43:03 +02:00
Alba Rincón 6de8172053 Use the single product block on the Hero Product pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9935)
* Use the single product block on the Hero Product pattern

* Use the add to cart button block

* Use featured image and fix alignment
2023-06-28 14:34:51 +02:00
Thomas Roberts d76fa0a6cc Prevent saved payment methods showing if their main method `canPay` function returns `false` (https://github.com/woocommerce/woocommerce-blocks/pull/9917)
* Change type of payment requirements to string[]

* Add CanMakePaymentArgumentCart type and update CanMakePaymentArgument

* Add getCanMakePaymentArg function to get the arg, allows reusability

* Check saved methods gateway's to see if they can make payment

* Make canMakePaymentArg a dependency of the useMemo

* Remove await from sync function call

* Update variable names to better reflect what they store

* Add tests to ensure saved payment methods don't show if canPay is false

* Rename save-payment-method-options to tsx

* Update saved payment method options to TS

* Fix TS error in saved-payment-method-options test
2023-06-28 01:43:38 -07:00
Daniel Dudzic 254c7e8086 Product Rating: Remove empty markup if no ratings are present (https://github.com/woocommerce/woocommerce-blocks/pull/9822)
* Product Rating: Remove empty markup if no real or mocked ratings are present

* Fix TS errors

* Remove unrelated TS fixes
2023-06-27 19:14:47 +00:00
Daniel Dudzic a2d09319a7 Single Product: Fix Product SKU not loading for different variations (https://github.com/woocommerce/woocommerce-blocks/pull/9990) 2023-06-27 20:29:54 +02:00
Luigi Teschio 0441e10623 Single Product Template: fix compatibility layer logic when the blocks aren't wrapped in a group block (https://github.com/woocommerce/woocommerce-blocks/pull/9982) 2023-06-27 18:16:18 +02:00
Patricia Hillebrandt ff04f46ed0 Remove opinionated style for the price list in grouped products from the Add to Cart with Options block. (https://github.com/woocommerce/woocommerce-blocks/pull/9988) 2023-06-27 16:34:06 +02:00
Patricia Hillebrandt 8510615169 Product Rating block > Ensure the customer reviews text is linked to the relevant reviews (https://github.com/woocommerce/woocommerce-blocks/pull/9998)
* Fix reviews count not showing on Single Product page

* Fix css style

* Product Rating block: Ensure the Customer reviews text is linked to the relevant reviews when used within the Single Product Template. When used within the Single Product Block, the link directs the user to the product template. Additionally, clear out\ PHPCS warnings.

* remove unnecessary call to wc_get_star_rating_html

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-06-27 14:50:58 +02:00
Daniel Dudzic 35f73b4130 Single Product: Fix incorrect add to cart form markup (https://github.com/woocommerce/woocommerce-blocks/pull/9986) 2023-06-27 12:20:56 +00:00
Alexandre Lara 00725124b8 Product Rating block: Fix reviews count not showing on Single Product page (https://github.com/woocommerce/woocommerce-blocks/pull/9995)
* Fix reviews count not showing on Single Product page

* Fix css style
2023-06-27 07:50:48 -03:00
Siddharth Thevaril 09439560b2 move to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/9801)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-06-27 12:48:26 +02:00
Tung Du f364aa41fb Product Image: use WC Core function to render image (https://github.com/woocommerce/woocommerce-blocks/pull/9984) 2023-06-27 17:31:19 +07:00
David Arenas 5a3f6e2e2e Update the Interactivity API files to include latest changes (https://github.com/woocommerce/woocommerce-blocks/pull/9924)
* Update Interactivity API JS files

* Disable TS checks in the Interactivity API for now

* Add new SSR files

* Replace wp_ prefixes with wc_ ones

* Replace wp- prefix with wc-

* Replace guternberg_ prefix with woocommerce_

* Remove file comments from Gutenberg

* Rename files with `wp` prefix

* Fix code to load Interactivity API php files

* Remove TODO comments

* Replace @wordpress with @woocommerce

* Update Webpack configuration

* Fix directive prefix

* Remove interactivity folder from tsconfig exclude

* Add client-side navigation meta tag code

* Remove unneeded blocks.php file

* Fix store tag id

* Register Interactivity API runtime script

* Fix Interactivity API runtime registering

* Remove all files related to directive processing in PHP

* Move json_encode to Store's render method
2023-06-27 12:22:12 +02:00
Luigi Teschio 1a77ce0da4 Fix Products block tests (https://github.com/woocommerce/woocommerce-blocks/pull/9951)
* fix Products block test

* test now

* fix test

* improve E2E test

* restore pw configuration

* change order

* remove timeout

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-06-27 12:01:38 +02:00
Alexandre Lara 96e9b14cf6 Update the release testing notes for release 10.2.4 2023-06-26 17:32:45 -03:00
Alba Rincón f8a13d6afb Add new `Product collection banner` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9953)
* Add new `Product collection banner` pattern

* Hard code black color

* Add new image

* Update pattern image
2023-06-26 15:01:19 +02:00
Luigi Teschio 5ee166c983 Single Product Block: update testing instructions about notice (https://github.com/woocommerce/woocommerce-blocks/pull/9955) 2023-06-26 09:17:54 +02:00
github-actions[bot] ee8cfdc304 Release: 10.4.4 (https://github.com/woocommerce/woocommerce-blocks/pull/9973)
* Empty commit for release pull request

* Add back filter blocks frontend scripts (https://github.com/woocommerce/woocommerce-blocks/pull/9954)

* Update changelog and bump version to 10.4.4

* Add testing notes for 10.4.4 release

* Update testing notes for release 10.4.4

* Replace Automated tests badge with Unit and E2E tests badge

* Wait for cart to be removed when emptied (https://github.com/woocommerce/woocommerce-blocks/pull/9829)

* Temporarily skip PHP Unit Tests for PHP 8.1 and 8.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9859)

* Allow failure of the PHP Unit Tests

* Limit the PHP versions to 7.4 and 8.0 to run unit tests

* Don't allow failing fast

* Add a comment explaining the skipped part

* Cancel jobs later

* Cancel all the steps in workflow based on the same condition

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-06-23 15:30:05 -03:00
Alexandre Lara 273a6b4fa6 Update changelog and testing notes for 10.4.4 release 2023-06-23 12:24:59 -03:00
Alba Rincón 38cbf3af74 Add new `Small discount banner with image` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9947)
* Add new `Small discount banner with image` pattern

* Rename and improve mobile view
2023-06-23 15:22:52 +02:00
Patricia Hillebrandt c70c13c9a8 Single Product Block > Ensure the Product Summary and Title are always rendered with the correct context independent of their position (https://github.com/woocommerce/woocommerce-blocks/pull/9968)
* Ensure the Product Summary and Product Title blocks are always rendered independent of their position in the editor.

* Update docblock with note informing where the global post variable is restored for the post title and excerpt blocks.
2023-06-23 12:27:29 +02:00
Alba Rincón 9368060d79 Add new `Discount banner with image` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9957)
* Add new `Discount banner with image` pattern

* Improve mobile view

* Increase size
2023-06-23 11:33:41 +02:00
Alba Rincón c0ddfa68d8 Update rating filter test to match the new logic (https://github.com/woocommerce/woocommerce-blocks/pull/9974) 2023-06-23 11:18:47 +02:00
Luigi Teschio b31d6cf23c Update testing instruction for woocommerce/woocommerce-blocks#9573 (https://github.com/woocommerce/woocommerce-blocks/pull/9965)
* Adjust docblock

* update testing instructions for 9573 PR

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-06-23 09:15:15 +02:00
Hsing-yu Flowers 4e9ddb5206 Add order number to checkout schema (https://github.com/woocommerce/woocommerce-blocks/pull/9927)
* Add order number to checkout schema

* Update description
2023-06-22 13:06:12 -07:00
Alexandre Lara e5c8002d55 Add changelog and testing notes for 10.2.4 release 2023-06-22 15:17:03 -03:00
Alexandre Lara ea147019ad Fix testing steps version number 2023-06-22 15:17:03 -03:00
Albert Juhé Lluveras 9283b6c48b Add back filter blocks frontend scripts (https://github.com/woocommerce/woocommerce-blocks/pull/9954) 2023-06-22 16:09:37 +02:00
Roy Ho aff69cda89 Add/attributes filter count display toggle (https://github.com/woocommerce/woocommerce-blocks/pull/9833)
* Default show product counts to false for filter by attributes block

* Default show product counts to false for filter by stock block

* Default show product counts to false for filter by rating block

* Refactor deprecation

* Refactor deprecation

* Refactor deprecation
2023-06-22 06:38:28 -07:00
Roy Ho a81a8b830d Allow customer account block to center align (https://github.com/woocommerce/woocommerce-blocks/pull/9750)
* Allow customer account block to center align

* Convert to using Flexbox

* Use mixins to DRY

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-06-22 05:41:06 -07:00
Alba Rincón ce253c24ec Add new `Discount banner` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9936)
* Add new `Discount banner` pattern

* Add shop link

* Fix copy

* Fix colors
2023-06-22 12:32:53 +02:00
Manish Menaria 697a6d0e49 Product Collection: Make it compatible with filter blocks (https://github.com/woocommerce/woocommerce-blocks/pull/9928)
* Add support for filter blocks

This commit updates the `ProductCollection` block implementation to add support for filter blocks, including the Price filter, Attributes filter, Rating filter, and In stock filter.

The changes include:

1. Adding a new property `$attributes_filter_query_args` to store the query arguments related to the filter by attributes block.

2. Adding a new method `add_support_for_filter_blocks()` to enable support for filter blocks. This method sets the necessary asset data to enable filtering and refreshes the page when a filter is applied.

3. Adding new methods to handle specific filter queries, including `get_filter_by_price_query()`, `get_filter_by_attributes_query()`, `get_filter_by_stock_status_query()`, and `get_filter_by_rating_query()`. These methods generate the respective queries based on the applied filters.

4. Refactoring the `get_final_query_args()` method to include the newly added filter queries using the `get_queries_by_applied_filters()` method.

These changes enhance the functionality of the `ProductCollection` block by allowing users to filter products based on price, attributes, rating, and stock status.

* Go to first page when filters are updated

* Enhance ProductCollection block to support filter blocks

This commit enhances the ProductCollection block to support various filter blocks such as Price filter block, Attributes filter block, Rating filter block, and In stock filter block.

The `build_query` method has been refactored into two separate methods: `build_frontend_query` and `get_final_frontend_query` to make the code more modular and readable. The `add_support_for_filter_blocks` method has been modified to support the generation of product IDs for filter blocks.

The method `update_rest_query` has been renamed to `update_rest_query_in_editor` for better clarity and understanding of its function. Similarly, `get_final_query_args` has been refactored to include the `$is_exclude_applied_filters` parameter which helps in generating product IDs for the filter blocks.

Moreover, the filter hook `pre_render_block` has been added to support the filtering of blocks before they are rendered.

This update will enhance the user experience by providing more filtering options in the ProductCollection block.

* Remove changes related to redirect to 1st page
2023-06-22 15:27:27 +05:30
Alba Rincón db45e85bc3 Shop by Price pattern: add price filters to buttons (https://github.com/woocommerce/woocommerce-blocks/pull/9915)
* Add price filters to buttons

* Add links to the titles

* Update title for the first blog
2023-06-22 08:04:54 +02:00
Hritik Chaudhary 73c7312969 removed proptypes from feedback-promt (https://github.com/woocommerce/woocommerce-blocks/pull/9838) 2023-06-21 18:02:19 +02:00
Karol Manijak ad0509f767 Adjust the Dependabot GitHub username (https://github.com/woocommerce/woocommerce-blocks/pull/9931) 2023-06-21 16:53:00 +02:00
Daniel W. Robert 9ec3779439 Remove caret range specifier from fast-xml-parser. (https://github.com/woocommerce/woocommerce-blocks/pull/9894) 2023-06-21 09:18:10 -04:00
Luigi a53e623f73 bump version 2023-06-21 14:36:02 +02:00
Luigi ee3eabe5d0 Merge branch 'release/10.5.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-06-21 14:34:39 +02:00
DAnn2012 2de1129e9d Removed the second keyword (which previously denoted the text domain) from two blocks (https://github.com/woocommerce/woocommerce-blocks/pull/9816)
* Update block.json

* Update block.json
2023-06-21 14:30:57 +02:00
Luigi Teschio 0cd274d1cf Update docs/internal-developers/testing/releases/1050.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-06-21 14:27:54 +02:00
Luigi Teschio 31a2fd77dd CI: Ensure that the CI returns an error if PHP code doesn't respect phpcs configuration (https://github.com/woocommerce/woocommerce-blocks/pull/9920) 2023-06-21 12:51:30 +02:00
Brian 249dcb74f2 Consistent Pattern Titles (https://github.com/woocommerce/woocommerce-blocks/pull/9814)
* Update featured-category-cover-image.php

* Update featured-category-focus.php

* Update featured-category-triple.php

* Update featured-products-5-cols.php

* Update filters.php

* Update footer-large-dark.php

* Update footer-large.php

* Update footer-simple-dark.php

* Update footer-simple.php

* Update footer-simple-menu-and-cart.php

* Update footer-with-2-menus-dark.php

* Update footer-with-2-menus.php

* Update footer-with-3-menus.php

* Update header-centered-search-pattern.php

* Update header-essential-dark.php

* Update header-essential.php

* Update header-large-dark.php

* Update header-large.php

* Update header-minimal.php

* Update hero-product-3-split.php

* Update hero-product-chessboard.php

* Update hero-product-split.php

* Update just-arrived-full-hero.php

* Update no-products-found.php

* Update product-collections-featured-collection.php

* Update product-collections-featured-collections.php

* Update product-collections-newest-arrivals.php

* Update product-details-listing.php

* Update product-details-pattern.php

* Update product-featured-2-columns.php

* Update product-hero-2-col-2-row.php

* Update product-hero.php

* Update product-listing-with-gallery-and-description.php

* Update product-query-1-1-image-4-column-products-row.php

* Update product-query-3-column-product-row.php

* Update product-query-4-column-product-row.php

* Update product-query-large-image-product-gallery.php

* Update product-query-minimal-5-column-products-row.php

* Update product-query-minimal-product-list.php

* Update product-query-product-gallery.php

* Update product-query-product-list-with-1-1-images.php

* Update product-query-product-list-with-full-product-description.php

* Update product-search-form.php

* Update shop-by-price.php

* Update store-info-alt-image-and-text.php

* Update testimonials-3-columns.php

* Update testimonials-single.php

* Create readme.md

* Update featured-category-cover-image.php

* Update featured-category-focus.php

* Update featured-category-triple.php

* Update featured-products-5-cols.php

* Update filters.php

* Update footer-large-dark.php

* Update footer-large.php

* Update testimonials-single.php

* Update testimonials-3-columns.php

* Update store-info-alt-image-and-text.php

* Update shop-by-price.php

* Update readme.md

* Update product-search-form.php

* Update product-query-product-list-with-full-product-description.php

* Update product-query-product-list-with-1-1-images.php

* Update product-query-product-gallery.php

* Update product-query-minimal-product-list.php

* Update footer-simple-dark.php

* Update footer-simple-menu-and-cart.php

* Update footer-simple.php

* Update footer-with-2-menus-dark.php

* Update footer-with-2-menus.php

* Update footer-with-3-menus.php

* Update product-query-minimal-5-column-products-row.php

* Update product-query-large-image-product-gallery.php

* Update product-query-4-column-product-row.php

* Update product-query-3-column-product-row.php

* Update product-query-1-1-image-4-column-products-row.php

* Update product-listing-with-gallery-and-description.php

* Update product-hero.php

* Update product-hero-2-col-2-row.php

* Update product-featured-2-columns.php

* Update product-details-pattern.php

* Update product-details-listing.php

* Update product-collections-newest-arrivals.php

* Update product-collections-featured-collections.php

* Update product-collections-featured-collection.php

* Update no-products-found.php

* Update just-arrived-full-hero.php

* Update hero-product-split.php

* Update hero-product-chessboard.php

* Update hero-product-3-split.php

* Update header-minimal.php

* Update header-large.php

* Update header-large-dark.php

* Update header-essential.php

* Update header-essential-dark.php

* Update header-centered-search-pattern.php

* Update readme.md

* Update and rename readme.md to README.md

* Update patterns/README.md

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-06-21 09:50:12 +02:00
Luigi 2731b73954 Merge branch 'release/10.4.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-06-21 08:45:38 +02:00
github-actions[bot] 28535000db Release: 10.4.3 (https://github.com/woocommerce/woocommerce-blocks/pull/9919)
* Empty commit for release pull request

* Update Hero Product 3-split pattern image

* Update Banner Pattern To Replace Unsplash Image (https://github.com/woocommerce/woocommerce-blocks/pull/9760)

* Update Banner to replace Unsplash image.

Replaces the Unsplash image with a CCO licensed image from Pxhere. Also
updates the CTA button to link to the Shop page, by default.

* Remove extra padding from top of test column.

Vertical alignment was off on the text column due to 60px of top
padding. This aligns everythign, as expected.

* Update Chessboard pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9761)

* Updathe the Hero Product Split (https://github.com/woocommerce/woocommerce-blocks/pull/9762)

* Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9763)

* Update Images for the Product Details Patterns (https://github.com/woocommerce/woocommerce-blocks/pull/9764)

* Update image for the Product Hero pattern.

Replace the Unsplash image with a CCO licensed image from Pxhere.

* Update images for Prod List Gallery Desc pattern

Replace the Unsplash image with a CCO licensed image from Pxhere for the
Product Listing with Gallery and Description pattern.

* Remove unneeded Unsplash images.

* Update copy for Prod Listing Gallery Desc pattern.

* Optimize new image exports.

* Update image for the Product Listing pattern.

Replace the Unsplash image with a CCO licensed image from Pxhere.

* Update images for Product Details pattern.

Replace the Unsplash images with CCO licensed images from Pxhere.

* Remove unneeded Unsplash image.

* Use Relative URLs for Images in the Product Listing Pattern

This commit replaces hardcoded URLs with dynamic ones for image placeholders in the `product-listing-with-gallery-and-description.php` pattern file.

- The `plugins_url()` function is now used to generate URLs, which correctly points to the images folder within the WooCommerce Blocks plugin directory. This approach provides better flexibility and portability since it doesn't rely on a specific domain or path. The `esc_url()` function is used to ensure the URL is safe to use in the HTML context.

- The change is made for a total of four images in the pattern.

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

* Update/patterns featured category product collection (https://github.com/woocommerce/woocommerce-blocks/pull/9765)

* Update image for featured category focus pattern

* Update image for featured category cover image pattern

* Update images for featured category triple pattern

* Change to wide width

* Update links to buttons

* Fix typo in hex color value.

There was an extra `f` in the hex color value, causing the text to
unexpectedly render black.

---------

Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>

* Update/collection pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9766)

* Update featured collections images

* Add shop link to shop by price pattern

* Update hero product pattern title (https://github.com/woocommerce/woocommerce-blocks/pull/9769)

* Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9770)

* Add 10.4.2 changelog in readme.txt

* Update version number to 10.4.2

* Add testing instructions for 10.4.2

* Add 9769 PR testing steps

* WooCommerce Classic Template block: Fix error on clearing customizations on Woo Templates (https://github.com/woocommerce/woocommerce-blocks/pull/9759)

* Fix Classic Template block error on clearing customizations on template

* Add link to issue in JS Doc

* Change the way of debug check of tests-mysql container (https://github.com/woocommerce/woocommerce-blocks/pull/9794)

* Add alt text to images used in patterns describing their purpose (https://github.com/woocommerce/woocommerce-blocks/pull/9788)

* Add alt text to images used in patterns describing their purpose

* Replace 1/3 notation with 1 out of 3, so it's better handled byt screen readers

* Update testing instructions to include 9759 PR

* Update zip to include 9759 PR

* Remove 9759 PR from testing instructions

* Mini Cart Block: show the total price, including tax, according to the option (https://github.com/woocommerce/woocommerce-blocks/pull/9878)

* Mini Cart Block: show the total price, including tax, according to the option

* Fix tests in PR 9878 (https://github.com/woocommerce/woocommerce-blocks/pull/9880)

* add unit test

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>

* Mini-Cart: don't include shipping price (https://github.com/woocommerce/woocommerce-blocks/pull/9914)

* Products Block: fix grid view with Gutenberg 16 (https://github.com/woocommerce/woocommerce-blocks/pull/9916)

* Revert "fix products block layout on gutenberg 16 (https://github.com/woocommerce/woocommerce-blocks/pull/9886)"

This reverts commit 53665a5bde.

* add post_template_has_support_for_grid_view setting

* add testing instructions

* bump version

* update zip link

* Empty commit for release pull request

* update link

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Roy Ho <roykho77@gmail.com>
Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-06-21 08:38:10 +02:00
Daniel Dudzic d981395148 Mini Cart: Hide template part from the block inserter. Closes woocommerce/woocommerce-blocks#9753 (https://github.com/woocommerce/woocommerce-blocks/pull/9906) 2023-06-20 22:28:16 +02:00
Albert Juhé Lluveras ddacb581bb Remove unnecessary white space from Testimonials 3 Columns pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9786) 2023-06-20 17:44:02 +02:00
Chris Jayden d9b87d5a56 docs: add link to batching cart item (https://github.com/woocommerce/woocommerce-blocks/pull/9776) 2023-06-20 08:41:16 -07:00
Karol Manijak bc2bcf2ec4 Fix PHP CS warnings (https://github.com/woocommerce/woocommerce-blocks/pull/9857) 2023-06-20 16:19:43 +02:00
Luigi b19213cabd Merge branch 'release/10.5.0' of https://github.com/woocommerce/woocommerce-blocks into release/10.5.0 2023-06-20 16:14:53 +02:00
Luigi 2349af5216 update zip link 2023-06-20 16:14:39 +02:00
Luigi Teschio eb24313fb0 Products Block: fix grid view with Gutenberg 16 (https://github.com/woocommerce/woocommerce-blocks/pull/9916)
* Revert "fix products block layout on gutenberg 16 (https://github.com/woocommerce/woocommerce-blocks/pull/9886)"

This reverts commit 53665a5bde.

* add post_template_has_support_for_grid_view setting
2023-06-20 16:12:43 +02:00
Luigi Teschio e285dd0879 Products Block: fix grid view with Gutenberg 16 (https://github.com/woocommerce/woocommerce-blocks/pull/9916)
* Revert "fix products block layout on gutenberg 16 (https://github.com/woocommerce/woocommerce-blocks/pull/9886)"

This reverts commit 53665a5bde.

* add post_template_has_support_for_grid_view setting
2023-06-20 14:12:30 +00:00
Alba Rincón fe8330d2a8 `Featured Products 5-item grid` fix alignment (https://github.com/woocommerce/woocommerce-blocks/pull/9913)
* Styling and improvements

* Fix pattern alignment

---------

Co-authored-by: roykho <roykho77@gmail.com>
2023-06-20 15:49:43 +02:00
Roy Ho a5271fcbe3 Styling and improvements (https://github.com/woocommerce/woocommerce-blocks/pull/9893) 2023-06-20 06:09:12 -07:00
Roy Ho 93a43b791a Make use of product search (https://github.com/woocommerce/woocommerce-blocks/pull/9890) 2023-06-20 06:08:04 -07:00
Luigi Teschio e92393684c Update docs/internal-developers/testing/releases/1050.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-06-20 14:52:31 +02:00
Luigi Teschio 70cb05b991 Update docs/internal-developers/testing/releases/1050.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-06-20 14:52:23 +02:00
Luigi 50998bc9fa update testing instructions 2023-06-20 14:46:37 +02:00
Albert Juhé Lluveras 25f8137e9c Mini-Cart: don't include shipping price (https://github.com/woocommerce/woocommerce-blocks/pull/9914) 2023-06-20 14:45:30 +02:00
Albert Juhé Lluveras 99dd12e6c7 Mini-Cart: don't include shipping price (https://github.com/woocommerce/woocommerce-blocks/pull/9914) 2023-06-20 14:41:37 +02:00
Luigi 20be12a52c update zip link 2023-06-20 11:58:01 +02:00
Niels Lange e39cc21444 Reference Mini Cart drawer preview dynamically (https://github.com/woocommerce/woocommerce-blocks/pull/9912)
* Reference Mini Cart drawer preview dynamically

* Update assets/js/blocks/mini-cart/edit.tsx

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-06-20 11:56:36 +02:00
Niels Lange 532393fe07 Reference Mini Cart drawer preview dynamically (https://github.com/woocommerce/woocommerce-blocks/pull/9912)
* Reference Mini Cart drawer preview dynamically

* Update assets/js/blocks/mini-cart/edit.tsx

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-06-20 11:52:53 +02:00
Alba Rincón df5f1d21d1 Improve spacing and centering in responsive designs (https://github.com/woocommerce/woocommerce-blocks/pull/9877) 2023-06-20 10:30:51 +02:00
Luigi 08842ef392 update screenshot 2023-06-20 10:30:27 +02:00
Luigi 8b1cfe6c87 update testing instructions 2023-06-20 10:26:41 +02:00
Alba Rincón 5aa3779a62 Add shop link to the button (https://github.com/woocommerce/woocommerce-blocks/pull/9879) 2023-06-20 09:12:32 +02:00
Luigi 8f0d480f73 update testing instruction for woocommerce/woocommerce-blocks#9809 2023-06-20 09:12:05 +02:00
Luigi 6443868725 update zip link 2023-06-20 09:01:26 +02:00
Luigi 6b9c38dfc7 add woocommerce/woocommerce-blocks#9886 PR 2023-06-20 09:00:08 +02:00
Luigi Teschio b8d072b291 fix products block layout on gutenberg 16 (https://github.com/woocommerce/woocommerce-blocks/pull/9886) 2023-06-20 08:57:31 +02:00
Luigi Teschio 53665a5bde fix products block layout on gutenberg 16 (https://github.com/woocommerce/woocommerce-blocks/pull/9886) 2023-06-20 08:56:55 +02:00
Manish Menaria a6c1a2de52 Add E2E tests for Product Collection Block (https://github.com/woocommerce/woocommerce-blocks/pull/9825)
* Add E2E tests for Product Collection Block

This commit does the following changes:

1. Adjusts the .gitignore file to ignore the test-results and artifacts directories under all subdirectories named 'e2e-pw'.

2. Adds new E2E tests for the Product Collection block, specifically testing:
   - If the block renders correctly, including validating the number of product images, titles, prices, and 'Add to Cart' buttons.
   - If the sidebar settings correctly control the number of displayed columns.

3. Implements the 'ProductCollectionPage' class, providing methods to perform actions such as creating a new post, inserting a block, publishing a post, and locating various elements on the page.

4. Adjusts the directory structure for the E2E tests to improve organization and readability.

* Minor improvements

* Update E2E tests for Product Collection block sidebar settings

This commit updates the E2E tests for the sidebar settings of the Product Collection block. The changes include:

1. Refactoring the test assertions to use property accessors instead of method calls for the `ProductCollectionPage` class. This improves readability and consistency.

2. Updating the `ProductCollectionPage` class to initialize locators for editor and frontend elements separately. This allows easier differentiation between editor and frontend locators.

The test file `sidebar-settings.block_theme.spec.ts` has been deleted, as its functionality is now covered by the updated tests in `product-collection.block_theme.spec.ts`.

* Don't update package.json files

* Don't update gitignore file

* Add E2E test for order by control

This commit updates the E2E tests for the sidebar settings and order by control of the Product Collection block. The changes include:

1. Refactoring the test assertions and descriptions for improved readability and clarity.

2. Adding a new test case to verify the correct sorting of products by title in descending order.

3. Updating the `ProductCollectionPage` class to include a new method `setOrderBy()` to set the order by value in the order by control.

4. Adding a new method `waitForProductsToLoad()` in the `ProductCollectionPage` class to wait for the products to load in the block.

These changes ensure that the sidebar settings and order by control are functioning correctly in the Product Collection block.

* Minor improvements

* Add tests for "on sale" filter

* Add tests for Hand picked products filter

This commit updates the E2E tests for the handpicked products filter in the Product Collection block. The changes include:

1. Adding a new test case to verify that products can be filtered based on the selection in the handpicked products option.

2. Adding a new method `addFilter()` to the `ProductCollectionPage` class to select a filter option from the dropdown.

3. Adding a new method `setHandpickedProducts()` to the `ProductCollectionPage` class to set the handpicked products in the block settings.

These changes ensure that the handpicked products filter is functioning correctly in the Product Collection block.

* Verify that on sale filter works on frontend

Adding assertions to verify the count and presence of on-sale products in the frontend after publishing.

* Add tests for Keyword filter

This commit updates the E2E tests for the keyword filter in the Product Collection block. The changes include:

1. Adding assertions to verify that the products are correctly filtered based on the keyword entered.

2. Adding assertions to verify the filtered products in the frontend after publishing.

These changes ensure that the keyword filter in the Product Collection block is functioning correctly.

* Use fixture to setup product collection page

This commit refactors the E2E tests for the Product Collection block to improve test structure and readability. The changes include:

1. Refactoring the test structure using the `test.extend` function to define shared setup and teardown logic.

2. Moving the creation of the `ProductCollectionPage` instance to the shared setup logic.

3. Using the `pageObject` fixture in each test to access the `ProductCollectionPage` instance.

4. Removing duplicate code for creating the `ProductCollectionPage` instance.

These changes enhance the maintainability and readability of the E2E tests for the Product Collection block.
2023-06-20 10:56:12 +05:30
Thomas Roberts 3ebcd7f601 Add `CartEventContext` and dispatch events when pressing proceed to checkout button (https://github.com/woocommerce/woocommerce-blocks/pull/7809)
* Add CartEventsContext with onProceedToCheckout event

* Wrap Cart in CartEventsProvider

* Dispatch onProceedToCheckout event when button is pressed

* Update type of children on CartEventsProvider

* Add test for ProceedToCheckout block

* Add tests for CartEventProvider

* Remove superfluous div

* Fix incorrect nesting after rebase

* Wrap mini cart in CartEventsProvider

* Dispatch onProceedToCheckout event when clicking button in mini cart

* Add tests for mini cart onProceedToCheckout emitter

* Make observer fail so navigation isn't attempted

* Prevent console error on navigation

* Try preventing navigation in unit tests

* Try preventing navigation in unit tests

* Try preventing navigation in unit tests

* Try preventing navigation in unit tests

* Try preventing navigation in unit tests

* Try preventing navigation in unit tests

* Try preventing navigation in unit tests
2023-06-19 08:44:37 -07:00
Luigi 51bc46594d add woocommerce/woocommerce-blocks#9878 PR 2023-06-19 17:15:55 +02:00
Luigi Teschio b585355fda Mini Cart Block: show the total price, including tax, according to the option (https://github.com/woocommerce/woocommerce-blocks/pull/9878)
* Mini Cart Block: show the total price, including tax, according to the option

* Fix tests in PR 9878 (https://github.com/woocommerce/woocommerce-blocks/pull/9880)

* add unit test

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-06-19 17:14:51 +02:00
Luigi Teschio bc6dc106ab Mini Cart Block: show the total price, including tax, according to the option (https://github.com/woocommerce/woocommerce-blocks/pull/9878)
* Mini Cart Block: show the total price, including tax, according to the option

* Fix tests in PR 9878 (https://github.com/woocommerce/woocommerce-blocks/pull/9880)

* add unit test

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-06-19 17:14:35 +02:00
Luigi e190f46064 update zip file testing 2023-06-19 15:51:46 +02:00
Luigi edd3dd38da add woocommerce/woocommerce-blocks#9869 PR 2023-06-19 15:23:12 +02:00
Alexandre Lara 677d66f137 Fix PropType warning and error when adding All Reviews block to Editor (https://github.com/woocommerce/woocommerce-blocks/pull/9869) 2023-06-19 15:17:07 +02:00
Daniel Dudzic 8835140c41 Mini Cart: Fix un-strict comparisons (https://github.com/woocommerce/woocommerce-blocks/pull/9837) 2023-06-19 12:57:04 +02:00
Alexandre Lara 48696c6727 Fix PropType warning and error when adding All Reviews block to Editor (https://github.com/woocommerce/woocommerce-blocks/pull/9869) 2023-06-19 15:39:54 +05:30
Daniel Dudzic de425c9efb Mini Cart: Add Price, Icon and Product Count color settings (https://github.com/woocommerce/woocommerce-blocks/pull/9647)
* Mini Cart: Update color settings to include Price, Icon and Product Count.

* Fix color settings in the editor.

* Mini Cart: Add color settings for the Price, Icon and Product Count.

* Mini Cart: Remove unnecessary color settings.

* Remove unnecessary code comments.

* Update color settings labels.

* Add price color to the tax label.

* Add missing docs comment

* Fix TS errors

* Fix TS error

* Adjust type declaration

* Add TS error comments

* Change @ts-to-do to @ts-expect-error

---------

Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
2023-06-19 11:42:37 +02:00
Luigi 244cdf86e2 add testing instructions 2023-06-19 11:39:43 +02:00
Luigi 028d0a90ab bump version 2023-06-19 11:38:19 +02:00
Luigi 8758f586e4 add readme 2023-06-19 10:05:54 +02:00
Alexandre Lara 8a6e1cdb76 Adjust PropTypes definition and fix block error when store has no reviews (https://github.com/woocommerce/woocommerce-blocks/pull/9868) 2023-06-19 12:37:57 +05:30
Karol Manijak 115ccca4f9 Don't treat Dependabot as community contributor (https://github.com/woocommerce/woocommerce-blocks/pull/9254)
* Test commit

* Don't treat dependabot as a community

* Remove unwanted change

* Make the check for ignored usernames clearer
2023-06-19 08:49:59 +02:00
Manish Menaria eec844f447 Add Display Settings Toolbar to the Product Collection Block (https://github.com/woocommerce/woocommerce-blocks/pull/9747)
This commit introduces the 'Display Settings' toolbar for the 'Product Collection' block in the Gutenberg editor.
- A new component 'DisplaySettingsToolbar' is added in 'display-settings-toolbar.tsx'. It includes controls for changing the number of items per page, the offset, and the maximum number of pages to show in the block. The toolbar only shows up when the 'inherit' query attribute is set to false.
- The 'DisplaySettingsToolbar' component is then integrated into the main 'edit.tsx' file through 'ToolbarControls'.
- Styles have also been added to 'editor.scss' to ensure the popover content of the display settings toolbar has an appropriate minimum width.
2023-06-19 10:37:05 +05:30
Niels Lange d70481ed8c Update available-slot-fills.md 2023-06-18 20:08:05 +02:00
Brian 8dacf20cef Update Keywords for Customer Account Block in block.json (https://github.com/woocommerce/woocommerce-blocks/pull/9815)
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-06-18 19:42:08 +02:00
Alexandre Lara c5e8cc2256 Refactor: Convert with-transform-single-select-to-multiple-select.js to with-transform-single-select-to-multiple-select.tsx and replace propTypes with TypeScript definitions (https://github.com/woocommerce/woocommerce-blocks/pull/9798)
* Transform file from Javascript to Typescript

* Add SelectOption type and default value to selected prop
2023-06-16 16:24:12 -03:00
Alexandre Lara e5dd772c94 Convert Product On Sale block file from JS to TS (https://github.com/woocommerce/woocommerce-blocks/pull/9834) 2023-06-16 13:43:54 -03:00
Alexandre Lara ba47d5dc40 Refactor: Convert All Products block file from Javascript to Typescript and replace propTypes with TypeScript definitions (https://github.com/woocommerce/woocommerce-blocks/pull/9802)
* Convert All Products block from Javascript to Typescript

* Replace BlockAttributes type with local interface
2023-06-16 12:48:47 -03:00
Karol Manijak f12c35ffc2 Temporarily skip PHP Unit Tests for PHP 8.1 and 8.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9859)
* Allow failure of the PHP Unit Tests

* Limit the PHP versions to 7.4 and 8.0 to run unit tests

* Don't allow failing fast

* Add a comment explaining the skipped part

* Cancel jobs later

* Cancel all the steps in workflow based on the same condition
2023-06-16 14:16:19 +02:00
Niels Lange 0d94479bbe Update README.md 2023-06-16 13:59:30 +02:00
Mike Jolley 496fac8386 Performance: Cache script data in a transient for production builds (https://github.com/woocommerce/woocommerce-blocks/pull/9120)
* Cache script data in a transient for production builds

* Store as json

* Disable cache when script debug is on

* Disable in test environment

* Simplify caching structure

* Put back cache buster

* Fix update_script_data_cache

* Merge dependencies param always—do not cache it
2023-06-16 12:21:51 +01:00
Mike Jolley ee4e0fac18 Keep change button visible even if prefersCollection is true (https://github.com/woocommerce/woocommerce-blocks/pull/9809) 2023-06-16 12:21:19 +01:00
Mike Jolley 4d14426ecb Request 2.88.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9827) 2023-06-16 11:46:03 +01:00
Alba Rincón 8a67ae2f80 Convert `edit.js` to `edit.tsx` and replace `propTypes` with TypeScript definitions (https://github.com/woocommerce/woocommerce-blocks/pull/9823)
* Remove proptypes

* Refactor after review
2023-06-16 09:30:54 +02:00
Alba Rincón 2460a04abd Remove propTypes (https://github.com/woocommerce/woocommerce-blocks/pull/9824) 2023-06-15 16:21:02 +02:00
Alba Rincón e423c4fde9 Add a default attribute to the pattern if exists (https://github.com/woocommerce/woocommerce-blocks/pull/9812)
* Add a default attribute to the pattern if exists

* Use esc_attr instead of esc_html
2023-06-15 16:07:47 +02:00
Karol Manijak 1eebcd6750 Replace Automated tests badge with E2E and Unit tests badges (https://github.com/woocommerce/woocommerce-blocks/pull/9836) 2023-06-15 14:23:23 +02:00
Daniel Dudzic cc6a9eab48 Mini Cart: Fix icon render (https://github.com/woocommerce/woocommerce-blocks/pull/9828) 2023-06-14 18:42:56 +02:00
Mike Jolley c30c6afc53 Wait for cart to be removed when emptied (https://github.com/woocommerce/woocommerce-blocks/pull/9829) 2023-06-14 16:59:21 +01:00
Roy Ho 31138031f6 Convert grid-layout-control to use Typescript (https://github.com/woocommerce/woocommerce-blocks/pull/9811) 2023-06-14 07:07:28 -07:00
dependabot[bot] 4c012300c1 Bump mockery/mockery from 1.6.1 to 1.6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9796)
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.6.1...1.6.2)

---
updated-dependencies:
- dependency-name: mockery/mockery
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-14 15:05:10 +01:00
Roy Ho 6270c39de8 Convert inner-block-layout-context to typescript (https://github.com/woocommerce/woocommerce-blocks/pull/9799)
* Convert inner-block-layout-context to typescript

* Add isLoading context
2023-06-14 06:36:39 -07:00
Mike Jolley 524b95acbd Bump fast-xml-parser from 4.0.7 to 4.2.4 (https://github.com/woocommerce/woocommerce-blocks/pull/9818)
* Bump fast-xml-parser from 4.0.7 to 4.2.4

Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.0.7 to 4.2.4.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.0.7...v4.2.4)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update package lock

* Update package

* Revert other package lock changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-14 14:32:19 +01:00
github-actions[bot] 09e9fb9388 Release: 10.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9784)
* Empty commit for release pull request

* Update Hero Product 3-split pattern image

* Update Banner Pattern To Replace Unsplash Image (https://github.com/woocommerce/woocommerce-blocks/pull/9760)

* Update Banner to replace Unsplash image.

Replaces the Unsplash image with a CCO licensed image from Pxhere. Also
updates the CTA button to link to the Shop page, by default.

* Remove extra padding from top of test column.

Vertical alignment was off on the text column due to 60px of top
padding. This aligns everythign, as expected.

* Update Chessboard pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9761)

* Updathe the Hero Product Split (https://github.com/woocommerce/woocommerce-blocks/pull/9762)

* Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9763)

* Update Images for the Product Details Patterns (https://github.com/woocommerce/woocommerce-blocks/pull/9764)

* Update image for the Product Hero pattern.

Replace the Unsplash image with a CCO licensed image from Pxhere.

* Update images for Prod List Gallery Desc pattern

Replace the Unsplash image with a CCO licensed image from Pxhere for the
Product Listing with Gallery and Description pattern.

* Remove unneeded Unsplash images.

* Update copy for Prod Listing Gallery Desc pattern.

* Optimize new image exports.

* Update image for the Product Listing pattern.

Replace the Unsplash image with a CCO licensed image from Pxhere.

* Update images for Product Details pattern.

Replace the Unsplash images with CCO licensed images from Pxhere.

* Remove unneeded Unsplash image.

* Use Relative URLs for Images in the Product Listing Pattern

This commit replaces hardcoded URLs with dynamic ones for image placeholders in the `product-listing-with-gallery-and-description.php` pattern file.

- The `plugins_url()` function is now used to generate URLs, which correctly points to the images folder within the WooCommerce Blocks plugin directory. This approach provides better flexibility and portability since it doesn't rely on a specific domain or path. The `esc_url()` function is used to ensure the URL is safe to use in the HTML context.

- The change is made for a total of four images in the pattern.

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

* Update/patterns featured category product collection (https://github.com/woocommerce/woocommerce-blocks/pull/9765)

* Update image for featured category focus pattern

* Update image for featured category cover image pattern

* Update images for featured category triple pattern

* Change to wide width

* Update links to buttons

* Fix typo in hex color value.

There was an extra `f` in the hex color value, causing the text to
unexpectedly render black.

---------

Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>

* Update/collection pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9766)

* Update featured collections images

* Add shop link to shop by price pattern

* Update hero product pattern title (https://github.com/woocommerce/woocommerce-blocks/pull/9769)

* Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9770)

* Add 10.4.2 changelog in readme.txt

* Update version number to 10.4.2

* Add testing instructions for 10.4.2

* Add 9769 PR testing steps

* WooCommerce Classic Template block: Fix error on clearing customizations on Woo Templates (https://github.com/woocommerce/woocommerce-blocks/pull/9759)

* Fix Classic Template block error on clearing customizations on template

* Add link to issue in JS Doc

* Change the way of debug check of tests-mysql container (https://github.com/woocommerce/woocommerce-blocks/pull/9794)

* Add alt text to images used in patterns describing their purpose (https://github.com/woocommerce/woocommerce-blocks/pull/9788)

* Add alt text to images used in patterns describing their purpose

* Replace 1/3 notation with 1 out of 3, so it's better handled byt screen readers

* Update testing instructions to include 9759 PR

* Update zip to include 9759 PR

* Remove 9759 PR from testing instructions

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Roy Ho <roykho77@gmail.com>
Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-06-13 19:18:40 +04:00
Tarun Vijwani fe1294729e Merge remote-tracking branch 'origin/trunk' into trunk 2023-06-13 16:13:47 +04:00
Tarun Vijwani eed8d5088e Add testing notes and changelog of 10.4.2 2023-06-13 16:13:03 +04:00
Hritik Chaudhary 563b439f25 Migrate Block Title component to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/9712)
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-06-13 16:30:57 +05:30
Daniel W. Robert 9f87afde32 Apply further optimizations to pattern images. (https://github.com/woocommerce/woocommerce-blocks/pull/9803)
Ran images through imagemin with the pngquant plugin to reduce the file
sizes for our pattern images.
2023-06-12 22:22:44 -04:00
Daniel Dudzic 0a23aca517 Mini Cart: Add an alternative icon setting (https://github.com/woocommerce/woocommerce-blocks/pull/9570)
* Mini Cart: Add an icon setting with 3 alternative icon options. Closes woocommerce/woocommerce-blocks#8556.

* Mini Cart: Fix Mini-cart icons in the toggle setting.

* Minor type fixes.

* Clean up type definitions.

* Move alt icon logic to a separate function.

* Fix cart icons sizes

* Add a negative margin to the mini cart icon
2023-06-12 22:23:52 +02:00
Karol Manijak b7f1ac2b4e Add alt text to images used in patterns describing their purpose (https://github.com/woocommerce/woocommerce-blocks/pull/9788)
* Add alt text to images used in patterns describing their purpose

* Replace 1/3 notation with 1 out of 3, so it's better handled byt screen readers
2023-06-12 19:34:03 +02:00
Karol Manijak 42e95d1c54 Change the way of debug check of tests-mysql container (https://github.com/woocommerce/woocommerce-blocks/pull/9794) 2023-06-12 19:00:27 +02:00
Alexandre Lara 06a9b274c1 WooCommerce Classic Template block: Fix error on clearing customizations on Woo Templates (https://github.com/woocommerce/woocommerce-blocks/pull/9759)
* Fix Classic Template block error on clearing customizations on template

* Add link to issue in JS Doc
2023-06-12 13:55:20 -03:00
Hritik Chaudhary e17221ac79 Removed proptypes and js to ts conversion for Product Categories (https://github.com/woocommerce/woocommerce-blocks/pull/9755)
* Removed proptypes from product-categories

* deleted js file
2023-06-12 18:52:21 +02:00
Karol Manijak 1e849ff3c3 Disable the debug check of tests-mysql to let PHP unit tests pass (https://github.com/woocommerce/woocommerce-blocks/pull/9791) 2023-06-12 17:20:04 +02:00
Alba Rincón ae4757a53f Port to trunk testing notes and readme from 10.2.3 2023-06-09 16:33:08 +02:00
Albert Juhé Lluveras 0be2ef2d84 Fix capitalization in Product Collections: Newest Arrivals pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9777) 2023-06-09 16:04:53 +02:00
Albert Juhé Lluveras a89a229b37 Prevent Mini-Cart table to show horizontal scrollbar (https://github.com/woocommerce/woocommerce-blocks/pull/9676) 2023-06-09 10:48:23 +02:00
Alba Rincón 2b5c73d47e Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9770) 2023-06-09 09:41:15 +02:00
Alba Rincón bc00fbd22b Update hero product pattern title (https://github.com/woocommerce/woocommerce-blocks/pull/9769) 2023-06-09 09:18:30 +02:00
Daniel W. Robert 13a48fb62e Update Images for the Product Details Patterns (https://github.com/woocommerce/woocommerce-blocks/pull/9764)
* Update image for the Product Hero pattern.

Replace the Unsplash image with a CCO licensed image from Pxhere.

* Update images for Prod List Gallery Desc pattern

Replace the Unsplash image with a CCO licensed image from Pxhere for the
Product Listing with Gallery and Description pattern.

* Remove unneeded Unsplash images.

* Update copy for Prod Listing Gallery Desc pattern.

* Optimize new image exports.

* Update image for the Product Listing pattern.

Replace the Unsplash image with a CCO licensed image from Pxhere.

* Update images for Product Details pattern.

Replace the Unsplash images with CCO licensed images from Pxhere.

* Remove unneeded Unsplash image.

* Use Relative URLs for Images in the Product Listing Pattern

This commit replaces hardcoded URLs with dynamic ones for image placeholders in the `product-listing-with-gallery-and-description.php` pattern file.

- The `plugins_url()` function is now used to generate URLs, which correctly points to the images folder within the WooCommerce Blocks plugin directory. This approach provides better flexibility and portability since it doesn't rely on a specific domain or path. The `esc_url()` function is used to ensure the URL is safe to use in the HTML context.

- The change is made for a total of four images in the pattern.

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-06-09 12:13:19 +05:30
Roy Ho 1041bce0e4 Update/patterns featured category product collection (https://github.com/woocommerce/woocommerce-blocks/pull/9765)
* Update image for featured category focus pattern

* Update image for featured category cover image pattern

* Update images for featured category triple pattern

* Change to wide width

* Update links to buttons

* Fix typo in hex color value.

There was an extra `f` in the hex color value, causing the text to
unexpectedly render black.

---------

Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>
2023-06-09 00:37:25 -04:00
Roy Ho f4da27ca56 Update/collection pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9766)
* Update featured collections images

* Add shop link to shop by price pattern
2023-06-09 00:07:52 -04:00
Alba Rincón 49a98abef2 Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9763) 2023-06-08 16:30:23 -04:00
Alba Rincón d78c5e57ef Update Chessboard pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9761) 2023-06-08 16:28:00 -04:00
Alba Rincón 0aa4ba69d0 Updathe the Hero Product Split (https://github.com/woocommerce/woocommerce-blocks/pull/9762) 2023-06-08 16:27:48 -04:00
Daniel W. Robert 43b6f62ad0 Update Banner Pattern To Replace Unsplash Image (https://github.com/woocommerce/woocommerce-blocks/pull/9760)
* Update Banner to replace Unsplash image.

Replaces the Unsplash image with a CCO licensed image from Pxhere. Also
updates the CTA button to link to the Shop page, by default.

* Remove extra padding from top of test column.

Vertical alignment was off on the text column due to 60px of top
padding. This aligns everythign, as expected.
2023-06-08 16:00:55 -04:00
Alba Rincón 9aa1e3448f Update Hero Product 3-split pattern image 2023-06-08 21:41:35 +02:00
Roy Ho 8e94500136 Use correct SVG for RTL display (https://github.com/woocommerce/woocommerce-blocks/pull/9756) 2023-06-08 11:29:34 -07:00
Roy Ho bb60a90f5c Convert product-orderby-control to use typescript (https://github.com/woocommerce/woocommerce-blocks/pull/9751) 2023-06-08 05:56:57 -07:00
Tarun Vijwani 27ba84cd84 Update version number to 10.5.0-dev 2023-06-08 15:31:29 +04:00
Tarun Vijwani ac99027225 Cherry pick updated 10.4.0 testing steps 2023-06-08 14:53:22 +04:00
Tarun Vijwani 0833316129 Cherry-pick 10.4.0 testing steps 2023-06-08 14:51:50 +04:00
Tarun Vijwani 8bcbeb8c0e Cherry-pick 10.4.0 changelogs 2023-06-08 14:43:54 +04:00
Albert Juhé Lluveras aa912e31a8 Fix the order of enqueued scripts in the Mini-Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/9749)
* Fix the order of enqueued scripts in the Mini-Cart block

* Use again wp_script_is() to detect is a script has been enqueued or not
2023-06-08 10:37:00 +02:00
Tarun Vijwani c6d0f30989 Remove experimental blocks from the changelog 2023-06-08 11:36:21 +04:00
Manish Menaria d91385e3b9 Product Collection: Hand picked products control in sidebar settings (https://github.com/woocommerce/woocommerce-blocks/pull/9733)
* Add support for hand-picked products in Product Collection block

This commit introduces the ability to manually select specific products in the Product Collection block.

Changes include:
- Added `woocommerceHandPickedProducts` to the `ProductCollectionQuery` and `DEFAULT_FILTERS` in `constants.ts`.
- Created a new control file `hand-picked-products-control.tsx` which introduces a token field where the user can search for and select specific products.
- Included `HandPickedProductsControl` in the Product Collection block's inspector controls in `index.tsx`.
- Updated `ProductCollectionQuery` in `types.ts` to accommodate handpicked products.
- Updated the PHP `ProductCollection` class to handle the hand-picked products query parameters.

These changes allow users to hand-pick products to be displayed in the Product Collection block. This allows for greater customization of the products shown in the block.

* Enhance handling of hand-picked products

- A Set data structure is now used to store 'newHandPickedProducts' instead of an Array, which will help prevent duplicate entries.
- Additionally, the suggestions for products to be hand-picked now excludes already selected products, enhancing the user experience by avoiding redundancy in the suggestions list.
- Lastly, the function name 'displayTransform' has been changed to 'transformTokenIntoProductName' to more accurately reflect its purpose, which is to transform a token into a product name.

* Update import & export of HandPickedProductsControl
2023-06-08 06:03:01 +00:00
Manish Menaria 1814bc95e5 Product Collection: Add author filter in sidebar settings (https://github.com/woocommerce/woocommerce-blocks/pull/9736)
* Add author filter to ProductCollection block

This commit adds an author filter to the ProductCollection block in WooCommerce Blocks.

- A new file, `author-control.tsx`, has been created inside the `inspector-controls` directory of the `product-collection` block. This file contains the React component for the author filter, which fetches the list of authors from the WordPress database using `useEntityRecords`. The filter provides an interface for selecting authors whose products should be displayed in the ProductCollection block.

- The author filter is added to the main component of the `inspector-controls` in `index.tsx`.

- In `ProductCollection.php`, the 'author' parameter is now included in the product query. This allows products from a specific author to be displayed in the ProductCollection block, depending on the user's selection in the Gutenberg editor.

This addition enhances the functionality of the ProductCollection block by allowing site administrators to create more customized and targeted displays of products.

* Update error handling

* Refactor 'Author' interfaces and fix offset calculation

This commit refactors the 'Author' interfaces in the 'author-control.tsx' file. The interface 'AuthorsMapping' has been removed and its properties have been merged into 'AuthorsInfo' for simplicity and maintainability.

In the PHP file 'ProductCollection.php', the offset calculation logic has been improved to handle pagination correctly. Now, the offset is calculated as '(per_page * (page - 1)) + offset', which correctly accounts for both the page number and the offset when determining the starting point for the product query.
2023-06-08 11:10:05 +05:30
Tarun Vijwani 0f3e9340f0 Cherry pick 9684 PR as it got merged after release branch was created 2023-06-07 23:37:49 +04:00
Luigi Teschio 460b8a5034 Product rating: improve preview style when the product doesn't have rating (https://github.com/woocommerce/woocommerce-blocks/pull/9684)
* product rating: improve preview style when no rating is visible

* fix class naming

* fix cutted star

* change variable

* fix cut border
2023-06-07 23:32:31 +04:00
Tarun Vijwani 5f60dbbd6c Update testing zip file to include 9748 PR 2023-06-07 21:52:06 +04:00
Tarun Vijwani 9468a9c0d8 Cherry-pick 9748 2023-06-07 21:44:20 +04:00
Alba Rincón 8eb7b16af0 Render the single product title as an h1 (https://github.com/woocommerce/woocommerce-blocks/pull/9748) 2023-06-07 21:31:24 +04:00
Alba Rincón 06a0ab94ce Render the single product title as an h1 (https://github.com/woocommerce/woocommerce-blocks/pull/9748) 2023-06-07 15:47:56 +02:00
Tarun Vijwani 76601b3971 Remove expiremental block from testing notes 2023-06-07 16:56:56 +04:00
Roy Ho 70e3533467 Prevent showing edit product details link when in multiple products context (https://github.com/woocommerce/woocommerce-blocks/pull/9741) 2023-06-07 05:43:04 -07:00
Tarun Vijwani 910cd98b58 Move 9691 PR to WC core 2023-06-07 16:11:46 +04:00
Hritik Chaudhary af09b0c9b8 Removed proptypes from grid-content-control (https://github.com/woocommerce/woocommerce-blocks/pull/9713)
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-06-07 13:22:50 +02:00
Thomas Roberts aa1fe5c308 Add text limit to payment method descriptions in the page editor (https://github.com/woocommerce/woocommerce-blocks/pull/9708)
* Convert summary/utils to TS

* Add @wordpress/wordcount type defs

* Move trimWords, trimCharacters, remoteTags & appendMoreText to own file

* Add tests for trimWords and related functions

* Trim payment method description if it is longer than 30 words
2023-06-07 02:29:15 -07:00