Commit Graph

5055 Commits

Author SHA1 Message Date
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
Patricia Hillebrandt 8ae444b201 Filter data count mismatch > Fix PHP unit tests (https://github.com/woocommerce/woocommerce-blocks/pull/8984)
* Introduce the new get_attribute_and_meta_counts method.

* Ensure that if no term_slug or term_id is found for counting, the default list with all terms (with count equal zero) is returned instead.

* update conditional for the slug, the empty state for requests without filter attributes and the condition query for 'and'

* Introduce the get_terms_list method.

* Remove the legacy get_attribute_counts method and update its calls to rely on the new get_attribute_and_meta_counts method instead.

* Update the query to ensure that if a parent product has multiple identical attributes, they are counted once.

* Update to start relying on the get_product_by_metas method for counting product metas

* Add a new where_clause to only include product metas and attributes in the macro query if they are not empty.

* Add wpdb->prepare to the macro query and the get_terms_list method.

* Replace the raw atomic query for fetching the filtered terms with the new get_product_by_filtered_terms method.

* Update the request params for the get_attribute_and_meta_counts method.

* Update the request params for the product metas (min and max price).

* Update the query and returned value on get_terms_list.

* Update the validation for returning the default counts when no values are filtered.

* Update the query on get_terms_list to use ->prefix

* Update the  variable for the query to rely on the filtered one. Update the min_price and max_price format on get_product_by_metas.

* Ensure the get_product_by_filtered_terms method is triggered for each one of the filtered terms and update the macro query to include those term ids on the WHERE clause.

* Make adjustments for the 'and' condition to work as expected.

* Ensure the queryState.attributes is properly added as a param to the API request to correctly fetch the attribute count data.

* Ensure the get_product_by_metas method is only triggered when at least one of the metas in the request is not empty.

* Join type update: for the 'and' (all) filter condition, items with the count zero are not displayed.

* wpdb prepare the where clauses

* Update the get_product_by_filtered_terms query wpdb prepare params

* update the get_product_by_metas method's where clause preparation.

* Update the where clause preparation for get_attribute_and_meta_counts so we don't rely on interpolated variables anymore.

* Adjust the get_attribute_and_meta_counts method for usage alongside the rating filter.

* Adjust the query for fetching the attribute counts for filtered ratings.

* Add support for the filter by stock.

* Ensure the product attribute counts are correct if the parent product receives a rating.

* Ensure product_or_parent_id is used only when the filter by rating is used, not affecting price or stock filters.

* Add the missing else condition.

* Enable caching.

* Address CR

* Update query for average rating.

* remove file accidentally commited.

* When multiple ratings are selected, make sure the where clause is updated accordingly for each one of them.

* Start updating the stock_status logic to account for when multiple options are selected by the user.

* Ensure the counts are properly updated when more than one stock status is selected.

* Ditch the is_array condition for the average_rating counts as  is always an array.

* Deprecate the second param attributes for the get_attribute_counts method.

* Add the filtered_attribute to the transient_key

* Bypass cache if WP_DEBUG is enabled.

* Update formatting for macro query.

* Fix mixed tabs spaces on query

* Fix PHP unit tests for the new attribute counts.

* Update spacing/formatting for SQL queries.

* Minor: update indentation for the main SQL query

---------

Co-authored-by: roykho <roykho77@gmail.com>
2023-04-11 12:33:18 -03:00
Patricia Hillebrandt 3c0463ada1 Filter data count mismatch > Create the get_attribute_and_meta_counts method (https://github.com/woocommerce/woocommerce-blocks/pull/8599)
* Introduce the new get_attribute_and_meta_counts method.

* Ensure that if no term_slug or term_id is found for counting, the default list with all terms (with count equal zero) is returned instead.

* update conditional for the slug, the empty state for requests without filter attributes and the condition query for 'and'

* Introduce the get_terms_list method.

* Remove the legacy get_attribute_counts method and update its calls to rely on the new get_attribute_and_meta_counts method instead.

* Update the query to ensure that if a parent product has multiple identical attributes, they are counted once.

* Update to start relying on the get_product_by_metas method for counting product metas

* Add a new where_clause to only include product metas and attributes in the macro query if they are not empty.

* Add wpdb->prepare to the macro query and the get_terms_list method.

* Replace the raw atomic query for fetching the filtered terms with the new get_product_by_filtered_terms method.

* Update the request params for the get_attribute_and_meta_counts method.

* Update the request params for the product metas (min and max price).

* Update the query and returned value on get_terms_list.

* Update the validation for returning the default counts when no values are filtered.

* Update the query on get_terms_list to use ->prefix

* Update the  variable for the query to rely on the filtered one. Update the min_price and max_price format on get_product_by_metas.

* Ensure the get_product_by_filtered_terms method is triggered for each one of the filtered terms and update the macro query to include those term ids on the WHERE clause.

* Make adjustments for the 'and' condition to work as expected.

* Ensure the queryState.attributes is properly added as a param to the API request to correctly fetch the attribute count data.

* Ensure the get_product_by_metas method is only triggered when at least one of the metas in the request is not empty.

* Join type update: for the 'and' (all) filter condition, items with the count zero are not displayed.

* wpdb prepare the where clauses

* Update the get_product_by_filtered_terms query wpdb prepare params

* update the get_product_by_metas method's where clause preparation.

* Update the where clause preparation for get_attribute_and_meta_counts so we don't rely on interpolated variables anymore.

* Adjust the get_attribute_and_meta_counts method for usage alongside the rating filter.

* Adjust the query for fetching the attribute counts for filtered ratings.

* Add support for the filter by stock.

* Ensure the product attribute counts are correct if the parent product receives a rating.

* Ensure product_or_parent_id is used only when the filter by rating is used, not affecting price or stock filters.

* Add the missing else condition.

* Enable caching.

* Address CR

* Update query for average rating.

* remove file accidentally commited.

* When multiple ratings are selected, make sure the where clause is updated accordingly for each one of them.

* Start updating the stock_status logic to account for when multiple options are selected by the user.

* Ensure the counts are properly updated when more than one stock status is selected.

* Ditch the is_array condition for the average_rating counts as  is always an array.

* Deprecate the second param attributes for the get_attribute_counts method.

* Add the filtered_attribute to the transient_key

* Bypass cache if WP_DEBUG is enabled.

* Update formatting for macro query.

* Fix mixed tabs spaces on query

* Update spacing/formatting for SQL queries.

* Minor: update indentation for the main SQL query

---------

Co-authored-by: roykho <roykho77@gmail.com>
2023-04-11 12:32:24 -03:00
Alexandre Lara 53eb5b9219 Single Product Block: Add block preview (https://github.com/woocommerce/woocommerce-blocks/pull/8923)
* Add block minimal structure

* Add Single Product block icon

* Add usesContext to block.json

* Add Save function to Single Product Block registration settings

* Add InnerBlocks template to Editor for Single Product Block

* Add Product selector to Single Product block

* Add withProduct HOC to the block editor

* Add save function to the Single Product block

* Add renderOnServerSide attribute to Product image

This attribute is used to determine if the product image should be rendered on the server side or not. This is needed because the product image is not rendered on the server side by default, but we want to render it on the server side when it is inside the Single Product block.

* Add renderOnServerSide attribute to Product Category List block

* Add renderOnServerSide attribute to Product Price block

* Add renderOnServerSide attribute to Product Rating block

* Add renderOnServerSide attribute to Product Stock Indicator block

* Add renderOnServerSide attribute to Product Summary block

* Add renderOnServerSide attribute to Product Tag List block

* Add renderOnServerSide attribute to Product Title block

* Add renderOnServerSide attribute to Product Add to Cart, Sales Badge and Sku block

* Reuse editor code for Single Product block

* Add Props interface to Single Product Server Side Editor

* Add render_block_context hook to SingleProductServerSide block

* Fix Single Product Server Side block that was not appearing in the block inserter

* Fix bug where the correct product was not being displayed on the frontend

* Remove Single Product Block

* Add Product title and product summary variations

* Add Add To Cart Form and Product Meta blocks to the Single Product Block

* remove more files that belong the Single Product block

* fix php linter error

* wrap up Single Product Block

* Fix issue preventing the block from working on the Single Product Template

* Fix update context function for Single Product block

* Replace Single Product block title

* Replace global $post only for Single Product inner blocks

* Remove unnecessary var_dump statement

* Improve documentation for the Single Product block

* fix registration: add-to-cart-form and product-meta blocks

* Improve documentation for Single Product block

* Fix lint error related to imports

* Remove query monitor debug code

* Remove unnecessary `renderOnServerSide` attribute from product elements

* Fix return type for the Save function of the Product Elements blocks

* Fix return type for the Save function of the Product Title block

* Add scss file for Single Product block

* Fix PHP coding standards

* Fix php coding standards

* Remove internal dependencies section duplication

* Replace .wc-block with .wc-block-editor- styles

According to the naming convention for this project (https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/contributors/contributing/coding-guidelines.md#naming) we should be using the `.wc-block-editor-` prefix for styles that are only used in the editor.

* Solve style for the Edit card component in the Single Product block

* Fix error preventing Block Control from being displayed

* Make the Product title to be a link by default

* Fix PHP Coding Standards

* Fix PHP Code Standards

* Fix php cs issues

* Fix issue with php cs

* Remove unnecessary comment

* Remove unused Icon import

* Remove unnecessary dot from the className attributes in the Single Product Block

* Replace metadata.name with metadata.title in the Editor file

* Ignore phpcs rule

* Add new attributes to the Attributes interface of the Price block

* Fix typescript errors on the Product Meta block

* Fix ts errors on Single Product editor

* Fix ts errors on layout-editor.tsx

* Fix ts errors in Single Product index file

* Fix ts errors on add to cart form index file

* Fix unsupported block error when using inner blocks outside the Single Product template

* Fix unsupported block error for the Single Product block when editing Posts/Pages

* Remove unnecessary JSDoc types

* Remove unnecessary APIError component

* Replace global $post only when rendering a `core/post-excerpt` block

* Fix php cs errors

* Put the Single Product block behind an experimental flag

* Enable Single Product block preview

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-04-11 11:46:21 -03:00
Alexandre Lara 719fabdc57 Product Image: Displays with different size on the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/8926)
* Add block minimal structure

* Add Single Product block icon

* Add usesContext to block.json

* Add Save function to Single Product Block registration settings

* Add InnerBlocks template to Editor for Single Product Block

* Add Product selector to Single Product block

* Add withProduct HOC to the block editor

* Add save function to the Single Product block

* Add renderOnServerSide attribute to Product image

This attribute is used to determine if the product image should be rendered on the server side or not. This is needed because the product image is not rendered on the server side by default, but we want to render it on the server side when it is inside the Single Product block.

* Add renderOnServerSide attribute to Product Category List block

* Add renderOnServerSide attribute to Product Price block

* Add renderOnServerSide attribute to Product Rating block

* Add renderOnServerSide attribute to Product Stock Indicator block

* Add renderOnServerSide attribute to Product Summary block

* Add renderOnServerSide attribute to Product Tag List block

* Add renderOnServerSide attribute to Product Title block

* Add renderOnServerSide attribute to Product Add to Cart, Sales Badge and Sku block

* Reuse editor code for Single Product block

* Add Props interface to Single Product Server Side Editor

* Add render_block_context hook to SingleProductServerSide block

* Fix Single Product Server Side block that was not appearing in the block inserter

* Fix bug where the correct product was not being displayed on the frontend

* Remove Single Product Block

* Add Product title and product summary variations

* Add Add To Cart Form and Product Meta blocks to the Single Product Block

* remove more files that belong the Single Product block

* fix php linter error

* wrap up Single Product Block

* Fix issue preventing the block from working on the Single Product Template

* Fix update context function for Single Product block

* Replace Single Product block title

* Replace global $post only for Single Product inner blocks

* Remove unnecessary var_dump statement

* Improve documentation for the Single Product block

* fix registration: add-to-cart-form and product-meta blocks

* Improve documentation for Single Product block

* Fix lint error related to imports

* Remove query monitor debug code

* Remove unnecessary `renderOnServerSide` attribute from product elements

* Fix return type for the Save function of the Product Elements blocks

* Fix return type for the Save function of the Product Title block

* Add scss file for Single Product block

* Fix PHP coding standards

* Fix php coding standards

* Remove internal dependencies section duplication

* Replace .wc-block with .wc-block-editor- styles

According to the naming convention for this project (https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/contributors/contributing/coding-guidelines.md#naming) we should be using the `.wc-block-editor-` prefix for styles that are only used in the editor.

* Solve style for the Edit card component in the Single Product block

* Fix error preventing Block Control from being displayed

* Make the Product title to be a link by default

* Fix PHP Coding Standards

* Fix PHP Code Standards

* Fix php cs issues

* Fix issue with php cs

* Remove unnecessary comment

* Remove unused Icon import

* Remove unnecessary dot from the className attributes in the Single Product Block

* Replace metadata.name with metadata.title in the Editor file

* Ignore phpcs rule

* Add new attributes to the Attributes interface of the Price block

* Fix typescript errors on the Product Meta block

* Fix ts errors on Single Product editor

* Fix ts errors on layout-editor.tsx

* Fix ts errors in Single Product index file

* Fix ts errors on add to cart form index file

* Fix unsupported block error when using inner blocks outside the Single Product template

* Fix unsupported block error for the Single Product block when editing Posts/Pages

* Remove unnecessary JSDoc types

* Remove unnecessary APIError component

* Replace global $post only when rendering a `core/post-excerpt` block

* Fix php cs errors

* Put the Single Product block behind an experimental flag

* Fix error occurring when trying to access ancestor of an undefined block settings

* Fix Product Image appearing with different size on the Frontend

* Fix PHP Code Standards errors

* Remove JS Doc from shared-product-control.tsx

* Fix single-product-frontend.js 404 error

* Fix error 'Block names must be string' when adding Single Product block

* Add todo comment to state the temporary solution used in the Single Product block

* Set imageSizing attribute on Product Query and Single Product blocks

* Rename values for image size options in the product image block

The previous allowed values were 'cropped' and 'full-size'. The new values are 'thumbnail' and 'single' which are similar to the values used in WooCoomerce.

WooCommerce uses 'woocommerce_thumbnail', 'woocommerce_gallery_thumbnail' and 'woocommerce_single' for images sizes. The 'woocommerce_single' size is used for the Single Product page and the 'woocommerce_thumbnail' size is used for the product grid.

* Fix Related Products image to show as a thumbnail instead of the full size

* Fix PHP CS error

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-04-11 11:41:34 -03:00
Thomas Roberts df18b279e6 Port changes from release branch to trunk 2023-04-11 15:33:30 +01:00
Thomas Roberts 39c5ee5702 Correct year in readme 2023-04-11 15:27:05 +01:00
Thomas Roberts 8eee27e5b0 Remove reference to php file from 8857 instructions 2023-04-11 14:32:53 +01:00
Thomas Roberts d2d615e901 Update 8609 testing instructions 2023-04-11 14:25:04 +01:00
Thomas Roberts c99eedc2d9 Remove 8842 testing instructions 2023-04-11 14:22:36 +01:00
Thomas Roberts 47c323caff Update testing instructions to include selecting a template 2023-04-11 13:49:27 +01:00
Thomas Roberts 79ba5e1aa9 Update testing notes, remove unnecessary ones and fix typos 2023-04-11 13:14:57 +01:00
Thomas Roberts 09cb195e0d Update image in testing notes to show correct warning label 2023-04-11 13:12:27 +01:00
Thomas Roberts e0dd5bff58 Update testing notes to be clear about status of privacy/t&c pages 2023-04-11 11:49:18 +01:00
Thomas Roberts e7ebfda99c Update testing notes to remove dev-only line 2023-04-11 10:41:15 +01:00
Thomas Roberts fe3993755f Update testing notes to use correct privacy menu name 2023-04-11 10:15:16 +01:00
Thomas Roberts e30c0f5463 Add `validateOnMount` prop to `ValidatedTextInput` (https://github.com/woocommerce/woocommerce-blocks/pull/8889)
* Add validateOnFirstFocus prop

* Only run validation on first focus if validateOnFirstFocus is true

* Rename validateOnFirstFocus to validateOnMount

* Set TotalsCoupon to not validate when the input is mounted

* Add tests for validation error handling

* Fix test that was not making a good assertion

* Add tests for validateOnMount functionality

* Clean up validateOnMount logic, make the code more readable & efficient
2023-04-11 01:50:59 -07:00
Thomas Roberts ff68a5efa3 Update changelog date 2023-04-11 09:30:59 +01:00
Thomas Roberts cc3c1cf1cc Update testing instructions for woocommerce/woocommerce-blocks#8895 2023-04-11 09:30:21 +01:00
Albert Juhé Lluveras d35254f537 Create specific stylesheet for CartLineItemsTable component (https://github.com/woocommerce/woocommerce-blocks/pull/8967) 2023-04-11 09:51:09 +02:00
Thomas Roberts a7d4b07bf6 Add testing instructions for 10.0.0 2023-04-10 16:25:05 +01:00
Thomas Roberts 306fb7038d Update required PHP version 2023-04-10 12:42:43 +01:00
Thomas Roberts 711d473f78 Run change versions script 2023-04-10 12:40:52 +01:00
Thomas Roberts 6f40091ec8 Update readme with changelog 2023-04-10 12:40:01 +01:00
Thomas Roberts eea5ea3aad Prevent error when entering postcode for countries without specific validation rules (https://github.com/woocommerce/woocommerce-blocks/pull/8987)
* Allow countries not covered by postcode-validator to pass validaiton

* Add "skipPushCheck" option when filling billing and shipping details

* Allow albania as a shipping/selling country

* Add test to ensure adding a postcode for a country without rules works

* Remove skipPushCheck option

no longer needed
2023-04-10 03:13:23 -07:00
Daniel Dudzic b95812da5f Product Rating: Normalize the height of rating icons and the Add review link (https://github.com/woocommerce/woocommerce-blocks/pull/8399) 2023-04-06 15:35:48 -04:00
Alexandre Lara 7965a07870 Add single product block (https://github.com/woocommerce/woocommerce-blocks/pull/8610)
* Add block minimal structure

* Add Single Product block icon

* Add usesContext to block.json

* Add Save function to Single Product Block registration settings

* Add InnerBlocks template to Editor for Single Product Block

* Add Product selector to Single Product block

* Add withProduct HOC to the block editor

* Add save function to the Single Product block

* Add renderOnServerSide attribute to Product image

This attribute is used to determine if the product image should be rendered on the server side or not. This is needed because the product image is not rendered on the server side by default, but we want to render it on the server side when it is inside the Single Product block.

* Add renderOnServerSide attribute to Product Category List block

* Add renderOnServerSide attribute to Product Price block

* Add renderOnServerSide attribute to Product Rating block

* Add renderOnServerSide attribute to Product Stock Indicator block

* Add renderOnServerSide attribute to Product Summary block

* Add renderOnServerSide attribute to Product Tag List block

* Add renderOnServerSide attribute to Product Title block

* Add renderOnServerSide attribute to Product Add to Cart, Sales Badge and Sku block

* Reuse editor code for Single Product block

* Add Props interface to Single Product Server Side Editor

* Add render_block_context hook to SingleProductServerSide block

* Fix Single Product Server Side block that was not appearing in the block inserter

* Fix bug where the correct product was not being displayed on the frontend

* Remove Single Product Block

* Add Product title and product summary variations

* Add Add To Cart Form and Product Meta blocks to the Single Product Block

* remove more files that belong the Single Product block

* fix php linter error

* wrap up Single Product Block

* Fix issue preventing the block from working on the Single Product Template

* Fix update context function for Single Product block

* Replace Single Product block title

* Replace global $post only for Single Product inner blocks

* Remove unnecessary var_dump statement

* Improve documentation for the Single Product block

* fix registration: add-to-cart-form and product-meta blocks

* Improve documentation for Single Product block

* Fix lint error related to imports

* Remove query monitor debug code

* Remove unnecessary `renderOnServerSide` attribute from product elements

* Fix return type for the Save function of the Product Elements blocks

* Fix return type for the Save function of the Product Title block

* Add scss file for Single Product block

* Fix PHP coding standards

* Fix php coding standards

* Remove internal dependencies section duplication

* Replace .wc-block with .wc-block-editor- styles

According to the naming convention for this project (https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/contributors/contributing/coding-guidelines.md#naming) we should be using the `.wc-block-editor-` prefix for styles that are only used in the editor.

* Solve style for the Edit card component in the Single Product block

* Fix error preventing Block Control from being displayed

* Make the Product title to be a link by default

* Fix PHP Coding Standards

* Fix PHP Code Standards

* Fix php cs issues

* Fix issue with php cs

* Remove unnecessary comment

* Remove unused Icon import

* Remove unnecessary dot from the className attributes in the Single Product Block

* Replace metadata.name with metadata.title in the Editor file

* Ignore phpcs rule

* Add new attributes to the Attributes interface of the Price block

* Fix typescript errors on the Product Meta block

* Fix ts errors on Single Product editor

* Fix ts errors on layout-editor.tsx

* Fix ts errors in Single Product index file

* Fix ts errors on add to cart form index file

* Fix unsupported block error when using inner blocks outside the Single Product template

* Fix unsupported block error for the Single Product block when editing Posts/Pages

* Remove unnecessary JSDoc types

* Remove unnecessary APIError component

* Replace global $post only when rendering a `core/post-excerpt` block

* Fix php cs errors

* Put the Single Product block behind an experimental flag

* Fix error occurring when trying to access ancestor of an undefined block settings

* Remove JS Doc from shared-product-control.tsx

* Fix single-product-frontend.js 404 error

* Fix error 'Block names must be string' when adding Single Product block

* Add todo comment to state the temporary solution used in the Single Product block

* Move the wp_reset_postdata outside the block name check condition

* Add comments about why we need to unregister the block on Single Product template

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-04-06 15:40:43 -03:00
Karol Manijak 278f20a429 Comment out the integration with Airtable (https://github.com/woocommerce/woocommerce-blocks/pull/8933)
* Comment out the integration with Airtable

* Adjust TODO comment to follow project guidelines and link the issue
2023-04-06 16:29:14 +02:00
Albert Juhé Lluveras 59ee49ba30 Update release steps to remove the need of merging to trunk and simplify testing (https://github.com/woocommerce/woocommerce-blocks/pull/8956)
* Update release steps to remove need of merging to trunk and simplify testing

* Update smoket testing document

* Add note in patch release checklist to cherry-pick fixes
2023-04-06 16:00:40 +02:00
Thomas Roberts 3d62b6da78 Set Cart and Checkout blocks to be wide aligned by default (https://github.com/woocommerce/woocommerce-blocks/pull/8899)
* Add default align attribute value for Cart block

* Add default align attribute value for Checkout block

* Update cart tests

* Check for not disabled insert button
2023-04-06 06:42:38 -07:00
Karol Manijak fcdd0f243c Stop displaying decimals in Filter by Price (https://github.com/woocommerce/woocommerce-blocks/pull/8975)
* Remove the decimals from Filter by Price

* Simplify the props in Filter by Price by reusing the common ones
2023-04-06 14:58:07 +02:00
Thomas Roberts f4f842e716 Add "Collection from..." in Checkout sidebar when selecting local pickup (https://github.com/woocommerce/woocommerce-blocks/pull/8305)
* Add get_collectible_method_ids function

* Add collectibleMethodIds to asset data registry

* Remove unnecessary pluck and add pickup_location to returned array

* Add hasSelectedLocalPickup to shipping types

* show shipping address even if collecting

* Make checkout store set prefersCollection based on IDs from settings

* Move areRatesCollectible outside of hook

* Add pickup location component

* Show pickup location if user prefers collection

* Move prefersCollection check into ShippingAddress component

* Remove spread for collectibleMethodIds

Not needed now since pickup_location is included in the setting by default

* Check address metadata has a value before displaying it

* Add tests for ShippingAddress component

* Move PickupLocation specific tests to new file

* Ensure TotalsShipping shows only one package rate if local pickup chosen

* Update prefersCollection selector to use typeof check

* Use isPackageRateCollectible rather than checking against settings

* Do not show calculator button if local pickup rate is selected

* Update test to mock correct setting

* Remove unused method from ShippingController

* Check isPackageRateCollectable rather than checking settings array

* Update test to mock correct setting

* Change spelling of collectible to collectable

* Improve mocked useSelect function

Old one returned incorrect data shape for prefersCollection

* Remove duplicate import
2023-04-06 04:56:47 -07:00
Mike Jolley 62c62d3326 Checkout Block: Avoid using editor buttons in the post content to prevent inheriting global styles (https://github.com/woocommerce/woocommerce-blocks/pull/8957)
* Remove express payment placeholders when there are no express payment methods

* Only use one instance of CartCheckoutFeedbackPrompt

* Show NoPaymentMethods notice in the inspector instead of the block

* Move privacy notices to inspector

* Unused hook

* Update tests to use mocks
2023-04-06 12:16:42 +01:00
Mike Jolley e977882a74 Error to warning (https://github.com/woocommerce/woocommerce-blocks/pull/8969) 2023-04-06 10:42:04 +01:00
Manish Menaria c497190936 Product SKU: Adds support for color, typography, and spacing (https://github.com/woocommerce/woocommerce-blocks/pull/8913)
* 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.
2023-04-06 11:30:27 +05:30
Mike Jolley 7a89cecb6b Feature Branch: Updated Shopper Notices (https://github.com/woocommerce/woocommerce-blocks/pull/8659)
* Notice banner component

* Snackbar support

* Switch to new components

* Finish snackbar implementation

* Summary notice

* Styling issues

* Fix text wrap in shipping calculator

* Storybook entries

* Docs and tests for NoticeBanner

* Framer motion to avoid components dependency

* Snackbar list stories

* Docs for snackbar list

* Update assets/js/base/components/notice-banner/README.md

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

* Update assets/js/base/components/notice-banner/README.md

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

* Update assets/js/base/components/notice-banner/README.md

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

* Update assets/js/base/components/notice-banner/README.md

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

* Update assets/js/base/components/notice-banner/README.md

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

* Types/docblocks

* Docs

* Update notice type

* Use NoticeBannerProps for type of noticeProps

* Raw html to fix notice encoding

* getClassNameFromStatus is unused

* Update position text

* Clarify notice text

* Fix hover style in whisper TT3 theme

* remove div styles

* Add new templates for legacy buyer notices in WooCommerce core (https://github.com/woocommerce/woocommerce-blocks/pull/8732)

* Add templates for legacy core notices

* Update src/Domain/Services/Notices.php

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Remove debugging code

* DRY get_notices_template

* Simplify error template

* Fix padding

* Only include new notices if using block cart/checkout

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Fix view box tag

* Hover and focus styles

* Styling when notices added via ajax

* Remove margin change

* Implement react-transition-group instead of framer (https://github.com/woocommerce/woocommerce-blocks/pull/8920)

* Add screenshots to docs

---------

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-04-05 13:43:03 +01:00
Alexandre Lara 2f98513cd8 Add to Cart Form: Replace Notice with Skeleton component (https://github.com/woocommerce/woocommerce-blocks/pull/8842)
* Add Skeleton component

* Replace notice with skeleton on Add to Cart Form block

* Fix css lint error

* add tooltip

* fix css linter

* add css for change cursor

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-04-05 09:38:58 -03:00
Alexandre Lara d27d4d3a2e Fix lint errors on getting-started.md (https://github.com/woocommerce/woocommerce-blocks/pull/8958) 2023-04-04 15:22:17 -03:00
Darren Ethier 031c28a7df Update Getting Started Doc (https://github.com/woocommerce/woocommerce-blocks/pull/8938)
* Update Getting Started Doc

The doc referenced the old repository name in the `git clone` instructions (and also in directory references). This fixes that.

* Improve dependencies guide and various capitalization.

* fix internal link to .nvmrc file in repo

* Be consistent with CLI examples.

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

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-04-04 13:48:59 +00:00
Manish Menaria e1183211e5 Product Price: support for background color, line height, font family, letter spacing, and padding (https://github.com/woocommerce/woocommerce-blocks/pull/8906)
* Add typography and spacing support to Product Price block

This commit adds additional typography and spacing support to the Product Price block. The following changes have been made:

1. In `assets/js/atomic/blocks/product-elements/price/block.tsx`, the `typographyProps.className` has been added to the `classNames` function to apply the typography styles.

2. In `assets/js/atomic/blocks/product-elements/price/supports.ts`, the following support attributes have been added to the `typography` object:
  - `lineHeight`
  - `__experimentalFontFamily`
  - `__experimentalLetterSpacing`
Additionally, the `padding` attribute has been added to the `spacing` object.

3. In `src/BlockTypes/ProductPrice.php`, the `StyleAttributesUtils::get_classes_and_styles_by_attributes` function has been updated to receive all attributes instead of a predefined list.

* Enable background color support for Product Price block

This commit enables the background color support for the Product Price block in the WooCommerce Blocks plugin. The following change has been made:

1. In `assets/js/atomic/blocks/product-elements/price/supports.ts`, the `background` property within the `color` object has been changed from `false` to `true`, allowing users to set the background color for the Product Price block.
2023-04-04 10:08:45 +00:00
Tung Du 42c375f9e0 remove the broken import from the list of imports (https://github.com/woocommerce/woocommerce-blocks/pull/8945) 2023-04-04 10:41:38 +01:00
kmanijak c81e5d8da6 Move surrounding blocks from Products block when converting the Classic Template to Blockified one (https://github.com/woocommerce/woocommerce-blocks/pull/8887)
* Move blocks outside of Products block when convering Propduct Archive to the blockified version

* Move blocks outside of Products block when convering Product Search Result to the blockified version

* Move blocks outside of Products block in blockified templates

* Make sure Term description is still removed from Product Catalog template
2023-04-03 16:29:08 +02:00
Albert Juhé Lluveras b143048c81 Fix E2E tests with WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8928)
* Update @wordpress/e2e-test-utils

* Remove WP 6.1 specific code

* Don't call switchBlockInspectorTab in blocks that don't have inspector tabs

* Typos and code styling fixes

* Make .toRenderBlock() more resilient

* Make sure we only open the Settings tab when the block has been selected

* Fix goToSiteEditor in WP 6.2

* Create insertAllProductsBlock util

* Create openSettingsSidebar util as an alternative to openDocumentSettingsSidebar so it works in WP 6.2

* Update WOOCOMMERCE_PARSED_ID

* Create enableApplyFiltersButton() util
2023-04-03 15:02:36 +02:00
Thomas Roberts 965491de4e Bump version numbers following release 2023-04-03 09:56:44 +01:00
github-actions[bot] 5b30798f0f Release: 9.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8876)
* Empty commit for release pull request

* Add WC Blocks 9.9.0 changelog

* Update supported versions for WC Blocks 9.9.0

* Update versions for WC Blocks 9.9.0

* Add testing notes for 9.90 release

* Update testing instructions

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

* Remove active the latest trunk part from the testing instructions

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

* Add instructions to activate WP release candidates

- Add the editor type for each reference.
- Add instructions to activate WP release candidate

* Fix readme file reference

* Fix unlinked border widths in WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8893)

* Check for address on shippingData (https://github.com/woocommerce/woocommerce-blocks/pull/8878)

* Make a Single Product conversion enabled in Core, but keep the Product Archive behind experimental flag (https://github.com/woocommerce/woocommerce-blocks/pull/8907)

* Remove `isExperimentalBuild` Checks in Classic Template Block (https://github.com/woocommerce/woocommerce-blocks/pull/8902)

* Remove isExperimentalBuild checks.

By removing the `isExperimentalBuild` conditional checks in the Classic
Template block, we can ensure the features added in woocommerce/woocommerce-blocks#8324 will land in
WooCommerce Core and are not limited to the feature plugin.

See p1680000654295729-slack-C02UBB1EPEF for additional context.

* Revert isExperimentalBuild removal on registration

The conditional `isExperimentalBuild` conditional check that was
wrapping some conditional registration of the classic template
block seems to be  unrelated to the template conversion/migration.

This is something we can revisit and test separately but should not be
included in this changeset.

* Update changelog and testing instructions to include cherry-picked PRs

* Update release zip

* Update readme to be in correct order

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-04-03 01:55:04 -07:00
Alexandre Lara 7e9a4105f2 Prevent image placeholder from going outside its wrapper (https://github.com/woocommerce/woocommerce-blocks/pull/8901) 2023-03-31 14:36:17 -03:00
kmanijak 39298f1341 Remove construct method from Product Archive Compatiblity Layer (https://github.com/woocommerce/woocommerce-blocks/pull/8915)
Methods invoked in the constructor were already called when registering a class, so it duplicated the hooks
2023-03-31 15:01:25 +02:00
kmanijak 6ca96260a8 Fix the incorrect position of the after shop loop item title hook (https://github.com/woocommerce/woocommerce-blocks/pull/8911) 2023-03-31 15:00:57 +02:00
Mike Jolley af0520bb8d Show Cart and Checkout blocks in Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8888)
* Update forced layout

* Track isPreview in editor context

* Add preview to checkout

* Add preview to cart
2023-03-30 15:15:00 +01:00
kmanijak 0262bc2ab7 Make a Single Product conversion enabled in Core, but keep the Product Archive behind experimental flag (https://github.com/woocommerce/woocommerce-blocks/pull/8907) 2023-03-30 15:57:33 +02:00
Daniel W. Robert ae012817cc Remove `isExperimentalBuild` Checks in Classic Template Block (https://github.com/woocommerce/woocommerce-blocks/pull/8902)
* Remove isExperimentalBuild checks.

By removing the `isExperimentalBuild` conditional checks in the Classic
Template block, we can ensure the features added in woocommerce/woocommerce-blocks#8324 will land in
WooCommerce Core and are not limited to the feature plugin.

See p1680000654295729-slack-C02UBB1EPEF for additional context.

* Revert isExperimentalBuild removal on registration

The conditional `isExperimentalBuild` conditional check that was
wrapping some conditional registration of the classic template
block seems to be  unrelated to the template conversion/migration.

This is something we can revisit and test separately but should not be
included in this changeset.
2023-03-30 08:47:02 -04:00
Mike Jolley 9c15276488 Handle InvalidCartException in checkout route (https://github.com/woocommerce/woocommerce-blocks/pull/8896) 2023-03-30 10:53:57 +01:00
Albert Juhé Lluveras aea8bbcd81 Update woocommerce/woocommerce-blocks#8838 testing steps in WC Blocks 9.8.3 to clarify a block theme is necessary 2023-03-30 10:41:24 +02:00
Manish Menaria 392f7e17fe Add padding support for `Product Image` block (https://github.com/woocommerce/woocommerce-blocks/pull/8895)
* Refactor import and add padding support in image block

In this commit, the import statement for __experimentalGetSpacingClassesAndStyles has been refactored to use an alias getSpacingClassesAndStyles for better readability. Additionally, padding support has been added to the image block's spacing configuration.

* Refactor ProductImage to use consolidated style classes and attributes

This commit refactors the ProductImage block by using the consolidated classes and styles provided by the StyleAttributesUtils::get_classes_and_styles_by_attributes() function. This change simplifies the code, improves readability, and ensures consistent handling of styles across different block elements.
2023-03-30 12:35:32 +05:30
Albert Juhé Lluveras a0a6f0914c Add 9.8.4 testing steps 2023-03-29 15:26:27 +02:00
Albert Juhé Lluveras 6c276cd2c1 Add 9.8.4 changelog 2023-03-29 15:26:16 +02:00
Albert Juhé Lluveras ed4c83afa7 Fix unlinked border widths in WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8893) 2023-03-29 13:09:53 +02:00
Lucio Giannotta e1cccc5b8e Add Product Reviews block (https://github.com/woocommerce/woocommerce-blocks/pull/8857)
---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-28 19:14:13 +02:00
Patricia Hillebrandt ae21848aca Bump Node version to 16.15.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8885)
* Bump node version to 16.14.0

* Bump Node version to 16.15.0

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-03-28 13:49:20 -03:00
Albert Juhé Lluveras db63c7496a Add 9.8.3 testing steps 2023-03-28 18:12:40 +02:00
Albert Juhé Lluveras 25f124b298 Add 9.8.3 changelog 2023-03-28 18:12:33 +02:00
Saad Tarhi 30aed1d54b Fix duplicated Shipping method Block on the front-end (https://github.com/woocommerce/woocommerce-blocks/pull/8861)
* Fix duplicate "Shipping method" Block on the front-end

- Issue: When local pickup is enabled and the shipping method's
description is edited, the "Shipping method" is duplicated on the
front-end

- Solution: The previous regex didn't match some special characters such
as ".", "!", etc. Because of that, it considers the Local Pickup toggle
template to be missing and duplicate it.

* Fix the regex looking for block templates

The previous regex didn't account for some special characters that the
user can use for a block's title or description, such as ".", "!", etc.
As a result, the Block's template will be considered missing.

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-03-28 12:48:37 +00:00
Thomas Roberts 182c58d7d0 Add `additionalCartCheckoutInnerBlockTypes` filter to enable additional blocks in the Cart/Checkout blocks. (https://github.com/woocommerce/woocommerce-blocks/pull/8650)
* Add filter to change allowed blocks in Cart and Checkout blocks

* Add documentation for allowedBlockTypes

* Add test to check the filters work for the Checkout block

* Rename filter to additionalCartCheckoutInnerBlockTypes

* Update docs to reflect new name

* Add tests for additionalCartCheckoutInnerBlockTypes in Cart block

* Update Checkout test to reflect new filter name

* Update docs TOC to add example link
2023-03-28 05:33:28 -07:00
Albert Juhé Lluveras 38116064cb Remove code that disabled attribute lookup in e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/8849) 2023-03-28 12:48:34 +02:00
Roy Ho 2e5fcbd630 Add customer-account icon class to patterns (https://github.com/woocommerce/woocommerce-blocks/pull/8821) 2023-03-27 13:33:48 -07:00
Alexandre Lara 0ad16b2686 Add $schema property to block.json files (https://github.com/woocommerce/woocommerce-blocks/pull/8877)
This adds the $schema property to all block.json files. This is required for the block.json files to be valid according to the JSON schema. I noticed that this property was not set for some of the block.json files.
2023-03-27 17:26:46 -03:00
dependabot[bot] b6c544a535 Bump @typescript-eslint/eslint-plugin from 5.47.0 to 5.56.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8879)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.47.0 to 5.56.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.56.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  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-03-27 17:13:38 +00:00
Thomas Roberts be2ba748be Check for address on shippingData (https://github.com/woocommerce/woocommerce-blocks/pull/8878) 2023-03-27 09:33:18 -07:00
Mike Jolley 3d1caca059 Adjust response method in checkout route (https://github.com/woocommerce/woocommerce-blocks/pull/8822) 2023-03-27 14:59:18 +01:00
Luigi Teschio be4550bf5f Add compatibility layer documentation (https://github.com/woocommerce/woocommerce-blocks/pull/8854)
* add compatibility layer documentation

* Update docs/internal-developers/blockified-templates/compatibility-layer.md

Co-authored-by: kmanijak <karol.manijak@automattic.com>

---------

Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-03-27 09:41:15 +00:00
Albert Juhé Lluveras 1274a4f5b1 Release process: move the step to update the release PR to the bottom (https://github.com/woocommerce/woocommerce-blocks/pull/8836) 2023-03-27 12:41:09 +04:00
dependabot[bot] 59707b1a98 Bump lint-staged from 13.0.3 to 13.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8793)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 13.0.3 to 13.2.0.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v13.0.3...v13.2.0)

---
updated-dependencies:
- dependency-name: lint-staged
  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-03-26 17:28:02 -03:00
Luigi Teschio 746bbf7be3 Single Product Template: add the Store Notice block to the template (https://github.com/woocommerce/woocommerce-blocks/pull/8833)
* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* First try to render Product Arhcive template as blocks

* First iteration of the whole blockified product archive template

* Add tests for Single Product Details block

* Extract a blockified Product Archive Template to the templates

* Add templates to tsconfig.json so the files are resolved as part of the core code

* Add a encouragement note to use blockified version IF migration is available

* Add a Row block wrapping Product Results Count and Catalog Sorting blocks

* Move blockified product-archive from templates/ to assets/ directory

* Remove unnecessary margin from Product Results Count block

When used in a Row block in a blockified Archive Product template, Product Results Count had additional unnecessary margin which caused misalignment with the Catalog Sorting block

* Fix TypeScript error

* Update the description of the Classic Template Editor placeholder

* Remove unnecessary entry in tsconfig.json to include templates directory

It was added couple of commits earlier, since the template was kept there, but it was decided to move it to assets directory, so entry is no longer necessary

* Move the  to

* Differentiate the Classic Template placeholder description depending on the availability to convert to Products block

* Add the initial basis for the Add to Cart button

* Add E2E test that the Classic Template can be replaced with the blockified version

* Abandon writing E2E tests for now, as there's a problem to run them locally

* Trigger the single product add to cart action for each product type.

* Syntax improvement

* Set margin for Catalog Sorting to 0, so it aligns properly when used in blockified Archive Product template

* Make the blockification config, so it covers the Product Archive as well as Single Product templates

* Move the product-archive specific functions from classic-template/index.tsx to the product-archive.ts

* wip: create block structure and add initial styles

* Add alignment option to the Store Notices block and make the blockified template blocks aligned wide

That is required, so the Classic Template layout is preserved

* Create single-product.ts file which is a placeholder for the blockified Single Product template

* Add block details to the SingleProductDetails.php file

* Make Blockified Product Archive template inherit the align attibute

* Simplify the interface of blockified templates

Expose  function instead of two functions for allowing and disallowing conversion

* Add a BlockifiedTemplate type

* Rename and simplify the function checking if conversion of classic template to block version is possible

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Align the variable naming to use  instead of

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* Pass the Classic Template attributes to the blockified template instead of getting it from data store

* Include Breadcrumbs block in the Blockified Product Archive Template

* Consume alignment attributes of Catalog Sorting in the PHP render function

* Consume alignment attributes of Breadcrumbs in the PHP render function

* Show conversion button with label and description

* Add conversion placeholder (until we have all the blocks implemented)

* Remove align support from Catalog Sorting and add to Store Notices block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* Extend the get_classes_and_styles_by_attributes method with align and text_align attributes

* address CSS feedback

* Add Archive Title block to the Blockified Classic Template

* Minor getRowBlock function refactor

* add support for the custom classname

* remove save function

* Add  property to the classic templates and base the config on it instead of placeholder

* Add separate blockified template for a Product Search Results

* Pass  attribute from classic template to No Results block in Product Search Results

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* Extract the common functions between blockified archive-template and product-search-results to utils

* Enable 'Inherit query from template' in Products block by default when converting the Classic Template to blockified one

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* Improve the naming of BlockifiedTemplateConfig type

* Differentiate Product Catalog and Products By * templates. The latter include Term Description block

* improve logic and increase coverage of unit test

* Change unclear ProductsBy to ProductTaxonomy in regards to classic template conversion

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Revert the margin fix which was added already on trunk

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Add default Single Product HTML template

* Fix style issues when adding blocks inside group/stack/columns blocks

* Add Related Products to the default single product template HTML file

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* remove classname

* add blocks

* improve code

* Remove !important statement from Product Image Gallery block css

* Change width of Product Image Gallery block to initial instead of unset

* Wrap up default single product html template (https://github.com/woocommerce/woocommerce-blocks/pull/8632)

* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* Add tests for Single Product Details block

* Add the initial basis for the Add to Cart button

* Trigger the single product add to cart action for each product type.

* wip: create block structure and add initial styles

* Add block details to the SingleProductDetails.php file

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* address CSS feedback

* add support for the custom classname

* remove save function

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* improve logic and increase coverage of unit test

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* remove classname

* fix crash

* update template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Fix images width in the Single Product page

* Remove the !important attribute from the Product Image Gallery block

* fix sku block

* improve layout

* improve layout

* improve layout

* improve layout

* improve layout

* update label

* Single Product Template: add store notice block

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-03-26 21:19:28 +02:00
dependabot[bot] a2ae2a5527 Bump @storybook/addon-a11y from 6.5.9 to 6.5.16 (https://github.com/woocommerce/woocommerce-blocks/pull/8722)
Bumps [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/addons/a11y) from 6.5.9 to 6.5.16.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.16/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.16/addons/a11y)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  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-03-26 16:17:18 -03:00
dependabot[bot] 867e183700 Bump @types/react from 17.0.47 to 18.0.29 (https://github.com/woocommerce/woocommerce-blocks/pull/8852)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.47 to 18.0.29.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  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-03-26 14:26:27 +00:00
Alexandre Lara 22a9a479ae Related Products: Move Notice block to the Inspector Control section (https://github.com/woocommerce/woocommerce-blocks/pull/8843)
* Add Notice component to the Inspector Controls section of the Related Products block

* Change margin css attribute to use the short syntax

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

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-03-24 14:03:12 -03:00
Alba Rincón 91eb482e17 Mini-cart buttons: add explanation regarding why we need to check for children (https://github.com/woocommerce/woocommerce-blocks/pull/8847)
* Add comment explanation regarding the children buttons

* Update comment

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

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-03-24 16:25:09 +01:00
Saad Tarhi 2662cf09bd Update 970.md 2023-03-24 15:01:02 +00:00
Alba Rincón aa601fe102 Mini-cart: add the option to change the style between 'Outline' and 'Fill' in all the buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8835)
* Render inner buttons on the frontend

* Add deprecation to the buttons

* Fix lint and inline save

* Remove commented out code and fix condition

* Change migrate condition

* Add styles outline and fill styles to cart and checkout buttons

* Add fill and outline styles to the start shopping button

* Refactor variants

* Remove imports

* Add classname default value

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-03-24 10:14:06 +01:00
Manish Menaria 1416642cd2 Add more Inspector controls for Product(Add to cart) button (https://github.com/woocommerce/woocommerce-blocks/pull/8781)
* Add Fill & Outline styles to Product button

This commit adds the Fill & Outline styles to the Product button block.
You can see new Styles section in Inspector Controls where you will be able to change between Fill & Outline styles.

* Add width setting to product button

The button block now has a width selector, which allows the user to
set the button to 25%, 50%, 75%, or 100% of the parent container.
By default, a button's width is determined by the size of its content.

You can find this setting in the button block's sidebar.

* Enable all typography controls

Now following typography controls are also available:
- Font Family
- Appearance
- Line height
- Letter spacing
- Decoration
- Letter case

* Fix width settings not working

* Fix align doesn't work with Width settings

* Fix width setting not working in Single product block

* Fix - Default button is shorter on the frontend

In Editor default and outlined button has the same height. Outlined button in the frontend as well. But default button on the frontend is shorter (smaller padding)

More info: https://github.com/woocommerce/woocommerce-blocks/pull/8781#issuecomment-1477527049

* Fix - background color not matching when GB is enabled

* Fix - 100% width button exceeds the container

Fix following issues:
- "Select Options" or "View products" for variable and grouped products don't respect the container max width
- Also, for small width (25%) they are wider

More info: https://github.com/woocommerce/woocommerce-blocks/pull/8781#issuecomment-1477527049

* Fix: Width setting not working in All Products block

This commit fixes the width setting not working in the All Products block.

* Keep other classes along with Width setting classes

`block.attributes.className` should be kept along with the width setting classes.
```
className: classnames( block.attributes.className, {
	[ `has-custom-width wp-block-button__width-${ block.attributes?.width }` ]:
		block.attributes?.width,
} )
```

* Translate styles label in block configuration
2023-03-24 12:38:43 +05:30
Tarun Vijwani 8b57aa35cb Fix _n usage to use plural and singular correctly (https://github.com/woocommerce/woocommerce-blocks/pull/8749)
* Fix _n usage to use plural and singular correctly

* Replace switch condition with if else

- Replace switch condition with if else for better readability.

* Add packageCount in LocalPickupSelect component

- packageCount prop was missing from LocalPickupSelect component. Add packageCount in LocalPickupSelect component.

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-03-24 10:52:38 +04:00
Luigi Teschio 4451dbb323 Product Image Gallery: remove attributes key (https://github.com/woocommerce/woocommerce-blocks/pull/8825) 2023-03-23 18:00:16 +01:00
Alba Rincón 2555beadf5 Provide a way to switch to the blockified Single Product Template (https://github.com/woocommerce/woocommerce-blocks/pull/8324)
* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* First try to render Product Arhcive template as blocks

* First iteration of the whole blockified product archive template

* Add tests for Single Product Details block

* Extract a blockified Product Archive Template to the templates

* Add templates to tsconfig.json so the files are resolved as part of the core code

* Add a encouragement note to use blockified version IF migration is available

* Add a Row block wrapping Product Results Count and Catalog Sorting blocks

* Move blockified product-archive from templates/ to assets/ directory

* Remove unnecessary margin from Product Results Count block

When used in a Row block in a blockified Archive Product template, Product Results Count had additional unnecessary margin which caused misalignment with the Catalog Sorting block

* Fix TypeScript error

* Update the description of the Classic Template Editor placeholder

* Remove unnecessary entry in tsconfig.json to include templates directory

It was added couple of commits earlier, since the template was kept there, but it was decided to move it to assets directory, so entry is no longer necessary

* Move the  to

* Differentiate the Classic Template placeholder description depending on the availability to convert to Products block

* Add the initial basis for the Add to Cart button

* Add E2E test that the Classic Template can be replaced with the blockified version

* Abandon writing E2E tests for now, as there's a problem to run them locally

* Trigger the single product add to cart action for each product type.

* Syntax improvement

* Set margin for Catalog Sorting to 0, so it aligns properly when used in blockified Archive Product template

* Make the blockification config, so it covers the Product Archive as well as Single Product templates

* Move the product-archive specific functions from classic-template/index.tsx to the product-archive.ts

* wip: create block structure and add initial styles

* Add alignment option to the Store Notices block and make the blockified template blocks aligned wide

That is required, so the Classic Template layout is preserved

* Create single-product.ts file which is a placeholder for the blockified Single Product template

* Add block details to the SingleProductDetails.php file

* Make Blockified Product Archive template inherit the align attibute

* Simplify the interface of blockified templates

Expose  function instead of two functions for allowing and disallowing conversion

* Add a BlockifiedTemplate type

* Rename and simplify the function checking if conversion of classic template to block version is possible

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Align the variable naming to use  instead of

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* Pass the Classic Template attributes to the blockified template instead of getting it from data store

* Include Breadcrumbs block in the Blockified Product Archive Template

* Consume alignment attributes of Catalog Sorting in the PHP render function

* Consume alignment attributes of Breadcrumbs in the PHP render function

* Show conversion button with label and description

* Add conversion placeholder (until we have all the blocks implemented)

* Remove align support from Catalog Sorting and add to Store Notices block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* Extend the get_classes_and_styles_by_attributes method with align and text_align attributes

* address CSS feedback

* Add Archive Title block to the Blockified Classic Template

* Minor getRowBlock function refactor

* add support for the custom classname

* remove save function

* Add  property to the classic templates and base the config on it instead of placeholder

* Add separate blockified template for a Product Search Results

* Pass  attribute from classic template to No Results block in Product Search Results

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* Extract the common functions between blockified archive-template and product-search-results to utils

* Enable 'Inherit query from template' in Products block by default when converting the Classic Template to blockified one

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* Improve the naming of BlockifiedTemplateConfig type

* Differentiate Product Catalog and Products By * templates. The latter include Term Description block

* improve logic and increase coverage of unit test

* Change unclear ProductsBy to ProductTaxonomy in regards to classic template conversion

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Revert the margin fix which was added already on trunk

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Add default Single Product HTML template

* Fix style issues when adding blocks inside group/stack/columns blocks

* Add Related Products to the default single product template HTML file

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* remove classname

* add blocks

* improve code

* Remove !important statement from Product Image Gallery block css

* Change width of Product Image Gallery block to initial instead of unset

* Wrap up default single product html template (https://github.com/woocommerce/woocommerce-blocks/pull/8632)

* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* Add tests for Single Product Details block

* Add the initial basis for the Add to Cart button

* Trigger the single product add to cart action for each product type.

* wip: create block structure and add initial styles

* Add block details to the SingleProductDetails.php file

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* address CSS feedback

* add support for the custom classname

* remove save function

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* improve logic and increase coverage of unit test

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* remove classname

* fix crash

* update template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Fix images width in the Single Product page

* Remove the !important attribute from the Product Image Gallery block

* fix sku block

* improve layout

* improve layout

* improve layout

* improve layout

* improve layout

* update label

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-23 17:59:59 +01:00
Alba Rincón 2d9519b3ba Add style to the `Mini Cart` buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8776)
* Create new car button inner block

* Create new checkout button inner block

* Render inner buttons on the frontend

* Fix buttons size

* Add outline to the cart button

* Add color props

* Add urls

* Fix button classes

* Add classes to edit

* Start using editable button

* Add buttons to mini cart tempalte

* Reorder buttons in template

* Add cart & checkout buttons scripts

* Remove unnecessary divs

* Change checkout button block name

* Change cart button block name

* Add deprecation to the buttons

* Fix lint and inline save

* Remove commented out code and fix condition

* Render buttons if no children

* Change migrate condition

* Simplify condition

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

* Make props optional

* Add missing import

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-03-23 16:55:53 +01:00
Albert Juhé Lluveras c9a6391e20 Fix border styles not visible in the editor in Featured Product and Featured Category blocks in core (https://github.com/woocommerce/woocommerce-blocks/pull/8838) 2023-03-23 15:36:46 +01:00
Albert Juhé Lluveras bf73555ee3 Update woocommerce/woocommerce-blocks#8494 testing steps for WC Blocks 9.7.0 to account for recent changes introduced after the PR was created 2023-03-23 15:19:13 +01:00
Luigi Teschio d5cb9b0248 Product SKU: no render the prefix when the SKU isn't defined (https://github.com/woocommerce/woocommerce-blocks/pull/8837) 2023-03-23 14:08:48 +00:00
Roy Ho 48fde013ea Add decoding to product names (https://github.com/woocommerce/woocommerce-blocks/pull/8824)
* Add decoding to product names

* Fix linting error
2023-03-23 06:27:02 -07:00
Albert Juhé Lluveras 0bfd760c25 9.7.0 testing steps: move Product Price styling steps to the Feature Plugin section 2023-03-23 11:59:51 +01:00
Mike Jolley 280040653c Avoid returning before hooks are run (https://github.com/woocommerce/woocommerce-blocks/pull/8820) 2023-03-23 10:24:04 +00:00
Luigi Teschio 9baad55f4f Stock Indicator Block: remove unused save function (https://github.com/woocommerce/woocommerce-blocks/pull/8832) 2023-03-23 08:43:42 +00:00
kmanijak a06f4fbd91 Normalise the search param for comparison to avoid endless redirections (https://github.com/woocommerce/woocommerce-blocks/pull/8784)
* Replace single quote with the encoded version %27 for URL comparison

This is required as as removeQueryArgs() function uses decodeURIcomponent method which doesn't encode single quotes (') while it was still encoded in the original URL (%27). So when the single quote was in a query param, for example as a search term, it caused endless redirection loop.

* Replace single quote with the encoded version %27 for URL comparison in Filter by Rating

* refactor the solution so it encodes the href rather than decode the newly created URL

* Refactor the normalisation

* Add tests to normalisation function
2023-03-23 08:42:23 +01:00
Albert Juhé Lluveras f29954abbc Add 9.8.2 testing steps 2023-03-22 16:07:16 +01:00
Albert Juhé Lluveras 03846552cf Add 9.8.2 changelog 2023-03-22 16:07:09 +01:00
Alexandre Lara f39d8b7943 Add default Single Product HTML template (https://github.com/woocommerce/woocommerce-blocks/pull/8515)
* Add default Single Product HTML template

* Fix style issues when adding blocks inside group/stack/columns blocks

* Add Related Products to the default single product template HTML file

* Remove !important statement from Product Image Gallery block css

* Change width of Product Image Gallery block to initial instead of unset

* Wrap up default single product html template (https://github.com/woocommerce/woocommerce-blocks/pull/8632)

* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* Add tests for Single Product Details block

* Add the initial basis for the Add to Cart button

* Trigger the single product add to cart action for each product type.

* wip: create block structure and add initial styles

* Add block details to the SingleProductDetails.php file

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* address CSS feedback

* add support for the custom classname

* remove save function

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* improve logic and increase coverage of unit test

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* remove classname

* fix crash

* update template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Fix images width in the Single Product page

* Remove the !important attribute from the Product Image Gallery block

* fix sku block

* improve layout

* fix header and footer template parts declaration

---------

Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-22 15:00:48 +00:00
Albert Juhé Lluveras 24be5ab041 Update 9.8.0 testing steps for woocommerce/woocommerce-blocks#8594 so they account for WC core testing 2023-03-22 14:04:42 +01:00
Paulo Arromba 9f7bf6fb04 Added CheckoutSchema::$image_attachment_schema property (https://github.com/woocommerce/woocommerce-blocks/pull/8802) 2023-03-22 13:04:24 +00:00
Saad Tarhi 547cc76f8e Fix save changes bug in Firefox browser (https://github.com/woocommerce/woocommerce-blocks/pull/8754) 2023-03-22 12:45:48 +00:00
kmanijak a5714a6519 Use shared save function for all the product elements blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8813)
* Use attributes provided to save function in product-price block

* remove save function and use the shared one

* fix import

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-03-22 11:52:50 +00:00
Seghir Nadir ad23e12dc9 fix shipping test (https://github.com/woocommerce/woocommerce-blocks/pull/8815) 2023-03-22 12:24:45 +01:00
kmanijak 752fd37a0b Make Product SKU editable (https://github.com/woocommerce/woocommerce-blocks/pull/8804) 2023-03-22 09:29:49 +01:00
Albert Juhé Lluveras 5235f6c392 Allow themes to remove the Mini Cart title on overridden template parts (https://github.com/woocommerce/woocommerce-blocks/pull/8779)
* Allow themes to remove the Mini Cart title on overridden template parts

* Remove unused file
2023-03-22 08:23:52 +01:00
Tarun Vijwani 82c59ffb29 Display the link to add the shipping address when shipping address is not available (https://github.com/woocommerce/woocommerce-blocks/pull/8141) 2023-03-22 11:15:13 +04:00
Albert Juhé Lluveras 6a629c60b2 Fix Customer Account block doing a 404 request in the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/8798) 2023-03-21 11:31:20 +01:00
Mike Jolley ef97fad080 Add woocommerce_cart_item_permalink filter to cart endpoint (https://github.com/woocommerce/woocommerce-blocks/pull/8726) 2023-03-21 10:14:29 +00:00
Albert Juhé Lluveras a85b80e6ac Update release version at the beginning of the release process (https://github.com/woocommerce/woocommerce-blocks/pull/8788)
* Update release version at the beginning of the release process

* Add back code that updated versions on deploy
2023-03-20 18:07:15 +01:00
Luigi Teschio f9cdca7625 Remove Single Product Block (https://github.com/woocommerce/woocommerce-blocks/pull/8763)
* Remove Single Product Block

* remove more files that belong the Single Product block

* fix php linter error

* remove Product Tag List and Product Category List blocks
2023-03-20 13:27:23 +00:00
Albert Juhé Lluveras 23312534da Release process: check svn tag before WP.org version and add instruction about dev notes (https://github.com/woocommerce/woocommerce-blocks/pull/8756)
* Release steps: check svn version before checking WP.org version

* Add instruction to include dev notes
2023-03-20 11:24:06 +01:00
Luigi 82d27155d5 Merge branch 'release/9.6.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-03-17 16:59:27 +01:00
github-actions[bot] 29e49f76d5 Release: 9.6.6 (https://github.com/woocommerce/woocommerce-blocks/pull/8778)
* Empty commit for release pull request

* Add changelog to readme.txt

* Unset default customer state if it doesn't match country (https://github.com/woocommerce/woocommerce-blocks/pull/8460)

* Unset default state

* add controller for customers

* rename validation file

* explain fix inline

* address feedback

* revert back state logic

* Update src/StoreApi/Utilities/ValidationUtils.php

Co-authored-by: Mike Jolley <mike.jolley@me.com>

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update readme.txt

* Add testing notes

* Update testing notes

* Fix Customer account sidebar link incorrect margin in WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8437)

* Fix Customer account sidebar link incorrect margin in WP 6.2

* Update class name to match the guidelines

* Prevent cart from breaking when item_data contains an array (https://github.com/woocommerce/woocommerce-blocks/pull/8440)

* Ensure array item data is removed

* Remove unused key

* Clean up code and add comments

* Check for null instead of empty

* Use plain foreach to filter and map arrays

* Add minimum height to Mini Cart Contents block in the Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8458)

* Update testing notes zip file

* Update testing notes

* Update testing notes file

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* disable compatibilty layer (https://github.com/woocommerce/woocommerce-blocks/pull/8507)

* update changelog and testing instructions

* add zip link

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Add changelog in readme.txt

* Add testing notes

* Remove change from testing notes

This requires AvaTax credentials for testing. So, we'll test for
regressions instead

* Check for null session before going forward (https://github.com/woocommerce/woocommerce-blocks/pull/8537)

* Fix Payment Options settings crash in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/8535)

* Ensure express payment buttons are visible next to each other (https://github.com/woocommerce/woocommerce-blocks/pull/8548)

* Update ZIP file

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Update readme.txt

* Show three Express Payments buttons in-line (https://github.com/woocommerce/woocommerce-blocks/pull/8601)

* Add testing notes

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Add changelog in readme.txt

* Undo dirty prop removal on error (https://github.com/woocommerce/woocommerce-blocks/pull/8633)

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Add testing notes

* fix 404 error (https://github.com/woocommerce/woocommerce-blocks/pull/8445)

* Empty commit for release pull request

* add testing instruction

* update zip link

* fix version

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-03-17 16:47:41 +01:00
Tarun Vijwani ef24a42211 Add validation error to prevent checkout when there is no shipping method available (https://github.com/woocommerce/woocommerce-blocks/pull/8384)
* Prevent checkout when no shipping rates available

-  Add the validation error in ShippingSelector to prevent checkout when no shipping rates available.
- Add notice to Checkout processor so that notice appears after clicking on place order button.

* Fix TypeScript error in checkout shipping method block

-   Make multiple prop as optional in RatePrice component to fix TypeScript error.
2023-03-17 19:32:03 +04:00