Commit Graph

6157 Commits

Author SHA1 Message Date
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
Lucio Giannotta 82e8079c06 Fix Single Product Classic Template block not showing on the front-end (https://github.com/woocommerce/woocommerce-blocks/pull/11455)
In WordPress 6.4, it appears that the global `have_posts` is `false` in
the context of the full site editing single product template. This
breaks the Classic Template block.

In this commit, we are creating a custom query using the available id
instead of relying on the global query.

This might be a temporary workaround as we are waiting to see
if that's an issue that core is willing to fix, as it might affect
backwards-compatibility for other vendors.
2023-11-08 08:23:26 +01:00
Karol Manijak a2103ed8fd Update Feedback Prompt styles by removing horizontal margin causing scroll to show up (https://github.com/woocommerce/woocommerce-blocks/pull/11619) 2023-11-07 21:54:35 +01:00
Daniel Dudzic 50a224bca3 Product Button: Remove the hardcoded width and padding (https://github.com/woocommerce/woocommerce-blocks/pull/11537)
* Product Button: Remove the hardcoded width in favor of additional margin for :before and :after

* Product Button: Remove :after and :before margin
2023-11-07 17:46:20 +00:00
Paulo Arromba 03cb6742f4 Merge remote-tracking branch 'origin/trunk' into trunk 2023-11-07 15:34:58 +00:00
Alexandre Lara 1f1c252617 Product Gallery block: Disable zoom when hovering the Next/Previous buttons (https://github.com/woocommerce/woocommerce-blocks/pull/11538)
* Disable zoom when hovering next/previous buttons

* Improve logic to disable zoom when not hovering over the large image
2023-11-07 12:34:41 -03:00
Paulo Arromba 544c0391e7 Updated readme.txt with 11.4.4 2023-11-07 15:34:21 +00:00
Paulo Arromba 6989e8ddd7 Testing notes 2023-11-07 15:33:12 +00:00
Daniel W. Robert 656ca123bf Rename Centered Header Menu with Search pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11637)
* Rename Centered Header Menu with Search pattern

Since the search bar has been removed from this pattern, this PR renames
the pattern title and slug to reflect that change.

* Rename file to reflect search removal.

Remove `search` from the filename, as this no longer reflects the
pattern.
2023-11-07 10:00:53 -05:00
Alba Rincón 7a1d9bfc60 Add missing condition to avoid a php warning when 'plugins' is not set (https://github.com/woocommerce/woocommerce-blocks/pull/11652) 2023-11-07 15:05:28 +01:00
Mike Jolley fa74c79a25 11.6.0-dev bump (https://github.com/woocommerce/woocommerce-blocks/pull/11653) 2023-11-07 14:05:16 +00:00
Luigi Teschio 3bde3b174a Fix pattern route performance (https://github.com/woocommerce/woocommerce-blocks/pull/11535)
* fix pattern route performance

* update namespace

* improve middleware

* improve ProductSchema

* improve error handling

* update identifier

* fix middleware

* update description

* use schema to return the response

* Break down the generate_content method and create the new fetch_dummy_products_to_update method for handling the fetch of dummy products to be updated.

* Ensure the Product endpoint relies on the fetch_dummy_products_to_update method for fetching dummy products to avoid code repetition and add safety checks and handle errors in case certain properties are not available.

* Add error handling for the Products endpoint.

* Remove memory limit increase and update docblocks.

* re-add set_time_limit

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-11-07 14:50:19 +01:00
Thomas Roberts 61b1272d8a Add `Title` entry to Storybook (https://github.com/woocommerce/woocommerce-blocks/pull/11636)
* Export TitleProps interface for use on storybook

* Add Storybook entry for Title
2023-11-07 13:45:38 +00:00
Paulo Arromba b3b52dbff4 Fix Playwright E2E tests - SideEffects (https://github.com/woocommerce/woocommerce-blocks/pull/11638)
* Removed span text and test
2023-11-07 11:50:59 +00:00