Commit Graph

5248 Commits

Author SHA1 Message Date
Daniel W. Robert 9f87afde32 Apply further optimizations to pattern images. (https://github.com/woocommerce/woocommerce-blocks/pull/9803)
Ran images through imagemin with the pngquant plugin to reduce the file
sizes for our pattern images.
2023-06-12 22:22:44 -04:00
Daniel Dudzic 0a23aca517 Mini Cart: Add an alternative icon setting (https://github.com/woocommerce/woocommerce-blocks/pull/9570)
* Mini Cart: Add an icon setting with 3 alternative icon options. Closes woocommerce/woocommerce-blocks#8556.

* Mini Cart: Fix Mini-cart icons in the toggle setting.

* Minor type fixes.

* Clean up type definitions.

* Move alt icon logic to a separate function.

* Fix cart icons sizes

* Add a negative margin to the mini cart icon
2023-06-12 22:23:52 +02:00
Karol Manijak b7f1ac2b4e Add alt text to images used in patterns describing their purpose (https://github.com/woocommerce/woocommerce-blocks/pull/9788)
* Add alt text to images used in patterns describing their purpose

* Replace 1/3 notation with 1 out of 3, so it's better handled byt screen readers
2023-06-12 19:34:03 +02:00
Karol Manijak 42e95d1c54 Change the way of debug check of tests-mysql container (https://github.com/woocommerce/woocommerce-blocks/pull/9794) 2023-06-12 19:00:27 +02:00
Alexandre Lara 06a9b274c1 WooCommerce Classic Template block: Fix error on clearing customizations on Woo Templates (https://github.com/woocommerce/woocommerce-blocks/pull/9759)
* Fix Classic Template block error on clearing customizations on template

* Add link to issue in JS Doc
2023-06-12 13:55:20 -03:00
Hritik Chaudhary e17221ac79 Removed proptypes and js to ts conversion for Product Categories (https://github.com/woocommerce/woocommerce-blocks/pull/9755)
* Removed proptypes from product-categories

* deleted js file
2023-06-12 18:52:21 +02:00
Karol Manijak 1e849ff3c3 Disable the debug check of tests-mysql to let PHP unit tests pass (https://github.com/woocommerce/woocommerce-blocks/pull/9791) 2023-06-12 17:20:04 +02:00
Alba Rincón ae4757a53f Port to trunk testing notes and readme from 10.2.3 2023-06-09 16:33:08 +02:00
Albert Juhé Lluveras 0be2ef2d84 Fix capitalization in Product Collections: Newest Arrivals pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9777) 2023-06-09 16:04:53 +02:00
Albert Juhé Lluveras a89a229b37 Prevent Mini-Cart table to show horizontal scrollbar (https://github.com/woocommerce/woocommerce-blocks/pull/9676) 2023-06-09 10:48:23 +02:00
Alba Rincón 2b5c73d47e Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9770) 2023-06-09 09:41:15 +02:00
Alba Rincón bc00fbd22b Update hero product pattern title (https://github.com/woocommerce/woocommerce-blocks/pull/9769) 2023-06-09 09:18:30 +02:00
Daniel W. Robert 13a48fb62e Update Images for the Product Details Patterns (https://github.com/woocommerce/woocommerce-blocks/pull/9764)
* Update image for the Product Hero pattern.

Replace the Unsplash image with a CCO licensed image from Pxhere.

* Update images for Prod List Gallery Desc pattern

Replace the Unsplash image with a CCO licensed image from Pxhere for the
Product Listing with Gallery and Description pattern.

* Remove unneeded Unsplash images.

* Update copy for Prod Listing Gallery Desc pattern.

* Optimize new image exports.

* Update image for the Product Listing pattern.

Replace the Unsplash image with a CCO licensed image from Pxhere.

* Update images for Product Details pattern.

Replace the Unsplash images with CCO licensed images from Pxhere.

* Remove unneeded Unsplash image.

* Use Relative URLs for Images in the Product Listing Pattern

This commit replaces hardcoded URLs with dynamic ones for image placeholders in the `product-listing-with-gallery-and-description.php` pattern file.

- The `plugins_url()` function is now used to generate URLs, which correctly points to the images folder within the WooCommerce Blocks plugin directory. This approach provides better flexibility and portability since it doesn't rely on a specific domain or path. The `esc_url()` function is used to ensure the URL is safe to use in the HTML context.

- The change is made for a total of four images in the pattern.

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-06-09 12:13:19 +05:30
Roy Ho 1041bce0e4 Update/patterns featured category product collection (https://github.com/woocommerce/woocommerce-blocks/pull/9765)
* Update image for featured category focus pattern

* Update image for featured category cover image pattern

* Update images for featured category triple pattern

* Change to wide width

* Update links to buttons

* Fix typo in hex color value.

There was an extra `f` in the hex color value, causing the text to
unexpectedly render black.

---------

Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>
2023-06-09 00:37:25 -04:00
Roy Ho f4da27ca56 Update/collection pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9766)
* Update featured collections images

* Add shop link to shop by price pattern
2023-06-09 00:07:52 -04:00
Alba Rincón 49a98abef2 Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9763) 2023-06-08 16:30:23 -04:00
Alba Rincón d78c5e57ef Update Chessboard pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9761) 2023-06-08 16:28:00 -04:00
Alba Rincón 0aa4ba69d0 Updathe the Hero Product Split (https://github.com/woocommerce/woocommerce-blocks/pull/9762) 2023-06-08 16:27:48 -04:00
Daniel W. Robert 43b6f62ad0 Update Banner Pattern To Replace Unsplash Image (https://github.com/woocommerce/woocommerce-blocks/pull/9760)
* Update Banner to replace Unsplash image.

Replaces the Unsplash image with a CCO licensed image from Pxhere. Also
updates the CTA button to link to the Shop page, by default.

* Remove extra padding from top of test column.

Vertical alignment was off on the text column due to 60px of top
padding. This aligns everythign, as expected.
2023-06-08 16:00:55 -04:00
Alba Rincón 9aa1e3448f Update Hero Product 3-split pattern image 2023-06-08 21:41:35 +02:00
Roy Ho 8e94500136 Use correct SVG for RTL display (https://github.com/woocommerce/woocommerce-blocks/pull/9756) 2023-06-08 11:29:34 -07:00
Roy Ho bb60a90f5c Convert product-orderby-control to use typescript (https://github.com/woocommerce/woocommerce-blocks/pull/9751) 2023-06-08 05:56:57 -07:00
Tarun Vijwani 27ba84cd84 Update version number to 10.5.0-dev 2023-06-08 15:31:29 +04:00
Tarun Vijwani ac99027225 Cherry pick updated 10.4.0 testing steps 2023-06-08 14:53:22 +04:00
Tarun Vijwani 0833316129 Cherry-pick 10.4.0 testing steps 2023-06-08 14:51:50 +04:00
Tarun Vijwani 8bcbeb8c0e Cherry-pick 10.4.0 changelogs 2023-06-08 14:43:54 +04:00
Albert Juhé Lluveras aa912e31a8 Fix the order of enqueued scripts in the Mini-Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/9749)
* Fix the order of enqueued scripts in the Mini-Cart block

* Use again wp_script_is() to detect is a script has been enqueued or not
2023-06-08 10:37:00 +02:00
Manish Menaria d91385e3b9 Product Collection: Hand picked products control in sidebar settings (https://github.com/woocommerce/woocommerce-blocks/pull/9733)
* Add support for hand-picked products in Product Collection block

This commit introduces the ability to manually select specific products in the Product Collection block.

Changes include:
- Added `woocommerceHandPickedProducts` to the `ProductCollectionQuery` and `DEFAULT_FILTERS` in `constants.ts`.
- Created a new control file `hand-picked-products-control.tsx` which introduces a token field where the user can search for and select specific products.
- Included `HandPickedProductsControl` in the Product Collection block's inspector controls in `index.tsx`.
- Updated `ProductCollectionQuery` in `types.ts` to accommodate handpicked products.
- Updated the PHP `ProductCollection` class to handle the hand-picked products query parameters.

These changes allow users to hand-pick products to be displayed in the Product Collection block. This allows for greater customization of the products shown in the block.

* Enhance handling of hand-picked products

- A Set data structure is now used to store 'newHandPickedProducts' instead of an Array, which will help prevent duplicate entries.
- Additionally, the suggestions for products to be hand-picked now excludes already selected products, enhancing the user experience by avoiding redundancy in the suggestions list.
- Lastly, the function name 'displayTransform' has been changed to 'transformTokenIntoProductName' to more accurately reflect its purpose, which is to transform a token into a product name.

* Update import & export of HandPickedProductsControl
2023-06-08 06:03:01 +00:00
Manish Menaria 1814bc95e5 Product Collection: Add author filter in sidebar settings (https://github.com/woocommerce/woocommerce-blocks/pull/9736)
* Add author filter to ProductCollection block

This commit adds an author filter to the ProductCollection block in WooCommerce Blocks.

- A new file, `author-control.tsx`, has been created inside the `inspector-controls` directory of the `product-collection` block. This file contains the React component for the author filter, which fetches the list of authors from the WordPress database using `useEntityRecords`. The filter provides an interface for selecting authors whose products should be displayed in the ProductCollection block.

- The author filter is added to the main component of the `inspector-controls` in `index.tsx`.

- In `ProductCollection.php`, the 'author' parameter is now included in the product query. This allows products from a specific author to be displayed in the ProductCollection block, depending on the user's selection in the Gutenberg editor.

This addition enhances the functionality of the ProductCollection block by allowing site administrators to create more customized and targeted displays of products.

* Update error handling

* Refactor 'Author' interfaces and fix offset calculation

This commit refactors the 'Author' interfaces in the 'author-control.tsx' file. The interface 'AuthorsMapping' has been removed and its properties have been merged into 'AuthorsInfo' for simplicity and maintainability.

In the PHP file 'ProductCollection.php', the offset calculation logic has been improved to handle pagination correctly. Now, the offset is calculated as '(per_page * (page - 1)) + offset', which correctly accounts for both the page number and the offset when determining the starting point for the product query.
2023-06-08 11:10:05 +05:30
Alba Rincón 06a0ab94ce Render the single product title as an h1 (https://github.com/woocommerce/woocommerce-blocks/pull/9748) 2023-06-07 15:47:56 +02:00
Roy Ho 70e3533467 Prevent showing edit product details link when in multiple products context (https://github.com/woocommerce/woocommerce-blocks/pull/9741) 2023-06-07 05:43:04 -07:00
Hritik Chaudhary af09b0c9b8 Removed proptypes from grid-content-control (https://github.com/woocommerce/woocommerce-blocks/pull/9713)
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-06-07 13:22:50 +02:00
Thomas Roberts aa1fe5c308 Add text limit to payment method descriptions in the page editor (https://github.com/woocommerce/woocommerce-blocks/pull/9708)
* Convert summary/utils to TS

* Add @wordpress/wordcount type defs

* Move trimWords, trimCharacters, remoteTags & appendMoreText to own file

* Add tests for trimWords and related functions

* Trim payment method description if it is longer than 30 words
2023-06-07 02:29:15 -07:00
Alba Rincón cbfd2977dd [Patterns] Update button color for `Hero Product 3 Split` (https://github.com/woocommerce/woocommerce-blocks/pull/9467)
* Add color to the search button, fix php notices

* Update button color

* Update button color

* Update button color

* Update button color

* Update button color

* Remove WooCommerce from the name to follow standards

* Remove colors from buttons in patterns without hardcoded bg color
2023-06-07 10:10:07 +02:00
Tom Cafferkey 24a293bde7 Fix/escape add query arg template url (https://github.com/woocommerce/woocommerce-blocks/pull/9715)
* Escape postId for template part within MiniCart

* Escape  url

* Change esc_url to esc_url_raw
2023-06-06 16:42:19 +01:00
Roy Ho dc6fa4a8c9 Fix value without onchaning warning (https://github.com/woocommerce/woocommerce-blocks/pull/9727) 2023-06-06 06:04:40 -07:00
Hritik Chaudhary 93119e9de6 Remove propTypes definitions from All Reviews block (https://github.com/woocommerce/woocommerce-blocks/pull/9631)
* converted all-reviews block to tsx and removed proptypes

* Update assets/js/blocks/reviews/all-reviews/index.tsx

Co-authored-by: Niels Lange <niels.lange@a8c.com>

* Update assets/js/blocks/reviews/all-reviews/edit.tsx

Co-authored-by: Niels Lange <niels.lange@a8c.com>

* Update assets/js/blocks/reviews/all-reviews/block.tsx

Co-authored-by: Niels Lange <niels.lange@a8c.com>

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Niels Lange <niels.lange@a8c.com>
2023-06-06 14:46:49 +02:00
dependabot[bot] 525bd58c74 Bump mockery/mockery from 1.5.1 to 1.6.1 (https://github.com/woocommerce/woocommerce-blocks/pull/9728)
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.5.1 to 1.6.1.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/1.6.1/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.5.1...1.6.1)

---
updated-dependencies:
- dependency-name: mockery/mockery
  dependency-type: direct:development
  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>
2023-06-06 10:27:55 +02:00
Alba Rincón 643bdbe4df [Patterns] Add new `Footer with Simple Menu and Cart` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9176)
* Add new `Footer with Simple Menu and Cart` pattern

* Remove ref, overlay off

* Improve search, navigation and separator

* Improve the mobile view

* Make string translatable
2023-06-06 08:56:20 +02:00
Luigi Teschio a69f0874e5 Single Product Template: fix Compatibility Layer when the template implements the Single Product Template (https://github.com/woocommerce/woocommerce-blocks/pull/9723) 2023-06-05 17:48:36 +02:00
Luigi Teschio a27787fb17 Product rating: improve preview style when the product doesn't have rating (https://github.com/woocommerce/woocommerce-blocks/pull/9684)
* product rating: improve preview style when no rating is visible

* fix class naming

* fix cutted star

* change variable

* fix cut border
2023-06-05 17:27:55 +02:00
Alexandre Lara 27275b913e Refactor: Add useIsDescendentOfSingleProductTemplate hook (https://github.com/woocommerce/woocommerce-blocks/pull/9657)
* Add useIsDescendentOfSingleProductTemplate hook

* Replace logic with useIsDescendentOfSingleProductTemplate hook
2023-06-05 12:13:28 -03:00
Tom Cafferkey 0f59e3f698 Checkout block: Full width Place Order button when Return To Cart link is disabled. (https://github.com/woocommerce/woocommerce-blocks/pull/9721)
* When the Return To Cart link is disabled, make Place Order button full width

* Optional prop fullWidth has undefined type added to it
2023-06-05 15:31:32 +01:00
dependabot[bot] 3d853d77d5 Bump automattic/jetpack-autoloader from 2.11.19 to 2.11.21 (https://github.com/woocommerce/woocommerce-blocks/pull/9639)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.19 to 2.11.21.
- [Release notes](https://github.com/Automattic/jetpack-autoloader/releases)
- [Changelog](https://github.com/Automattic/jetpack-autoloader/blob/trunk/CHANGELOG.md)
- [Commits](https://github.com/Automattic/jetpack-autoloader/compare/v2.11.19...v2.11.21)

---
updated-dependencies:
- dependency-name: automattic/jetpack-autoloader
  dependency-type: direct:production
  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-06-05 16:24:44 +02:00
dependabot[bot] 01ad02ffbe Bump tj-actions/branch-names from 6 to 7 (https://github.com/woocommerce/woocommerce-blocks/pull/9688)
Bumps [tj-actions/branch-names](https://github.com/tj-actions/branch-names) from 6 to 7.
- [Release notes](https://github.com/tj-actions/branch-names/releases)
- [Changelog](https://github.com/tj-actions/branch-names/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/branch-names/compare/v6...v7)

---
updated-dependencies:
- dependency-name: tj-actions/branch-names
  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-06-05 16:22:55 +02:00
dependabot[bot] d14bd2f605 Bump dependabot/fetch-metadata from 1.4.0 to 1.5.1 (https://github.com/woocommerce/woocommerce-blocks/pull/9689)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.4.0 to 1.5.1.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.4.0...v1.5.1)

---
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>
2023-06-05 16:21:17 +02:00
Roy Ho 5a5d5d315a Make mini cart icon RTL on RTL sites in editor (https://github.com/woocommerce/woocommerce-blocks/pull/9707)
* Make mini cart icon RTL on RTL sites in editor

* Use BEM convention
2023-06-05 06:36:57 -07:00
Alba Rincón 4cd22fb705 Create `Customer account` block e2e playwright tests (https://github.com/woocommerce/woocommerce-blocks/pull/9505)
* Create customer account block playwright tests

* Refactor after review

* Refacto after review
2023-06-05 14:39:11 +02:00
Luigi Teschio 4c3cb1ab17 Enable Single Product block (https://github.com/woocommerce/woocommerce-blocks/pull/9714)
* Enable Single Product block

* Single Product Block: remove experimental build flag
2023-06-05 12:11:21 +00:00
Luigi Teschio 5b862f3fb1 Product Rating: fix the filter woocommerce_product_get_rating_html is removed (https://github.com/woocommerce/woocommerce-blocks/pull/9719) 2023-06-05 13:41:35 +02:00