Commit Graph

5998 Commits

Author SHA1 Message Date
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
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