Commit Graph

6231 Commits

Author SHA1 Message Date
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
Luigi Teschio 948fc1ac53 Filter By Rating: fix overlapping stars (https://github.com/woocommerce/woocommerce-blocks/pull/11644) 2023-11-07 10:59:36 +00:00
Mike Jolley a0bb87ed07 Restore checkout header which was reverted in cd7704b0ef (https://github.com/woocommerce/woocommerce-blocks/pull/11647) 2023-11-07 10:58:00 +00:00
Tung Du 73f9b997cc Collection Filters refactor: data fetching, context passing, and code organization (https://github.com/woocommerce/woocommerce-blocks/pull/11476) 2023-11-07 14:55:23 +07:00
Alex Florisca ded7d20c51 Fix the link to latest PRs on github nightly workflow (https://github.com/woocommerce/woocommerce-blocks/pull/11616) 2023-11-06 17:11:20 +00:00
Paulo Arromba 2a71627e36 Enhancement/New blockified Order Confirmation on new installs with block-based themes (https://github.com/woocommerce/woocommerce-blocks/pull/11615)
* Use new blockified Order Confirmation on blocks themes

* Handle translations on the new blockified Order Confirmation
2023-11-06 15:51:04 +00:00
Albert Juhé Lluveras 33bc75801e Add to Cart with Options block: fix inconsistency between editor and frontend (https://github.com/woocommerce/woocommerce-blocks/pull/11614)
* Add to Cart with Options block: fix inconsistency between editor and frontend

* Typo

* Use same margin values as block theme stylesheet
2023-11-06 16:30:25 +01:00
Roy Ho 4cdffc3b07 Product Gallery: Add e2e tests for crop image option (https://github.com/woocommerce/woocommerce-blocks/pull/11559) 2023-11-06 07:17:25 -08:00
Alba Rincón 0d538020a3 Fix 3-split pattern text content (https://github.com/woocommerce/woocommerce-blocks/pull/11612) 2023-11-06 11:43:47 +01:00
Thomas Roberts 614fc3dba6 Ensure input is validated when autofilled in Firefox (https://github.com/woocommerce/woocommerce-blocks/pull/11062) 2023-11-06 01:35:19 -08:00
Tung Du a52234e757 Fix: Make filter block contextual - Editor (https://github.com/woocommerce/woocommerce-blocks/pull/11218) 2023-11-06 14:14:58 +07:00
Albert Juhé Lluveras 51e04d0373 Prevent theme button border appearing in opinionated patterns (https://github.com/woocommerce/woocommerce-blocks/pull/11564) 2023-11-04 09:14:28 +01:00
Thomas Roberts 35c0d69206 Add legacy hooks documentation (https://github.com/woocommerce/woocommerce-blocks/pull/11575) 2023-11-03 17:06:35 +00:00
dependabot[bot] 88473a7875 Bump richardsimko/github-tag-action from 1.0.7 to 1.0.11 (https://github.com/woocommerce/woocommerce-blocks/pull/11530)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-03 09:37:20 -07:00
Mike Jolley 67f341899d Add back missing render-checkout-form hook (https://github.com/woocommerce/woocommerce-blocks/pull/11554) 2023-11-03 16:30:40 +00:00
Mike Jolley 504a15350f Docs: Update examples to use window global imports (https://github.com/woocommerce/woocommerce-blocks/pull/11577)
* Updating examples to use window global imports

* Remove incorrect package import description
2023-11-03 16:30:19 +00:00
dependabot[bot] 84e08e0522 Bump actions/setup-node from 3 to 4 (https://github.com/woocommerce/woocommerce-blocks/pull/11529)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-03 08:06:34 -07:00
dependabot[bot] 7b146c018f Bump @wordpress/i18n from 4.31.0 to 4.45.0 (https://github.com/woocommerce/woocommerce-blocks/pull/11572)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-03 07:23:03 -07:00
Alba Rincón aa2367a274 Add margin bottom to the `Hero Product 3 Split` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11573)
* Add margin bottom to the hero-product-3-split pattern

* Add margin top
2023-11-03 14:20:56 +01:00
Alba Rincón ccbaab255c Set explicit margins in the search bar group (https://github.com/woocommerce/woocommerce-blocks/pull/11571) 2023-11-03 14:08:19 +01:00
Alba Rincón a8dd2c9bf2 Add aspect ratio to the `Featured Products 5 Columns` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11570) 2023-11-03 14:08:10 +01:00
dependabot[bot] ad489cff36 Bump @wordpress/element from 4.20.0 to 5.22.0 (https://github.com/woocommerce/woocommerce-blocks/pull/11548)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-03 05:28:53 -07:00
dependabot[bot] 8a946cfa08 Bump @wordpress/dependency-extraction-webpack-plugin from 4.6.0 to 4.28.0 (https://github.com/woocommerce/woocommerce-blocks/pull/11549)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-03 04:32:19 -07:00
Darren Ethier 504b88490b Fix spelling issues in prompt. (https://github.com/woocommerce/woocommerce-blocks/pull/11546)
In the AI prompt, there are spelling issues:

- `bellow` instead of `below`
- `json` instead of `JSON`

Unclear if this would impact responses but should be fixed regardless.
2023-11-03 07:17:52 -04:00
Albert Juhé Lluveras c902a215d1 Prevent Sale badge overflowing the Product Image in some product grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/11556) 2023-11-03 09:42:40 +01:00
Daniel Dudzic f74aafe1bf Product Gallery Thumbnails: Add View all overlay (https://github.com/woocommerce/woocommerce-blocks/pull/11087)
* Product Gallery Thumbnails: Add View All link to the last thumbnail (non-interactive)

* Product Gallery Thumbnails: Add interactivity to the View All overlay

* Product Gallery Thumbnails: Refactor View all html to make it more readable

* Product Gallery Thumbnails: Fix woocommerce/woocommerce-blocks#11100 - Load all thumbnails and hide the View all overlay when in Dialog

* Product Gallery Thumbnails: Fix woocommerce/woocommerce-blocks#11099 - Enable the dialog for the View all thumbnails overlay even when the 'Full-screen when clicked' setting is disabled

* Product Gallery Thumbnails: Remove unnecessary concatenation from the View all html

* Product Gallery Thumbnails: Abstract the View All conditions into separate functions for readability

* Product Gallery Thumbnails: Add escaping to the View all plain text string

* E2E: Fix the Sale Badge and Single Product Template tests by selecting the first Sale Badge
2023-11-02 21:05:20 +01:00
Daniel Dudzic 5ccfecef60 Footer with 2 Menus Dark pattern: Fix color contrast issue in TT4 (https://github.com/woocommerce/woocommerce-blocks/pull/11484) 2023-11-02 20:40:48 +01:00