Commit Graph

6097 Commits

Author SHA1 Message Date
Sam Seay d62b950aae Add a stock filter block powered by the interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/11663) 2023-11-15 16:50:05 +13:00
Seghir Nadir 49579f4aa0 Move phone to default fields section instead of being handled inline. (https://github.com/woocommerce/woocommerce-blocks/pull/11651)
* Move phone to default fields section

* remove unused files and actions
2023-11-14 18:30:23 +00:00
Alexandre Lara 415e12c163 Product Gallery block: Add E2E tests to cover Variable Products (https://github.com/woocommerce/woocommerce-blocks/pull/11536)
* WIP: cover variable products in Product Gallery block

* Fix e2e tests for Product Gallery Large Image block

* Fix php cs error

* Fix eslint errors

* Fix php cs error

* Fix php cs error

* Fix import of file that does not exist

* Specify selected variable product for Large Image block E2E tests
2023-11-14 15:00:11 -03:00
Alex Florisca 9ad8323851 Move Button, StoreNotice and StoreNoticesContainer components into the components package (https://github.com/woocommerce/woocommerce-blocks/pull/11766)
* Move Button, StoreNotice and StoreNoticesContainer components into the components package

* Delete the button folder and leave alias in index.ts

* Update references from @woocommerce/blocks-checkout to @woocommerce/blocks-components
2023-11-14 16:32:53 +00:00
Alba Rincón 6539b018ab Fix hardcoded shop link in "Hero Product 3 Split" pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11767) 2023-11-14 17:12:53 +01:00
Thomas Roberts cb468c8ade Move `TextInput`, `ValidatedTextInput` and `ValidationInputError` to the `@woocommerce/blocks-components` package. (https://github.com/woocommerce/woocommerce-blocks/pull/11654) 2023-11-14 14:52:14 +00:00
Mike Jolley 22bc80536f Update release checklist (https://github.com/woocommerce/woocommerce-blocks/pull/11660)
* Update checklist

* Feedback and update patch checklist to match
2023-11-14 10:36:05 +00:00
Mike Jolley 02f9d97282 Playwright Fixes from the 11.5.x release branch (https://github.com/woocommerce/woocommerce-blocks/pull/11737)
* Adjust test to use legacy selector if block is not found

* Select block before transform

* Improve frame selector
2023-11-14 10:32:19 +00:00
Alex Florisca cee80347f3 Add storybook entry for Label component (https://github.com/woocommerce/woocommerce-blocks/pull/11682) 2023-11-14 09:58:57 +00:00
Niels Lange 845c84be1e Update changelog and testing notes for release 11.4.8 2023-11-14 14:22:26 +07:00
Caleb Mazalevskis 55f3cededf Fix typo. (https://github.com/woocommerce/woocommerce-blocks/pull/11382) 2023-11-14 13:11:14 +13:00
Parikshit Adhikari 9b1ca0707a fixed multiple typos inside docs (https://github.com/woocommerce/woocommerce-blocks/pull/11426) 2023-11-14 13:10:47 +13:00
Max Kohler 7cea7de7dd Update codex link (https://github.com/woocommerce/woocommerce-blocks/pull/11739) 2023-11-14 13:09:50 +13:00
Alex Florisca 4d90cb2803 Add storybook entries for RadioControl and RadioControlAccordion (https://github.com/woocommerce/woocommerce-blocks/pull/11657) 2023-11-13 17:12:46 +00:00
Mike Jolley e3d4996dad v11.5.4 Changelog and testing notes 2023-11-13 14:44:58 +00:00
Mike Jolley c93ee12770 Fix TT4 mobile styling for cart and notes field on checkout (https://github.com/woocommerce/woocommerce-blocks/pull/11742)
* Add box-sizing to textarea

* Fix cart mobile border
2023-11-13 12:52:29 +00:00
Mike Jolley 5bf57a90e1 Fix styling of Classic Cart and Checkout Blocks on regular pages (https://github.com/woocommerce/woocommerce-blocks/pull/11694)
* woocommerce_is_checkout/woocommerce_is_cart for classic shortcode block

* Add return to has_block_variation
2023-11-13 12:48:01 +00:00
Thomas Roberts 174c8e30ac Add `Textarea` entry to Storybook (https://github.com/woocommerce/woocommerce-blocks/pull/11635) 2023-11-13 11:52:46 +00:00
Alba Rincón 94b6c8b048 [CYS] Reduce the number of times the patterns dictionary is accessed (https://github.com/woocommerce/woocommerce-blocks/pull/11733)
* Load content and images on registration if the patterns is in the dictionary

* Stop getting the content from each pattern

* Add comment with explanation about the change
2023-11-13 09:27:59 +01:00
Niels Lange 1228e9bf83 Ensure that incompatible notices are displayed in Safari. (https://github.com/woocommerce/woocommerce-blocks/pull/11736) 2023-11-10 21:52:50 +01:00
Thomas Roberts abd32b21c9 Move `Panel` to components package (https://github.com/woocommerce/woocommerce-blocks/pull/11698) 2023-11-10 18:56:40 +00:00
Thomas Roberts 66fc4c5ea0 Add `FormStep` to Storybook (https://github.com/woocommerce/woocommerce-blocks/pull/11489) 2023-11-10 17:20:20 +00:00
Luigi Teschio 0d41c4df7e Add changelog Release 11.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/11697) 2023-11-10 16:50:15 +01:00
Tom Cafferkey 55f15c4912 PR Template: Add checklist item for browsers & viewports. (https://github.com/woocommerce/woocommerce-blocks/pull/11735) 2023-11-10 15:17:52 +00:00
Daniel Dudzic ff680940e4 Product Gallery Pager: Remove unnecessary margin (https://github.com/woocommerce/woocommerce-blocks/pull/11287) 2023-11-10 09:40:45 +01:00
Saad Tarhi 2182457673 Fix the Layout for Shipping and Billing Address Forms in the Checkout Block (https://github.com/woocommerce/woocommerce-blocks/pull/11486)
* Fix empty spaces in the address form

* Fix checkout layout for Japan and Hungary

* Added some comments in CSS
2023-11-10 08:07:49 +01:00
Tung Du d881fe208d Fix: different collection data request between editor and front end (https://github.com/woocommerce/woocommerce-blocks/pull/11710) 2023-11-10 11:04:49 +07:00
Saad Tarhi b8484850ff Merge changes from 11.4.7 2023-11-10 00:28:33 +01:00
Roy Ho ec8207e06c Product Gallery: Fix limited images displayed in the dialog (https://github.com/woocommerce/woocommerce-blocks/pull/11716)
* Product Gallery: Fix limited images displayed in the dialog

* Fix linting errors
2023-11-09 14:10:31 -08:00
Mike Jolley daea9f0fdf Fix address block invalidations in the editor and address card display in Firefox (https://github.com/woocommerce/woocommerce-blocks/pull/11714)
* Add checks to see if getCartData finished before rendering address

* Prevent block error due to excessive updates of customValidation

* Do not condense address in admin and handle phone field

* Add missing showPhoneField for billing

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-11-09 16:25:28 +00:00
Thomas Roberts f8f535fc1d Merge changes from 11.4.6 2023-11-09 15:38:14 +00:00
Mike Jolley 6d24efe009 onPaymentProcessing->onPaymentSetup (https://github.com/woocommerce/woocommerce-blocks/pull/11578)
* onPaymentProcessing->onPaymentSetup

* Missed a billingAddress
2023-11-09 11:47:49 +00:00
Thomas Roberts df27cbac96 Update Jetpack WooCommerce Analytics module integration to check for changed template names (https://github.com/woocommerce/woocommerce-blocks/pull/11707) 2023-11-09 03:34:17 -08:00
Karol Manijak 41d40f47c2 Remove author, sticky, parents attributes from the Product Collection block in patterns (https://github.com/woocommerce/woocommerce-blocks/pull/11673) 2023-11-09 09:21:11 +01:00
Karol Manijak 955332941e Translate Related Products heading in Single Product template (https://github.com/woocommerce/woocommerce-blocks/pull/11693)
* Create Related Products pattern reused in the Single Product template

That's needed in order to make the Related Products string translatable

* Add margin to Related Products heading

* Add margin to Related Products transformed from classic template

* Simplify the translation

* Change string capitalization so it's the same as the other one and can be transklated
2023-11-09 09:00:23 +01:00
Roy Ho 08b0ceff53 e2e: Add hacky workaround for product image gallery (https://github.com/woocommerce/woocommerce-blocks/pull/11655) 2023-11-08 13:55:35 -08:00
Albert Juhé Lluveras 419d4ed4fd Update readme.txt and testing notes for 11.5.1 2023-11-08 19:39:44 +01:00
Albert Juhé Lluveras 68e6b251b0 Add protection against wrong params in get_block_template_fallback() (https://github.com/woocommerce/woocommerce-blocks/pull/11690)
* Add protection towards wrong params in get_block_template_fallback()

* Improve protection
2023-11-08 17:33:37 +01:00
Michael Pretty f4d1372d06 Fix attempts to count possible non-countable variables or usage of undefined variables (https://github.com/woocommerce/woocommerce-blocks/pull/11473)
* Fix attempts to count possible non-countable variables or usage of undefined variables

This fixes a few miscellaneous small problems where a possibly undefined variable was attempted to be accessed or a variable that wasn't necessarily countable was passed to `count()`

These were found by running Rector with rules specific to finding issues with php8.

* Fixing lint spacing issue
2023-11-08 16:22:22 +00:00
Saad Tarhi c1d2695fb0 Skip template related E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/11700) 2023-11-08 16:35:45 +01:00
Alba Rincón 55a3e2d953 [CYS] Fix decoding issue and pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11681)
* Fix pattern description

* Decode the actual file content, not the filepath
2023-11-08 14:45:23 +01:00
Luigi Teschio 4ebea101c7 Use wp_post table instead wp_option to store patterns data generated by AI (https://github.com/woocommerce/woocommerce-blocks/pull/11659)
* Use wp_post table instead wp_option to store patterns data generated by AI

* avoid crash when there isn't any patterns_ai_data post type

* restore check

* remove unnecessary constant

* catch error

* pass boolean to return WP_Error
2023-11-08 12:14:37 +01:00
Thomas Roberts b2efba9fef Add `SortSelect` to Storybook (https://github.com/woocommerce/woocommerce-blocks/pull/11618) 2023-11-08 11:13:49 +00:00
Thomas Roberts 7d4fc482fd Add storybook entry for `CheckboxList` (https://github.com/woocommerce/woocommerce-blocks/pull/11469) 2023-11-08 02:55:48 -08:00
Thomas Roberts fcdfcc2123 Add `Spinner` storybook entry (https://github.com/woocommerce/woocommerce-blocks/pull/11622) 2023-11-08 10:54:29 +00:00
Manish Menaria 033a92d536 Product Collection: Add support for filtering products by featured status (https://github.com/woocommerce/woocommerce-blocks/pull/11522)
* Add support for filtering products by featured status

- Added `featured` attribute to `ProductCollectionQuery` type to enable filtering by featured status.
- Implemented `FeaturedProductsControl` to provide a toggle option in the inspector controls.
- Integrated `FeaturedProductsControl` into `ProductCollectionInspectorControls`.
- Added `get_featured_query` function in `ProductCollection` class to generate query for fetching featured products.
- Updated existing functions and queries in `ProductCollection` class to support featured products filtering.

* Revert changes to composer.lock

* Refactor handling of 'featured' parameter

This commit makes the handling of the 'featured' parameter consistent in the ProductCollection class. Previously, the 'featured' parameter was being type-casted to boolean, which was not necessary and could lead to incorrect results. Now, the 'featured' parameter is used directly without type-casting, and the check for 'featured' products in the get_featured_query method has been updated accordingly. This ensures that the 'featured' parameter is handled consistently and correctly throughout the class.

* Handle undefined 'featured' index

This commit adds null coalescing operator to handle the case when 'featured' index is not set in the $query array. This prevents potential PHP notices or errors that may arise when trying to access an undefined index.
2023-11-08 15:37:32 +05:30
Lucio Giannotta 64b44f8ebd Rename 1145 to 1145.md 2023-11-08 17:31:20 +08:00
Lucio Giannotta ff9a98156b Update readme and testing notes for 11.4.5 2023-11-08 17:07:16 +08:00
Manish Menaria b177aa9048 Product Collection - Add `Created` filter in inspector controls (https://github.com/woocommerce/woocommerce-blocks/pull/11562)
* Add time frame filter to Product Collection block

This commit introduces the ability to filter products within the Product Collection block by a specified time frame. The changes include:

- A new 'timeFrame' property added to the DEFAULT_QUERY constant in constants.ts, initialized as null, allowing for the storage of time frame data.
- Creation of a new component `CreatedControl` in created-control.tsx that provides UI elements for selecting a time frame filter.
- Inclusion of `CreatedControl` in the Product Collection Inspector Controls.
- Expansion of the ProductCollectionQuery interface in types.ts to include a 'timeFrame' attribute.
- Addition of the 'timeFrame' parameter handling within the ProductCollection PHP class to construct and execute the date query based on the provided time frame.

The addition of the time frame filter offers enhanced flexibility in presenting products and allows users to dynamically segment their product lists based on product creation dates.

* Refactor: Standardize 'timeFrame' to be 'undefined' instead of 'null'

This commit includes a refactoring that changes the initialization and reset values for the `timeFrame` property from `null` to `undefined`. This standardization affects the constants, type definitions, and the handling of the `timeFrame` property in both the inspector controls and the PHP backend.

* Switch date query to use post_date_gmt for DST consistency

This commit changes the column reference in the date query from 'post_date' to 'post_date_gmt'. This update ensures that the product collection filtering is based on Coordinated Universal Time (UTC) rather than local time, which can be affected by Daylight Saving Time (DST) shifts. The modification will lead to more consistent and reliable behavior across different time zones and during DST changes.

* Capitalize toggle group labels

The following adjustments have been made:
- Introduced a constant `uppercaseStyle` to store the `{ textTransform: 'uppercase' }` style.
- Applied `uppercaseStyle` to both the 'IN' and 'NOT IN' toggle options to ensure label text is consistently uppercase.
- Updated the 'Not in' label text to uppercase ('NOT IN') to match the newly applied style.

These changes ensure that the toggle labels align with the design guidelines that call for uppercase styling in control elements.

* Make first letter of first work capital

* Rename to Within & Before

* Update i18n for Product Collection query operators

This commit updates the internationalization (i18n) for the Product Collection query operators in the 'Created' control component of the WooCommerce Blocks plugin. It replaces the '__' function with '_x' for translation and provides context comments for better translation handling. This improvement enhances the localization of the query operators for better multilingual support.
2023-11-08 14:32:49 +05:30
Tom Cafferkey 3f98449f90 MiniCart: Check that data is countable before counting (https://github.com/woocommerce/woocommerce-blocks/pull/11658) 2023-11-08 08:36:27 +00:00