Commit Graph

5618 Commits

Author SHA1 Message Date
Daniel Dudzic 6dc1deef9e Product Gallery: Add Crop, Zoom and Full-screen settings (https://github.com/woocommerce/woocommerce-blocks/pull/10445)
* WIP Product Gallery: Add the Thumbnails block

* Product Gallery Thumbnails: Add block settings

* Add template for the Product Gallery block

* Add template for the Product Gallery block. Add the rest of the files.

* Product Gallery Thumbnails: Add context settings sharing between the Product Gallery and Thumbnails block.

* Product Gallery Thumbnails: Add UI functionality and frontend functionality. Add settings for the Thumbnails in both places - Product Gallery and the Thumbnails block.

* Product Gallery Thumbnails: Move the static template ouside of the component

* Make sure the context is set before accesing the array values

* Product Gallery Thumbnails: Move the setGroupAttributes() function outside of the component

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Update the Features Flags and Experimental Interfaces doc

* Product Gallery Thumbnails: Fix TS error

* Product Gallery Thumbnails: Remove unused stylesheet

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Remove unused context and fix the thumbnails bottom position styling on the frontend.

* Product Gallery Thumbnails: Allow the user to move the horizontal thumbnails above the large image and don't overwrite that automatically

* Product Gallery Thumbnails: Add code comments and remove the incorrect conditional check when moving thumbnails up and down

* Product Gallery Thumbnails: Fix the eslint dependency error

* Product Gallery Thumbnails: Refactor Product Gallery edit code and move the logic to a utils file

* Product Gallery Thumbnails: Update the utils file

* Product Gallery Thumbnails: Update the utils file. Fix comment indentation

* Product Gallery Thumbnails: Fix undefined variable html when only 1 product image is set

* Product Gallery: Rename clientId to productGalleryClientId

* Product Gallery Thumbnails: Combine the useEffect code having the same dependencies

* Product Gallery Thumbnails: Combine all useEffect code together

* Product Gallery Thumbnails: Add a ThumbnailsPosition enum

* Product Gallery Thumbnails: Update the thumbnailsPosition to an enum

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Add missing dependency

* Product Gallery Thumbnails: Uppercase the enum and fix the thumbnails position bug when initially adding the Product Gallery block

* Product Gallery: Add crop, zoom and full-screen settings

* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error

* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error

* Product Gallery Thumbnails: Revert back to ts-ignore

* Revert "Product Gallery: Add crop, zoom and full-screen settings"

This reverts commit 840654197619e2611029b81990493387ae0b543d.

* Product Gallery: Add crop, zoom and full-screen settings

* Product Gallery: Remove the redundant React Fragment
2023-08-02 10:43:08 +00:00
Alba Rincón a9d29407eb Fix badge wrong spacing on the newest arrivals pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10446) 2023-08-02 11:06:57 +02:00
Manish Menaria 8cc81fa509 Update 1080.md 2023-08-02 14:24:20 +05:30
Manish Menaria 7ccd992bcc Update 1080.md 2023-08-02 14:21:08 +05:30
Manish Menaria 3131543bbb Update 1080.md 2023-08-02 14:18:14 +05:30
Manish Menaria 19fec9a6d9 Update testing notes for woocommerce/woocommerce-blocks#10306 in 1080.md 2023-08-02 14:13:04 +05:30
Alba Rincón a8873c3fa3 Remove propTypes (https://github.com/woocommerce/woocommerce-blocks/pull/10432) 2023-08-02 09:48:26 +02:00
Daniel Dudzic d6e4dd5eb3 Add Product Gallery Thumbnails block (https://github.com/woocommerce/woocommerce-blocks/pull/10442)
* WIP Product Gallery: Add the Thumbnails block

* Product Gallery Thumbnails: Add block settings

* Add template for the Product Gallery block

* Add template for the Product Gallery block. Add the rest of the files.

* Product Gallery Thumbnails: Add context settings sharing between the Product Gallery and Thumbnails block.

* Product Gallery Thumbnails: Add UI functionality and frontend functionality. Add settings for the Thumbnails in both places - Product Gallery and the Thumbnails block.

* Product Gallery Thumbnails: Move the static template ouside of the component

* Make sure the context is set before accesing the array values

* Product Gallery Thumbnails: Move the setGroupAttributes() function outside of the component

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Update the Features Flags and Experimental Interfaces doc

* Product Gallery Thumbnails: Fix TS error

* Product Gallery Thumbnails: Remove unused stylesheet

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Remove unused context and fix the thumbnails bottom position styling on the frontend.

* Product Gallery Thumbnails: Allow the user to move the horizontal thumbnails above the large image and don't overwrite that automatically

* Product Gallery Thumbnails: Add code comments and remove the incorrect conditional check when moving thumbnails up and down

* Product Gallery Thumbnails: Fix the eslint dependency error

* Product Gallery Thumbnails: Refactor Product Gallery edit code and move the logic to a utils file

* Product Gallery Thumbnails: Update the utils file

* Product Gallery Thumbnails: Update the utils file. Fix comment indentation

* Product Gallery Thumbnails: Fix undefined variable html when only 1 product image is set

* Product Gallery: Rename clientId to productGalleryClientId

* Product Gallery Thumbnails: Combine the useEffect code having the same dependencies

* Product Gallery Thumbnails: Combine all useEffect code together

* Product Gallery Thumbnails: Add a ThumbnailsPosition enum

* Product Gallery Thumbnails: Update the thumbnailsPosition to an enum

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Add missing dependency

* Product Gallery Thumbnails: Uppercase the enum and fix the thumbnails position bug when initially adding the Product Gallery block

* Product Gallery: Add crop, zoom and full-screen settings

* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error

* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error

* Product Gallery Thumbnails: Revert back to ts-ignore

* Revert "Product Gallery: Add crop, zoom and full-screen settings"

This reverts commit 840654197619e2611029b81990493387ae0b543d.
2023-08-02 07:09:51 +00:00
Alba Rincón 76e68dddfd Show only products with rating (https://github.com/woocommerce/woocommerce-blocks/pull/10434) 2023-08-02 08:49:58 +02:00
Roy Ho 62268b7017 Remove duplicate HTML element and added classnames for single product block (https://github.com/woocommerce/woocommerce-blocks/pull/10374) 2023-08-01 12:24:35 -07:00
Daniel Dudzic 69f1c53a41 Revert "Add Product Gallery Thumbnails block (https://github.com/woocommerce/woocommerce-blocks/pull/10247)" (https://github.com/woocommerce/woocommerce-blocks/pull/10441)
This reverts commit 51344c3fed.
2023-08-01 19:03:12 +02:00
Manish Menaria a1429f6e5e Update 1080.md 2023-08-01 17:58:40 +05:30
Daniel Dudzic 51344c3fed Add Product Gallery Thumbnails block (https://github.com/woocommerce/woocommerce-blocks/pull/10247)
* WIP Product Gallery: Add the Thumbnails block

* Product Gallery Thumbnails: Add block settings

* Add template for the Product Gallery block

* Add template for the Product Gallery block. Add the rest of the files.

* Product Gallery Thumbnails: Add context settings sharing between the Product Gallery and Thumbnails block.

* Product Gallery Thumbnails: Add UI functionality and frontend functionality. Add settings for the Thumbnails in both places - Product Gallery and the Thumbnails block.

* Product Gallery Thumbnails: Move the static template ouside of the component

* Make sure the context is set before accesing the array values

* Product Gallery Thumbnails: Move the setGroupAttributes() function outside of the component

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Update the Features Flags and Experimental Interfaces doc

* Product Gallery Thumbnails: Fix TS error

* Product Gallery Thumbnails: Remove unused stylesheet

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Remove unused context and fix the thumbnails bottom position styling on the frontend.

* Product Gallery Thumbnails: Allow the user to move the horizontal thumbnails above the large image and don't overwrite that automatically

* Product Gallery Thumbnails: Add code comments and remove the incorrect conditional check when moving thumbnails up and down

* Product Gallery Thumbnails: Fix the eslint dependency error

* Product Gallery Thumbnails: Refactor Product Gallery edit code and move the logic to a utils file

* Product Gallery Thumbnails: Update the utils file

* Product Gallery Thumbnails: Update the utils file. Fix comment indentation

* Product Gallery Thumbnails: Fix undefined variable html when only 1 product image is set

* Product Gallery: Rename clientId to productGalleryClientId

* Product Gallery Thumbnails: Combine the useEffect code having the same dependencies

* Product Gallery Thumbnails: Combine all useEffect code together

* Product Gallery Thumbnails: Add a ThumbnailsPosition enum

* Product Gallery Thumbnails: Update the thumbnailsPosition to an enum

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Fix TS errors

* Product Gallery Thumbnails: Add missing dependency

* Product Gallery Thumbnails: Uppercase the enum and fix the thumbnails position bug when initially adding the Product Gallery block

* Product Gallery: Add crop, zoom and full-screen settings

* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error

* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error

* Product Gallery Thumbnails: Revert back to ts-ignore
2023-08-01 12:23:53 +00:00
Manish Menaria c85c22f3c0 Add testing notes 2023-08-01 16:47:46 +05:30
Mike Jolley 3cfcdd0646 Refactor Store API hydration logic and prevent fatal errors from session class usage (https://github.com/woocommerce/woocommerce-blocks/pull/10373)
* Refactor hydration logic

* spacing
2023-08-01 12:13:18 +01:00
Alba Rincón b3adae504f Run `phpcs` on all files (https://github.com/woocommerce/woocommerce-blocks/pull/10429)
* Run php on all files

* Run phpcs on all files

* Ignore warning
2023-08-01 11:32:56 +02:00
Alba Rincón 2df75990e3 Catch all the PHPCS errors only on changed files (https://github.com/woocommerce/woocommerce-blocks/pull/10402)
* Commit a php lint warning

* Add param to show php warnings

* Print exit code

* Test

* test 2

* Add back cs2pr

* Add checkstyle

* Remove exit code

* Test without report

* Add checkstyle

* Fix php

* Test changed files

* Print changed files

* Introduce error

* More errors

* Fix errors

* Test

* Test all cases

* Fix php lint errors

* Rename readme

* Show all files

* Test new action

* Test

* Try other actions

* Add errors

* Remove actions

* More errors

* Fix git diff

* Fix all php errors

* Remove git fetch

* Add error

* Fix error and action
2023-08-01 10:25:12 +02:00
Alexandre Lara 720f65ca36 Fix color when selecting Large Image block (https://github.com/woocommerce/woocommerce-blocks/pull/10425) 2023-07-31 17:04:10 -03:00
Luigi 263ceac505 add testing instructions for the release 10.6.2 2023-07-31 17:19:39 +02:00
Patricia Hillebrandt 54cfff4644 Add new GH Action for ensuring the correct labels are added to PRs (https://github.com/woocommerce/woocommerce-blocks/pull/10412)
* Add new GH Action for ensuring the correct labels are added to PRs.

* Update Pull Request Template instructions for labels.

* Update validation.

* Update the validation for the type.
2023-07-31 15:54:17 +02:00
Luigi Teschio e0296c15fd fix unit test (https://github.com/woocommerce/woocommerce-blocks/pull/10409) 2023-07-31 12:26:20 +00:00
Manish Menaria f7b40317f5 Update minimum WordPress and WooCommerce requirements
This commit updates the minimum WordPress and WooCommerce requirements in the `woocommerce-gutenberg-products-block.php` file. It sets the minimum WordPress version to 6.2 and the minimum WooCommerce version to 7.8. Additionally, it increases the WooCommerce version tested up to 7.9.
2023-07-31 17:25:21 +05:30
Manish Menaria 0e6a4464bf Bump version to 10.8.0
This commit updates the version of WooCommerce Blocks from 10.8.0-dev to 10.8.0 in the `composer.json`, `package-lock.json`, `package.json`, `readme.txt`, `src/Package.php`, and `woocommerce-gutenberg-products-block.php` files. This signifies the move from the development version to the stable release.
2023-07-31 16:47:16 +05:30
Manish Menaria 8e6cefdda2 Update readme with 10.8.0 changelog
This commit updates the `readme.txt` file to document the changes made in version 10.8.0. This version includes numerous enhancements, bug fixes, and other changes.

Enhancements include updating various patterns to become wireframed, removing opinionated styles from multiple patterns, and introducing the ColorPanel component in the Mini-Cart block for custom color controls. Bug fixes address issues in the Classic Template block, product query logic, and PHP warnings among others. The "Various" section introduces new patterns and endpoints.

Each change is linked to its corresponding pull request for detailed tracking and discussion.
2023-07-31 16:44:16 +05:30
Paulo Arromba e40d630b54 $post validation on Cart and Checkout template (https://github.com/woocommerce/woocommerce-blocks/pull/10410)
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-07-31 12:49:34 +02:00
Luigi Teschio be7fb56637 Register Legacy block for all taxonomy-product_ template (https://github.com/woocommerce/woocommerce-blocks/pull/10382)
* WIP

* improve logic

* improve unit test
2023-07-31 12:23:49 +02:00
Manish Menaria bf60eb60e7 Product collection - Fix test_merging_filter_by_attribute_queries unit test (https://github.com/woocommerce/woocommerce-blocks/pull/10302)
* Add PHPUnit tests for the ProductCollection block type

This commit introduces PHPUnit tests for the ProductCollection block type. A new test file, `ProductCollection.php`, has been added under the `BlockTypes` directory within the tests. The test file sets up a mock instance of `ProductCollection` and verifies its behavior. Particularly, it tests the merging of on-sale queries, ensuring the results are as expected.

To assist in the testing, a new mock class, `ProductCollectionMock`, has been created under the `Mocks` directory. This class extends the `ProductCollection` block type and provides methods for setting parsed block data and attribute filter query arguments.

These tests should help ensure the correctness and reliability of the `ProductCollection` block type.

* Expand PHPUnit tests for ProductCollection block to cover stock status queries

This commit expands the existing PHPUnit tests for the ProductCollection block type to cover scenarios involving stock status queries. Specifically, a new test method, `test_merging_stock_status_queries`, has been added.

This method tests if the 'woocommerceStockStatus' attribute is correctly merged into the query parameters. It verifies that the stock status is correctly incorporated into the 'meta_query' array as part of the constructed query.

This addition enhances the coverage of our test suite, ensuring that the ProductCollection block behaves as expected in scenarios involving stock status queries.

* Add extensive testing for ProductCollection block's query merging

The following test methods were added:

1. `test_merging_default_stock_queries`: This tests the merging of default stock queries, verifying the absence of meta_query in certain conditions.

2. `test_merging_attribute_queries`: This tests the merging of attribute queries, ensuring the correct taxonomy and terms are used in the merged tax_query.

3. `test_merging_order_by_rating_queries` and `test_merging_order_by_popularity_queries`: These test the merging of order by queries, checking for the right orderby and meta_key in the merged query.

4. `test_product_visibility_query_exist_in_merged_query`: This tests if the product visibility query exists in the merged query.

This additional testing improves the reliability and coverage of our tests, ensuring the correct functionality of the ProductCollection block's query merging process.

* Add unit tests for merged queries in ProductCollection block

- Merging multiple queries
- Merging filter by max price queries
- Merging filter by min price queries
- Merging filter by min and max price queries
- Merging filter by stock status queries
- Merging filter by attribute queries
- Merging multiple filter queries

These tests use PHPUnit assertions to validate the correctness of the merged queries.

* Add tests for REST query modifications in ProductCollection block

This commit adds two new test cases and a helper method to the `ProductCollection` test class.

The helper method, `build_request()`, constructs a simplified `WP_REST_Request` object for testing purposes. This request object simulates a typical request from the ProductCollection block, including potential WooCommerce parameters such as 'woocommerceOnSale', 'woocommerceAttributes', and 'woocommerceStockStatus'.

The first new test, `test_updating_rest_query_without_attributes()`, tests the block's capability to modify a REST query that doesn't include any product attribute filters. It verifies that the correct '_stock_status' and 'product_visibility' parameters are set in the meta and tax queries respectively.

The second test, `test_updating_rest_query_with_attributes()`, does the same as the previous one but with the inclusion of a product attribute filter in the REST request. This test verifies that the block can handle REST queries with attribute filters correctly.

These tests improve coverage on the ProductCollection block's REST query handling, ensuring that it can merge different filter queries correctly.

* Add test for merging taxonomies query in ProductCollection block

This commit introduces a new test, `test_merging_taxonomies_query()`, in the `ProductCollection` test class.

The test simulates a situation where the block has to merge taxonomy queries related to product categories and tags. The parsed block attributes are configured to include 'product_cat' and 'product_tag' taxonomies with certain term IDs.

The test then asserts that the merged query correctly includes these taxonomies with the appropriate term IDs and 'include_children' set to false. This confirms that the block correctly merges taxonomy filters when building the final query.

* Fix failing test

* Try again

* Try again

* Remove test_merging_filter_by_attribute_queries test

This commit removes the `test_merging_filter_by_attribute_queries()` test from the `ProductCollection` test class.

* Reintroduce test for merging attribute filter queries

This commit reintroduces the `test_merging_filter_by_attribute_queries()` test in the `ProductCollection` test class.

The test checks the correct merging of queries when filtering by color and size attributes. It sets various query variables and asserts the correct structure and content of the merged query.

This could be because the previous removal of this test was a mistake, or because changes in the code have once again made this test relevant.

* fix: passing correct block instance to build_frontend_query method

---------

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-07-31 14:12:03 +05:30
Patricia Hillebrandt 3ec684818e Fix: WooCommerce Blocks causing malfunction of the navigation block on WordPress 6.3 (https://github.com/woocommerce/woocommerce-blocks/pull/10388)
* Make sure the revert button is registered and enqueued for usage exclusively in the site editor.

* Register and enqueue the styles for the revert button.

* Rename the files.

* Revert "Rename the file renames."

This reverts commit c0330ce70fec20bea1f957eddcf458881e16242c.

* Add plugin-proposal-optional-chaining to the WebPack plugins config.

* Rename the files.

* Remove unnecessary dependencies as those are already provided via : more specifically, get_script_data.

* Address CR.
2023-07-31 07:03:10 +00:00
Patricia Hillebrandt adf39ff0fe Store Customization > Featured Products 5-Item Grid pattern - Update the pattern to become wireframed (https://github.com/woocommerce/woocommerce-blocks/pull/10401)
* Featured Products 5-Item Grid pattern: Ensure a placeholder image is displayed when the product doesn't have any

* Ensure the wp-block-group is aligned wide.

* Update text styles

* Make texts translatable.

* Update the Featured Products 5-Item Grid pattern
2023-07-31 08:48:41 +02:00
Mike Jolley a3240d7204 Remove info-verbosity (https://github.com/woocommerce/woocommerce-blocks/pull/10403) 2023-07-28 16:21:08 +01:00
dependabot[bot] f218cfb51e Bump phpunit/phpunit from 8.5.33 to 9.2.6 (https://github.com/woocommerce/woocommerce-blocks/pull/9188)
* Bump phpunit/phpunit from 8.5.33 to 9.2.6

Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 8.5.33 to 9.2.6.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/9.2.6/ChangeLog-9.2.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/8.5.33...9.2.6)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

* Update dependencies to avoid conflicts in php8

* Fix test due to array order of values

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-07-28 16:19:45 +01:00
Albert Juhé Lluveras 8bd67440b5 Unify links to WordPress and WooCommerce websites in patterns (https://github.com/woocommerce/woocommerce-blocks/pull/10380)
* Unify links to WordPress and WooCommerce websites in patterns

* Add missing em closing tag
2023-07-28 16:34:50 +02:00
Roy Ho 7d17febec4 Add selection button to featured items when id not found (https://github.com/woocommerce/woocommerce-blocks/pull/10387) 2023-07-28 07:23:43 -07:00
dependabot[bot] 7d913555db Bump actions/upload-artifact from 2.2.2 to 3.1.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9860)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.2 to 3.1.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.2...v3.1.2)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-28 15:04:19 +01:00
dependabot[bot] 5ca496c20b Bump yoast/phpunit-polyfills from 1.0.5 to 2.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/9795)
* Bump yoast/phpunit-polyfills from 1.0.5 to 2.0.0

Bumps [yoast/phpunit-polyfills](https://github.com/Yoast/PHPUnit-Polyfills) from 1.0.5 to 2.0.0.
- [Release notes](https://github.com/Yoast/PHPUnit-Polyfills/releases)
- [Changelog](https://github.com/Yoast/PHPUnit-Polyfills/blob/2.x/CHANGELOG.md)
- [Commits](https://github.com/Yoast/PHPUnit-Polyfills/compare/1.0.5...2.0.0)

---
updated-dependencies:
- dependency-name: yoast/phpunit-polyfills
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

* Remove expect exception usage

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-07-28 12:53:40 +01:00
dependabot[bot] 4bdf361f7a Bump preactjs/compressed-size-action (https://github.com/woocommerce/woocommerce-blocks/pull/9304)
Bumps [preactjs/compressed-size-action](https://github.com/preactjs/compressed-size-action) from 265b0667736973f2d83b1a35fdc5440d6cb3322e to 8a15fc9a36a94c8c3f7835af11a4924da7e95c7c.
- [Release notes](https://github.com/preactjs/compressed-size-action/releases)
- [Commits](265b066773...8a15fc9a36)

---
updated-dependencies:
- dependency-name: preactjs/compressed-size-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-28 12:04:32 +01:00
Luigi Teschio 0038caeb85 fix phpcs error (https://github.com/woocommerce/woocommerce-blocks/pull/10330) 2023-07-28 13:01:23 +02:00
dependabot[bot] 47ef07ca57 Bump terser-webpack-plugin from 3.0.3 to 4.2.3 (https://github.com/woocommerce/woocommerce-blocks/pull/7981)
Bumps [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin) from 3.0.3 to 4.2.3.
- [Release notes](https://github.com/webpack-contrib/terser-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/terser-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/terser-webpack-plugin/compare/v3.0.3...v4.2.3)

---
updated-dependencies:
- dependency-name: terser-webpack-plugin
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-28 11:53:24 +01:00
dependabot[bot] f53d27048d Bump webpack-cli from 3.3.12 to 4.10.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8881)
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.12 to 4.10.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.10.0)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-28 11:30:17 +01:00
dependabot[bot] b7225ca549 Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/10066)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.5.1...v1.6.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-07-28 11:05:25 +01:00
dependabot[bot] 0706ebac63 Bump use-debounce from 7.0.1 to 9.0.4 (https://github.com/woocommerce/woocommerce-blocks/pull/9306)
* Bump use-debounce from 7.0.1 to 9.0.4

Bumps [use-debounce](https://github.com/xnimorz/use-debounce) from 7.0.1 to 9.0.4.
- [Release notes](https://github.com/xnimorz/use-debounce/releases)
- [Changelog](https://github.com/xnimorz/use-debounce/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xnimorz/use-debounce/commits/9.0.4)

---
updated-dependencies:
- dependency-name: use-debounce
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Fix mocked function

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-07-27 16:10:43 +01:00
dependabot[bot] 357c76376e Bump @storybook/client-api from 6.5.14 to 7.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/10385)
Bumps [@storybook/client-api](https://github.com/storybookjs/storybook/tree/HEAD/code/deprecated/client-api) from 6.5.14 to 7.1.1.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v7.1.1/code/deprecated/client-api)

---
updated-dependencies:
- dependency-name: "@storybook/client-api"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 14:48:18 +01:00
dependabot[bot] 1ace01977c Bump actions/stale from 6 to 8 (https://github.com/woocommerce/woocommerce-blocks/pull/8927)
Bumps [actions/stale](https://github.com/actions/stale) from 6 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v6...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 14:28:54 +01:00
dependabot[bot] 1af6da5f02 Bump semver from 5.7.1 to 5.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/10172)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 13:54:16 +01:00
Mike Jolley 5906125168 Cart and Checkout Page Migration: Inherit Page template and fix rendering (https://github.com/woocommerce/woocommerce-blocks/pull/10375)
* Change shortcode block render callback

* Inherit template from original "page" template
2023-07-27 13:43:26 +01:00
dependabot[bot] c12f7bda70 Bump mockery/mockery from 1.6.2 to 1.6.4 (https://github.com/woocommerce/woocommerce-blocks/pull/10335)
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.6.2 to 1.6.4.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/1.6.x/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.6.2...1.6.4)

---
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-07-27 13:05:22 +01:00
Niels Lange 5f14d1c5aa Update README.md 2023-07-27 12:29:39 +03:00
Alex Florisca 1e2e0fbe9c Update express checkout title, description, icon (https://github.com/woocommerce/woocommerce-blocks/pull/10237)
* Change icon, title and description of the Express Checkout Block

* Fix icon style

* Update icon and add styles

* change icon for express payments in cart
2023-07-27 09:08:29 +01:00
Albert Juhé Lluveras 22be5a532a Add tests in Playwright for Mini-Cart drawer closing (https://github.com/woocommerce/woocommerce-blocks/pull/10305)
* Add tests in Playwright for Mini-Cart drawer closing

* Make use of waitForSelector instead of waitForTimeout

* Make use of waitForSelector instead of waitForTimeout (II)
2023-07-27 08:53:24 +02:00
Albert Juhé Lluveras 966cf8a4c9 Fix Classic Template block in Single Product custom templates (https://github.com/woocommerce/woocommerce-blocks/pull/10342)
* Fix Classic Template block in Single Product custom templates

* Update src/BlockTemplatesController.php

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

---------

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2023-07-27 08:26:30 +02:00
Tung Du b5100e9d99 Fix: incorrect default number of products in editor when inheriting query (https://github.com/woocommerce/woocommerce-blocks/pull/10303) 2023-07-27 10:06:16 +07:00
Patricia Hillebrandt ae04cabbae Store Customization > Introduce the new Social: Follow us in social media pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10368)
* Add the new Social: Follow us in social media pattern and relevant images.

* Update the URLs

* Remove all IDs from the images.

* Make title translatable. Removed hardcoded color for the icons. Update indentation.
2023-07-26 17:56:54 +02:00
dependabot[bot] 63685a2ffe Bump storybook-addon-react-docgen from 1.2.42 to 1.2.43 (https://github.com/woocommerce/woocommerce-blocks/pull/9887)
Bumps [storybook-addon-react-docgen](https://github.com/hipstersmoothie/storybook-addon-react-docgen) from 1.2.42 to 1.2.43.
- [Release notes](https://github.com/hipstersmoothie/storybook-addon-react-docgen/releases)
- [Changelog](https://github.com/hipstersmoothie/storybook-addon-react-docgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hipstersmoothie/storybook-addon-react-docgen/compare/v1.2.42...v1.2.43)

---
updated-dependencies:
- dependency-name: storybook-addon-react-docgen
  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-07-26 08:51:58 -07:00
dependabot[bot] dfd6a7ee21 Bump commander from 9.4.0 to 11.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/9889)
Bumps [commander](https://github.com/tj/commander.js) from 9.4.0 to 11.0.0.
- [Release notes](https://github.com/tj/commander.js/releases)
- [Changelog](https://github.com/tj/commander.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tj/commander.js/compare/v9.4.0...v11.0.0)

---
updated-dependencies:
- dependency-name: commander
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-26 08:42:49 -07:00
Alba Rincón 51ca561130 Remove styles from `Product Details Product Listing` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10362)
* Fix black and white colors

* Remove styles from button and title
2023-07-26 16:12:11 +02:00
Roy Ho a57642318a Change custom toolbar item to use toolbar button (https://github.com/woocommerce/woocommerce-blocks/pull/10246) 2023-07-26 06:19:41 -07:00
Karol Manijak b5d3580ccf Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+ (https://github.com/woocommerce/woocommerce-blocks/pull/10360)
* Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+

* Extract the logic of checking the post template support for grid view toi separate function

* Change the versions comparison and improve description of custom version compare function
2023-07-26 15:13:54 +02:00
Roy Ho 02c95b9b1a Remove uneeded testin step for 10198 (https://github.com/woocommerce/woocommerce-blocks/pull/10371) 2023-07-26 06:12:58 -07:00
Patricia Hillebrandt 529f17dac9 Store Customization > Large Footer pattern - Update the pattern to become wireframed (https://github.com/woocommerce/woocommerce-blocks/pull/10323)
* Remove opinionated font styles and sizes from the Large Footer pattern.

* Ensure the year is dinamically changed in the footer.

* Make string translatable

* Update translation to include the WooCommerce brand.
2023-07-26 13:51:14 +02:00
Albert Juhé Lluveras 84849ca99d Fix Checkout Order Route markdown link (https://github.com/woocommerce/woocommerce-blocks/pull/10364) 2023-07-26 11:37:51 +01:00
Paulo Arromba 73633ee3d1 Render Checkout/Cart containing pages without template overriding (https://github.com/woocommerce/woocommerce-blocks/pull/10359)
* Render Checkout/Cart containing pages without template overriding

* Fix checkout typo

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-07-26 11:25:49 +01:00
Mike Jolley 025a280b33 Babel and Autoprefixer updates (https://github.com/woocommerce/woocommerce-blocks/pull/10341) 2023-07-26 10:58:17 +01:00
Karol Manijak e09962d65a Optimise imports of Product Query variation (https://github.com/woocommerce/woocommerce-blocks/pull/10340)
* Optimise imports of Product Query variation

* Lint: add whitespace
2023-07-26 11:08:01 +02:00
Alex Florisca 99e1f46281 Change stable version and changelog after release of 10.7.1 2023-07-26 09:53:27 +01:00
Hsing-yu Flowers 35760814d6 Add an endpoint for processing pay for order orders (https://github.com/woocommerce/woocommerce-blocks/pull/10287)
* Register order route

* Check authorization for getting the order

* Add order data to the response

* Add order schema for the endpoint

* Move validation check to order controller

* Add order item schema

* Check if the order is associated with current user

* Fix after rebase

* Add checkout order endpoint

* Add order authorization trait

* Allow to use the order update customer endpoint in dev build only

* Get both customer and guest details

* Remove duplicate function

* Update the cart update customer class doc block

* Remove duplicate order route

* Update documentation for feature flags

* Add checkout trait

* Remove checkout trait

* Update billing address and order

* Only allow checkout pending orders

* Create checout trait

* Use sanitize text field

* Extend from checkout schema

* Update response message

* Allow failed orders to be paid for

* Update authorization error message
2023-07-25 13:00:01 -07:00
Patricia Hillebrandt e29360642d Store Customization > Introduce the new Featured Products: Fresh & Tasty pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10339)
* Introduce the new Featured Products: Fresh & Tasty pattern.

* Update lettuce image.

* Update indentation.

* Make all strings translatable.

* Align all prices right

* Ensure text doesnt stack on mobile

* Update mobile display for the prices

* Update mobile display for the product names

* Remove the image id and the text styles
2023-07-25 17:11:11 +02:00
Patricia Hillebrandt 15db0701f2 Store Customization > Featured Category Triple pattern - Update the pattern to become wireframed (https://github.com/woocommerce/woocommerce-blocks/pull/10343)
* Remove custom font color from the cover block.

* Update indentation for the Featured Category Triple pattern.

* Update indentation for the third column

* Make all strings translatable.

* replate all paragraph blocks with a wp-block-heading

* Ensure the central text is also white

* replace the buttons with a paragraphs.

* Remove unnecessary styles from wp:column

* Remove more unnecessary styles from wp-block-cover

* Remove the has-text-color class and other unnecessary positioning styles

* Update headings from h4 to h3 and update the paragraph styles.

* Replate theme's has-base-color with has-white-color
2023-07-25 16:00:22 +02:00
Albert Juhé Lluveras c74e27d666 Remove opinionated styles from Alternating Image and Text pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10292)
* Remove opinionated styles from Alternating Image and Text pattern

* Vertically center all columns
2023-07-25 10:12:29 +02:00
Mike Jolley 8223e71085 Revert "Bump fast-xml-parser from 4.2.4 to 4.2.5 (https://github.com/woocommerce/woocommerce-blocks/pull/10136)"
This reverts commit 77ffa1fede.
2023-07-24 17:15:37 +01:00
Mike Jolley b0fca9482a Revert "Bump word-wrap from 1.2.3 to 1.2.5 (https://github.com/woocommerce/woocommerce-blocks/pull/10333)"
This reverts commit 70f174a5e1.
2023-07-24 17:14:37 +01:00
Mike Jolley 3b60cfcf08 Revert "Bump autoprefixer from 10.4.7 to 10.4.14 (https://github.com/woocommerce/woocommerce-blocks/pull/8794)"
This reverts commit 457700ff9d.
2023-07-24 17:13:24 +01:00
dependabot[bot] 70f174a5e1 Bump word-wrap from 1.2.3 to 1.2.5 (https://github.com/woocommerce/woocommerce-blocks/pull/10333)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-24 15:46:01 +01:00
Alexandre Lara f2d313d1a6 Add to cart form: Fix fatal error when missing `product` param in add_to_cart_redirect_filter (https://github.com/woocommerce/woocommerce-blocks/pull/10316)
* Transform product param optional in add_to_cart_redirect_filter method

* Remove unnecessary argument from add_to_cart_redirect_filter

* Remove mocked filter call

* Remove unnecessary argument from function docs
2023-07-24 11:45:40 -03:00
dependabot[bot] 457700ff9d Bump autoprefixer from 10.4.7 to 10.4.14 (https://github.com/woocommerce/woocommerce-blocks/pull/8794)
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.7 to 10.4.14.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.7...10.4.14)

---
updated-dependencies:
- dependency-name: autoprefixer
  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-07-24 15:44:49 +01:00
dependabot[bot] 77ffa1fede Bump fast-xml-parser from 4.2.4 to 4.2.5 (https://github.com/woocommerce/woocommerce-blocks/pull/10136)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.2.4 to 4.2.5.
- [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.2.4...v4.2.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-07-24 15:21:59 +01:00
Alba Rincón a4233a957c Remove opinionated styles from pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10306) 2023-07-24 12:25:34 +02:00
Albert Juhé Lluveras ce16b98893 Fix SearchListControl styles (II) (https://github.com/woocommerce/woocommerce-blocks/pull/10308) 2023-07-24 11:30:54 +02:00
Alba Rincón b8f798b017 Use the `Single Product` block for the `Product Details Product Listing` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9978)
* Show alignment toolbar also when the block is in the single product block

* Start using `Single Product` for the `Product Details Product Listing` pattern

* Use counter and stars blocks in the pattern

* Undo button change

* Make the new rating blocks not experimental

* Add Beta to the average rating block

* Add blocks to block types controller
2023-07-24 11:02:24 +02:00
Roy Ho ef7b811e4b Remove border control (https://github.com/woocommerce/woocommerce-blocks/pull/10277) 2023-07-21 05:46:55 -07:00
Roy Ho 37e197c149 Move sale badge to top right of product image (https://github.com/woocommerce/woocommerce-blocks/pull/10297) 2023-07-21 05:45:09 -07:00
Roy Ho 84f2e47b14 Check if index element exists before using (https://github.com/woocommerce/woocommerce-blocks/pull/10300) 2023-07-21 05:44:16 -07:00
Niels Lange ebf4bef204 Add missing page titles in Cart and Checkout templates (https://github.com/woocommerce/woocommerce-blocks/pull/10281)
* Add missing page titles to the Cart and Checkout templates

* Adjust headline level

* Add i18n support for Cart and Checkout template titles

* Keep empty line between “wp:group” and “wp:template-part”

* Add empty line between “wp:template-part” and “wp:group”
2023-07-21 14:38:08 +02:00
Manish Menaria 6e10e2fbcb Product Collection - Add PHP unit tests (https://github.com/woocommerce/woocommerce-blocks/pull/10289)
* Add PHPUnit tests for the ProductCollection block type

This commit introduces PHPUnit tests for the ProductCollection block type. A new test file, `ProductCollection.php`, has been added under the `BlockTypes` directory within the tests. The test file sets up a mock instance of `ProductCollection` and verifies its behavior. Particularly, it tests the merging of on-sale queries, ensuring the results are as expected.

To assist in the testing, a new mock class, `ProductCollectionMock`, has been created under the `Mocks` directory. This class extends the `ProductCollection` block type and provides methods for setting parsed block data and attribute filter query arguments.

These tests should help ensure the correctness and reliability of the `ProductCollection` block type.

* Expand PHPUnit tests for ProductCollection block to cover stock status queries

This commit expands the existing PHPUnit tests for the ProductCollection block type to cover scenarios involving stock status queries. Specifically, a new test method, `test_merging_stock_status_queries`, has been added.

This method tests if the 'woocommerceStockStatus' attribute is correctly merged into the query parameters. It verifies that the stock status is correctly incorporated into the 'meta_query' array as part of the constructed query.

This addition enhances the coverage of our test suite, ensuring that the ProductCollection block behaves as expected in scenarios involving stock status queries.

* Add extensive testing for ProductCollection block's query merging

The following test methods were added:

1. `test_merging_default_stock_queries`: This tests the merging of default stock queries, verifying the absence of meta_query in certain conditions.

2. `test_merging_attribute_queries`: This tests the merging of attribute queries, ensuring the correct taxonomy and terms are used in the merged tax_query.

3. `test_merging_order_by_rating_queries` and `test_merging_order_by_popularity_queries`: These test the merging of order by queries, checking for the right orderby and meta_key in the merged query.

4. `test_product_visibility_query_exist_in_merged_query`: This tests if the product visibility query exists in the merged query.

This additional testing improves the reliability and coverage of our tests, ensuring the correct functionality of the ProductCollection block's query merging process.

* Add unit tests for merged queries in ProductCollection block

- Merging multiple queries
- Merging filter by max price queries
- Merging filter by min price queries
- Merging filter by min and max price queries
- Merging filter by stock status queries
- Merging filter by attribute queries
- Merging multiple filter queries

These tests use PHPUnit assertions to validate the correctness of the merged queries.

* Add tests for REST query modifications in ProductCollection block

This commit adds two new test cases and a helper method to the `ProductCollection` test class.

The helper method, `build_request()`, constructs a simplified `WP_REST_Request` object for testing purposes. This request object simulates a typical request from the ProductCollection block, including potential WooCommerce parameters such as 'woocommerceOnSale', 'woocommerceAttributes', and 'woocommerceStockStatus'.

The first new test, `test_updating_rest_query_without_attributes()`, tests the block's capability to modify a REST query that doesn't include any product attribute filters. It verifies that the correct '_stock_status' and 'product_visibility' parameters are set in the meta and tax queries respectively.

The second test, `test_updating_rest_query_with_attributes()`, does the same as the previous one but with the inclusion of a product attribute filter in the REST request. This test verifies that the block can handle REST queries with attribute filters correctly.

These tests improve coverage on the ProductCollection block's REST query handling, ensuring that it can merge different filter queries correctly.

* Add test for merging taxonomies query in ProductCollection block

This commit introduces a new test, `test_merging_taxonomies_query()`, in the `ProductCollection` test class.

The test simulates a situation where the block has to merge taxonomy queries related to product categories and tags. The parsed block attributes are configured to include 'product_cat' and 'product_tag' taxonomies with certain term IDs.

The test then asserts that the merged query correctly includes these taxonomies with the appropriate term IDs and 'include_children' set to false. This confirms that the block correctly merges taxonomy filters when building the final query.

* Fix failing test

* Try again

* Try again

* Remove test_merging_filter_by_attribute_queries test

This commit removes the `test_merging_filter_by_attribute_queries()` test from the `ProductCollection` test class.
2023-07-21 15:43:22 +05:30
Darren Ethier f708593adb Add Color Panel (https://github.com/woocommerce/woocommerce-blocks/pull/10062)
* Add new ColorPanel component

* Implement new ColorPanel component for the Mini-Cart

* Move ColorPanel types into their own types.ts file alongside the ColorPanel component

* Add useColorPanelStyles hook

* Rename classes to className

* Disable @wordpress/no-unsafe-wp-apis

* Fix tests: Move defaultColorItem object to utils file

* Remove unnecssary types from QuantityBadge

* Fix conflicts

* Remove context

* Fix color picker JS error

* Migrate attribute data to be compatible with ColorPanel component

* Fix incompatible attributes

* Remove useColorPanelStyles hook

* migrateAttributesToColorPanel JS unit tests

* PHP MiniCartUtils tests

* Remove unncessary code for classNames in MiniCart edit

---------

Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
2023-07-21 10:35:32 +01:00
Alba Rincón aee01c5f9e Update the `Footer with 3 menus` pattern to have no opinionated styles (https://github.com/woocommerce/woocommerce-blocks/pull/10294)
* Remove opinionated styles from pattern

* Make search strings translatable
2023-07-21 10:53:40 +02:00
Albert Juhé Lluveras d248d62db1 Add Mini-Cart block Playwright e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/9757)
* Add Mini-Cart block Playwright e2e tests

* Verify tests fail

* Revert "Verify tests fail"

This reverts commit 47f666657d8a37bb486a4510ece44fd4d82c031d.

* Fix permalink-settings test
2023-07-21 09:44:01 +02:00
Karol Manijak 7018ff47b6 Add manual path to upgrade Products block (https://github.com/woocommerce/woocommerce-blocks/pull/10268)
* Add option to manually update Products block to Product Collection

* Disable manual upgrade of Products yet

* Manual update flag doesn't have to be dependant on auto update

* Removed commented out console info logs

* Disable option to upgrade Products block

* Change the way to bold text in Upgrade Notices so it's translatable

* Change the way UpgradeNotice is rendered conditionally
2023-07-21 08:22:49 +02:00
Albert Juhé Lluveras c763f39cd4 Update 10.6.0 testing steps to specify that Gutenberg is required to test woocommerce/woocommerce-blocks#9647 (II) 2023-07-20 14:38:37 +02:00
Alba Rincón 8299771b06 Update the `Testimonials Single` pattern to have no opinionated styles (https://github.com/woocommerce/woocommerce-blocks/pull/10275)
* Testimonials Single pattern - Update the pattern to become wireframed

* Use the correct function for translating strings
2023-07-20 14:34:01 +02:00
Alexandre Lara f6b84e02e2 Add to Cart Form: Fix broken styles for the block when using inside the Single Product Block (https://github.com/woocommerce/woocommerce-blocks/pull/10282)
* Fix broken styles for Add to Cart Form block

* Fix PHP CS error
2023-07-20 09:28:15 -03:00
Albert Juhé Lluveras 0302f5a878 Update 10.6.0 testing steps to specify that Gutenberg is required to test woocommerce/woocommerce-blocks#9647 2023-07-20 14:23:59 +02:00
Alexandre Lara b8fa7b7e9f Update versions 2023-07-20 08:49:11 -03:00
Alexandre Lara 5ea4295df9 Update changelog and testing notes for release 10.7.0 2023-07-20 08:49:11 -03:00
Brian d46997a84f fix woocommerce/woocommerce-blocks#10027 (https://github.com/woocommerce/woocommerce-blocks/pull/10150) 2023-07-20 04:40:40 -07:00
Hsing-yu Flowers 26f1a59378 Add an endpoint for getting pay for order orders (https://github.com/woocommerce/woocommerce-blocks/pull/8960) (https://github.com/woocommerce/woocommerce-blocks/pull/10199)
* Register order route

* Get order it

* Add order schema

* Check authorization for getting the order

* Add order data to the response

* Add order schema for the endpoint

* Move validation check to order controller

* Update the error codes

* Add order item schema

* Check if the order is associated with current user

* Update order schema to match cart schema

* Update order item schema to match cart item schema

* Add product item trait

* Update sold individually property

* Allow guests to pay for order

* Update wording for logged out customers

* Allow getting all orders from the endpoint

* Add inline explanation for pay_for_order capability

* Remove unused $user_id and $order variables

* Remove duplicate pay_for_order capability check from validate_order_key

* Update exception wording when missing order id or key, or user mismatch

* Ensure $order_key is not null to avoid fatal error when left blank

* Resolve linting errors in order route class

* Adjust order ID description

* Create an abstract item schema

* Remove unused properties

* Remove unused properties

* Add billing email validation

* Allow to use the order endpoint in dev build only

* Add order status property

* Fix coupon and fee handling

* Update documentation for feature flags

* Update typo in total fees tax

* Update typo in tax lines

* Add missing payment methods to cart response

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-07-19 06:49:46 -07:00
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