Commit Graph

5033 Commits

Author SHA1 Message Date
Siddharth Thevaril 50f08e6143 fix/8946: replace ToggleGroupControl with ToggleControl (https://github.com/woocommerce/woocommerce-blocks/pull/9098)
* replace ToggleGroupControl with ToggleControl

* eslint fix

* Fix linting in assets/js/mini-cart/edit.tsx file

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-04-19 17:45:48 +02:00
Albert Juhé Lluveras 022e532688 WC Blocks 9.9.0 testing steps: move woocommerce/woocommerce-blocks#8781 testing steps to Feature Plugin section 2023-04-19 15:22:59 +02:00
Dharmesh Patel 4743d4fd93 fix/8363: Match checkout block Place order button UI with frontend (https://github.com/woocommerce/woocommerce-blocks/pull/9094)
Co-authored-by: Niels Lange <info@nielslange.de>
2023-04-19 14:09:06 +01:00
Albert Juhé Lluveras 114dc821ae Update step to mention that patch releases need to be merged into the base branch (https://github.com/woocommerce/woocommerce-blocks/pull/9097)
* Update step to mention that patch releases need to be merged into the base branch

* Minor improvements
2023-04-19 14:01:27 +02:00
Dharmesh Patel dcaf20a7c9 Fix - "Order received" page does not display the payment method information. (https://github.com/woocommerce/woocommerce-blocks/pull/9092)
* Fix - "Order received" page does not display the payment method information.

* changed fix approach by explicitly set payment method title.

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-04-19 12:23:20 +01:00
Albert Juhé Lluveras f92a4d8a13 Filter Products by Attribute e2e test: wait until networkidle before running tests (https://github.com/woocommerce/woocommerce-blocks/pull/9083)
* Wait until networkidle before running tests

* Copy logic to select first attribute from PHP classic template tests

* Create util function to insertProductByAttributeBlockWithFirstAttribute
2023-04-19 10:19:49 +02:00
Albert Juhé Lluveras 33f5bef3f0 Add 10.0.2 testing steps 2023-04-19 10:10:58 +02:00
Albert Juhé Lluveras 4e8bac92b2 Add 10.0.2 changelog 2023-04-19 10:10:49 +02:00
Karol Manijak 21269963e8 Get product by ID if there's more products returned from useStoreProducts (https://github.com/woocommerce/woocommerce-blocks/pull/9079)
* Get product by ID if there's more products returned from useStoreProducts
2023-04-19 09:52:16 +02:00
Luigi Teschio 4fbf32cef6 Product SKU: fix product SKU when added in the product meta block (https://github.com/woocommerce/woocommerce-blocks/pull/8966) 2023-04-19 07:47:03 +00:00
Luigi eb0d30c248 Merge branch 'release/10.0.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-04-19 09:19:19 +02:00
Darren Ethier 732827e60b Fix broken post/page editor screens in WordPress versions earlier than 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9090)
* Fix infinite loop (range error) on subscribe callback.

* Replace getEditedPostContext with getEditedPostId to retrieve the templateId from the Site Editor for 6.1.1 compatibility

---------

Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
2023-04-19 09:08:40 +02:00
dependabot[bot] fbfc3a8d87 Bump wp-phpunit/wp-phpunit from 6.1.1 to 6.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8935)
Bumps [wp-phpunit/wp-phpunit](https://github.com/wp-phpunit/wp-phpunit) from 6.1.1 to 6.2.0.
- [Release notes](https://github.com/wp-phpunit/wp-phpunit/releases)
- [Commits](https://github.com/wp-phpunit/wp-phpunit/compare/6.1.1...6.2.0)

---
updated-dependencies:
- dependency-name: wp-phpunit/wp-phpunit
  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-04-18 15:28:38 +02:00
Karol Manijak f3c28b9d78 Pass proper data to On Sale badge when used in the scope of Product Image (https://github.com/woocommerce/woocommerce-blocks/pull/9021)
* Don't use withProductDataContext in Sale Badge block

There was no information about product passed to the block, so it fetched information about all products which then wasn't even used

* Pass necessary props to the Sale Badge so it doesn't overfetch unnecessary data

* Move the import to the previous place
2023-04-18 14:53:50 +02:00
dependabot[bot] cbec25c463 Bump @wordpress/browserslist-config from 5.0.0 to 5.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/9087)
Bumps [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) from 5.0.0 to 5.14.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/browserslist-config/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/browserslist-config@5.14.0/packages/browserslist-config)

---
updated-dependencies:
- dependency-name: "@wordpress/browserslist-config"
  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-04-18 14:51:47 +02:00
dependabot[bot] a3db0c9e78 Bump AbleLincoln/push-to-sftp from 1.2 to 2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8597)
Bumps [AbleLincoln/push-to-sftp](https://github.com/AbleLincoln/push-to-sftp) from 1.2 to 2.0.
- [Release notes](https://github.com/AbleLincoln/push-to-sftp/releases)
- [Commits](https://github.com/AbleLincoln/push-to-sftp/compare/v1.2...v2.0)

---
updated-dependencies:
- dependency-name: AbleLincoln/push-to-sftp
  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-04-18 14:49:47 +02:00
github-actions[bot] 94a0ba2887 Release: 10.0.1 (https://github.com/woocommerce/woocommerce-blocks/pull/9084)
* Single Product Template - Compatibility Layer: don't skip custom HTML (https://github.com/woocommerce/woocommerce-blocks/pull/9075)

* Fix: tax_query should be calculated only if __woocommerceAttributes is valid (https://github.com/woocommerce/woocommerce-blocks/pull/9049)

This commit refactors the update_rest_query method in the ProductQuery.php file to improve code readability. It simplifies conditional expressions by introducing variables for clarity, and uses ternary operators to streamline the logic.

* Blockfied Single Product Template: Add support for template for specific product (https://github.com/woocommerce/woocommerce-blocks/pull/9069)

* Product Price Block: remove ProductSelector (https://github.com/woocommerce/woocommerce-blocks/pull/8980)

* Empty commit for release pull request

* Make Woo_Directive_Store PHP 7.3 compatible (https://github.com/woocommerce/woocommerce-blocks/pull/9033)

* update version

* add changelog

* add testing instructions

* update zip link file testing

* Update docs/internal-developers/testing/releases/1001.md

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-04-18 14:24:04 +02:00
dependabot[bot] 060e0071f1 Bump yoast/phpunit-polyfills from 1.0.4 to 1.0.5 (https://github.com/woocommerce/woocommerce-blocks/pull/8936)
Bumps [yoast/phpunit-polyfills](https://github.com/Yoast/PHPUnit-Polyfills) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/Yoast/PHPUnit-Polyfills/releases)
- [Changelog](https://github.com/Yoast/PHPUnit-Polyfills/blob/2.x/CHANGELOG.md)
- [Commits](https://github.com/Yoast/PHPUnit-Polyfills/compare/1.0.4...1.0.5)

---
updated-dependencies:
- dependency-name: yoast/phpunit-polyfills
  dependency-type: direct:development
  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-04-18 14:17:51 +02:00
dependabot[bot] 57bdfa59e8 Bump husky from 2.4.1 to 8.0.3 (https://github.com/woocommerce/woocommerce-blocks/pull/8171)
Bumps [husky](https://github.com/typicode/husky) from 2.4.1 to 8.0.3.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v2.4.1...v8.0.3)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  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-04-18 14:03:02 +02:00
dependabot[bot] 2d20b10b9b Bump @emotion/styled from 11.10.5 to 11.10.6 (https://github.com/woocommerce/woocommerce-blocks/pull/8882)
Bumps [@emotion/styled](https://github.com/emotion-js/emotion) from 11.10.5 to 11.10.6.
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/styled@11.10.5...@emotion/styled@11.10.6)

---
updated-dependencies:
- dependency-name: "@emotion/styled"
  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-04-18 13:42:50 +02:00
dependabot[bot] b5db6e3ed1 Bump automattic/jetpack-autoloader from 2.11.16 to 2.11.18 (https://github.com/woocommerce/woocommerce-blocks/pull/8934)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.16 to 2.11.18.
- [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.16...v2.11.18)

---
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-04-18 12:31:15 +02:00
Viktor Szépe dca02da47c Make Woo_Directive_Store PHP 7.3 compatible (https://github.com/woocommerce/woocommerce-blocks/pull/9033) 2023-04-18 12:13:23 +02:00
Manish Menaria be5356d30a Product Stock indicator: Add support for background color, margin, padding & various typography controls (https://github.com/woocommerce/woocommerce-blocks/pull/8954)
* Add color, typography, and spacing support to Product SKU block

This commit introduces a new file `supports.ts` for the Product SKU block in the WooCommerce Blocks plugin, which adds color, typography, and spacing support. The following configuration has been added:

1. In `assets/js/atomic/blocks/product-elements/sku/supports.ts`, a new `supports` object is created, which extends the shared configuration and adds support for the following properties:
  - `text` and `background` color
  - `fontSize`, `lineHeight`, `__experimentalFontWeight`, `__experimentalFontFamily`, `__experimentalFontStyle`, `__experimentalTextTransform`, `__experimentalTextDecoration`, and `__experimentalLetterSpacing` for typography
  - `margin` and `padding` for spacing

* Add color, typography, and spacing support for Product SKU block in All Products block

This commit extends the support for color, typography, and spacing to the Product SKU block when used within the All Products block. The following changes have been made:

1. In `assets/js/atomic/blocks/product-elements/sku/block.tsx`, the `useColorProps`, `useSpacingProps`, and `useTypographyProps` hooks are imported and used to add the appropriate className and style properties to the rendered SKU element.
2. In `assets/js/atomic/blocks/product-elements/sku/edit.tsx`, the `style` property is separated from `useBlockProps()` and used directly on the `div` element for the SKU block.

* Add server-side rendering class for Product SKU Gutenberg block

This commit adds the ".wp-block-woocommerce-product-sku" class to the Product SKU Gutenberg block for server-side rendering purposes. The inclusion of this class ensures consistent styling between the editor and the front-end view of the block, providing a seamless experience for users.

The class name is generated based on the Gutenberg block prefix "wp-block", the namespace "woocommerce", and the block name "product-sku", creating a unique and identifiable class for the block. This class enables developers to target the block specifically in both the editor and front-end styles, maintaining the integrity of the block's appearance and functionality across different environments.

By adding this class to the server-side rendered version of the block, we ensure a unified and coherent styling experience throughout the block's usage.

* Fix minor issues

* Gate only experimental features behind isFeaturePluginBuild flag

This commit refactors the Product SKU block supports to enable color, typography, and spacing features for all builds, while keeping experimental features specific to the feature plugin build. It also adds necessary lint and TypeScript error handling for the experimental spacing API.

* Add overflow-wrap to Product SKU block and update comment

This commit adds the overflow-wrap property to the Product SKU block styles to handle long SKU values gracefully.
It also updates the comment for the experimental spacing API to better reflect the usage check.

* Refactor Product SKU block classname and style handling

This commit refactors the Product SKU block classname and style handling. It combines classnames for better readability and removes the hardcoded textTransform style in favor of default styles.
This also fix the issue where textTransform style was not working as expected.

* Add support for color, typography and spacing to stock indicator block

This commit updates the stock-indicator block support in the woocommerce-blocks repository. It includes the following changes:

- Added support for background color, line height, and various experimental typography features.
- Conditionally included support for margin and padding based on the availability of the __experimentalGetSpacingClassesAndStyles function from the @wordpress/block-editor package.

These updates provide more customization options for the stock-indicator block, allowing users to better match the appearance of this element to their site's design.

* Refactor stock text generation and apply minor style adjustments

This commit introduces a new function, `getTextBasedOnStock`, which handles the generation of stock text based on the stock information provided. It replaces the previous `lowStockText` and `stockText` functions, making the code more readable and maintainable.

In addition, minor adjustments to the class name handling have been made to simplify the code and ensure consistent styling when used inside the All Products block.

In the `edit.tsx` file, the `useBlockProps` function call has been updated to include the default `wc-block-components-product-stock-indicator` class name, ensuring it is always applied.

* Remove redundant block type supports in ProductStockIndicator

This commit removes the redundant get_block_type_supports() method from the ProductStockIndicator.php file, as it is no longer needed. The block type supports are now handled in the frontend.
2023-04-18 09:50:11 +00:00
Luigi Teschio a40f54e7f0 Single Product Template - Compatibility Layer: don't skip custom HTML (https://github.com/woocommerce/woocommerce-blocks/pull/9075) 2023-04-18 11:02:41 +02:00
Manish Menaria 4bfe9e7ff1 Fix: tax_query should be calculated only if __woocommerceAttributes is valid (https://github.com/woocommerce/woocommerce-blocks/pull/9049)
This commit refactors the update_rest_query method in the ProductQuery.php file to improve code readability. It simplifies conditional expressions by introducing variables for clarity, and uses ternary operators to streamline the logic.
2023-04-18 05:49:59 +00:00
Albert Juhé Lluveras cb9980c519 Mini Cart: Remove excessive margin under cart items (https://github.com/woocommerce/woocommerce-blocks/pull/9051) 2023-04-17 18:52:43 +02:00
leonardo lopes de albuquerque c58a09a8ef Fixed trim is not a function error when address has an attribute that is not a string (https://github.com/woocommerce/woocommerce-blocks/pull/8988) 2023-04-17 13:57:09 +00:00
Luigi Teschio 4a36f19255 Blockfied Single Product Template: Add support for template for specific product (https://github.com/woocommerce/woocommerce-blocks/pull/9069) 2023-04-17 12:23:00 +00:00
Niels Lange e7f8a8cb6e WIP: Add Playwright setup (https://github.com/woocommerce/woocommerce-blocks/pull/9034)
* Set up Playwright

* Use caching in GitHub Actions

* Update tests/e2e-pw/README.md

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Rename “{blockName}” to “{blockName} block”

* Disable “no-console” for setup and teardown files

* Remove obsolete log and adjusted disabled ESLint definition

* Remove conditional logic from actions/upload-artifact

---------

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-04-17 19:01:41 +07:00
Albert Juhé Lluveras 79a713240b Mini Cart block: exclude already-printed scripts from scripts to lazy load (https://github.com/woocommerce/woocommerce-blocks/pull/8979) 2023-04-17 13:09:38 +02:00
Albert Juhé Lluveras 6123ba4433 Fix Mini Cart drawer not opening in RTL locales (https://github.com/woocommerce/woocommerce-blocks/pull/9066) 2023-04-17 10:02:26 +02:00
Albert Juhé Lluveras 779e13af15 Fix JS error visible in the editor caused by Mini Cart Contents buttons (https://github.com/woocommerce/woocommerce-blocks/pull/9039) 2023-04-14 16:53:39 +02:00
Alexandre Lara 0ad067d8a9 Add save method to Product Meta block (https://github.com/woocommerce/woocommerce-blocks/pull/9032) 2023-04-14 08:52:19 -03:00
Albert Juhé Lluveras ec01be5a3b Mini Cart template part: give user customized template priority over theme template (https://github.com/woocommerce/woocommerce-blocks/pull/9005)
* Mini Cart template part: give user customized template priority over theme template

* Use get_block_templates_from_db() from BlockTemplateUtils

* Add deprecation notice
2023-04-14 11:40:30 +02:00
Albert Juhé Lluveras af01052bbe Release checklist: update Release highlights page with highlights and use it to update WC core release announcement (https://github.com/woocommerce/woocommerce-blocks/pull/9028) 2023-04-14 11:08:59 +02:00
Albert Juhé Lluveras 495fc63629 JavaScript testing docs: add section about reports and update section about WP versions (https://github.com/woocommerce/woocommerce-blocks/pull/9020)
* Add section about 'Debugging e2e tests using generated reports'

* Update section in JavaScript testing about WP versions

* Update TOC

* Typo
2023-04-14 10:55:26 +02:00
Albert Juhé Lluveras c63923e2fb Display Mini Cart overlay in template part editor (https://github.com/woocommerce/woocommerce-blocks/pull/9014) 2023-04-14 10:44:09 +02:00
Karol Manijak 710221ad23 Update the docs regarding Product Collection Data endpoint in Store API (https://github.com/woocommerce/woocommerce-blocks/pull/9011)
* Update the docs regarding Product Collection Data endpoint in Store API

* Add the dots at the end of sentences

* Remove the  and  from Product Collection Data endpoint docs as it's covered in Products endpoint
2023-04-14 10:09:53 +02:00
Alba Rincón 99efb908d3 Store API: allow searching by `slug` and include `slug` in the response (https://github.com/woocommerce/woocommerce-blocks/pull/9017)
* Add ProductBySlug, search by slug and return slug field for products

* Search for product variation

* Add slug to tests

* Sanitize the slug
2023-04-14 10:06:47 +02:00
Alba Rincón b6039d1d74 Mini cart: allow changing the drawer width (https://github.com/woocommerce/woocommerce-blocks/pull/8930)
* WIP

* Add width control to the settings sidebar

* Fix linting errors

* Remove comments

* Inline function

* Fix issue with smaller viewports

* Remove unnecessary code
2023-04-14 09:48:55 +02:00
Alba Rincón 709a7a9add [Mini cart] Make the title customizable (https://github.com/woocommerce/woocommerce-blocks/pull/8905)
* Create the counter block and the header pattern

* Change the pattern to an inner block

* Allow customizing item counter block

* Rename block

* Allow removing the items counter block

* Add padding controls

* Preload new blocks

* Add title block back from the inserter

* Move h2 tag to the parent title

* Align items at the bottom

* Unify styles

* Add title class in the editor

* Prevent removing title blocks

* Disallow unlocking and inserter

* Disallowing moving blocks
2023-04-14 09:21:21 +02:00
Alba Rincón ad2003117e E2E tests fix: enable the attribute lookup direct updates settings (https://github.com/woocommerce/woocommerce-blocks/pull/9029)
* Enable the attribute lookup direct updates settings

We are importing products using the batch api and we need the lookup tables
to be updated immediately for our tests to work. Enabling this setting will
do that, instead of doing it asynchronously.

* Fix customer account test classes

* Increase timeout limit for failing tests

---------

Co-authored-by: roykho <roykho77@gmail.com>
2023-04-14 09:05:08 +02:00
Luigi Teschio c3f585ef55 Product SKU: fix preview on the Single Product Block (https://github.com/woocommerce/woocommerce-blocks/pull/8805) 2023-04-13 19:10:41 +02:00
Alexandre Lara aaeb6af909 Customer Account block: Fix padding for the block in the Editor (https://github.com/woocommerce/woocommerce-blocks/pull/9009)
* Fix padding for the Customer Account block in the Editor

* Add padding to Customer Account block icon
2023-04-13 09:36:38 -03:00
Thomas Roberts 064f638fb6 Remove experimental PR 8610 from changelog 2023-04-13 09:44:44 +01:00
Alba Rincón f72f82087d Update feature flags documentation (https://github.com/woocommerce/woocommerce-blocks/pull/9013)
* Update feature flags documentation

* removed doc for unused cart and checkout experimental flags (https://github.com/woocommerce/woocommerce-blocks/pull/9015)

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-04-13 09:26:55 +02:00
Alexandre Lara 8889ba43f2 Fix inspector control border for the Customer Account block (https://github.com/woocommerce/woocommerce-blocks/pull/9008) 2023-04-12 14:12:54 -03:00
Luigi Teschio 4d1604bdd0 Product Price Block: remove ProductSelector (https://github.com/woocommerce/woocommerce-blocks/pull/8980) 2023-04-12 18:27:02 +02:00
Luigi Teschio 6c86d45951 Skeleton component: fix warning about key prop (https://github.com/woocommerce/woocommerce-blocks/pull/9018) 2023-04-12 16:04:05 +02:00
Thomas Roberts e8e7b43625 Bump version numbers post-release 2023-04-12 10:25:25 +01:00