Commit Graph

5534 Commits

Author SHA1 Message Date
Alba Rincón 0aa8c79790 [Pattern] Add new `Product Collections: Newest Arrivals` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9240)
* Add new `Product Collections: Newest Arrivals` pattern

* Remove ID

* Improve paddings

* Use product image with thumbnail style
2023-05-03 10:03:45 +02:00
Albert Juhé Lluveras 4534beaa91 Fix Mini Cart block not respecting Add-to-Cart behaviour attribute when adding the first product (https://github.com/woocommerce/woocommerce-blocks/pull/9257) 2023-05-03 09:49:43 +02:00
Mike Jolley 1a0f209770 Fix shipping notices for multiple packages (https://github.com/woocommerce/woocommerce-blocks/pull/9285)
* Move notice to top and only show on cart page

* Missing setting on cart page prevents notice display

* Allow null in the select-shipping-rate endpoint to select all packages

* Only show the warning if different packages are selected

* Check if selected rates is an object before mapping it

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-05-02 16:04:29 +01:00
Roy Ho bcfc330f8a Add/featured category focus pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9322)
* Add category focus pattern

* Fix text

* Explicit add padding and make image smaller
2023-05-02 07:16:44 -07:00
Albert Juhé Lluveras bad0222385 Related Products: make Product Title a link (https://github.com/woocommerce/woocommerce-blocks/pull/9179) 2023-05-02 11:36:23 +02:00
Luigi Teschio 114ba02135 Product Image Gallery: fix inline (https://github.com/woocommerce/woocommerce-blocks/pull/9297) 2023-05-02 09:11:58 +00:00
Alexandre Lara 448f8102d9 Product Rating block: Fix review count not displaying on frontend (https://github.com/woocommerce/woocommerce-blocks/pull/9129)
* Fix review count not displaying on Product Rating

* Fix PHP CS errors

* Add Customer Reviews count to the Product Rating block on the Editor

* Remove unnecessary var_dump
2023-04-28 14:26:43 -03:00
Roy Ho 5297d93d37 Add featured category triple pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9269) 2023-04-28 05:35:54 -07:00
Alba Rincón 9524c3607d Add new `Product collections: Featured Collection` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9246)
* Add new `Product collections: Featured Collection` pattern

* Improve padding

* Set text color to white

* Make string translatable
2023-04-28 13:58:46 +02:00
Mike Jolley 2d506f9f57 Fix/you do not need lodash (https://github.com/woocommerce/woocommerce-blocks/pull/9161)
* Remove lodash `without` usage

* isNumber

* Remove lodash `difference`

* Replace lodash isEmpty with type guard

* Replace isObject with type guard

* remove lodash noop

* Replace lodash clamp

* replace lodash uniqueId

* Remove uniqueId import

* Add eslint rule to restrict lodash import

* Replace lodash range

* Replace lodash has() function

Replace lodash has

* replace omitby

* Replace lodash isEqual with fastDeepEqual

* Replace kebabCase with change-case package

* Replace lodash camelCase

Replace lodash mapKeys with function

Move mapkeys to utility

Create camelCaseKeys which replaces usage of mapKeys

* Replace lodash debounce with custom utiity

* replace lodash keyby

* Replace lodash pick with native function

* Replace lodash cloneDeep with klona

* Replace snake case keys package with change case

* Replace sortBy with fast sort package

* replace isEmpty with type guard

* Replace pickBy usage in validation reducer

* Replace groupBy usage in search list control

* Replace flatten, uniqBy usage in getProducts()

* Remove setWith and clone from updateState

* Replace custom useThrottle with useThrottledCallback from use-debounce package

* onSelectRate can use-debounce

* Fix missing flatten

* Update assets/js/data/cart/test/push-changes.ts

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

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-04-28 11:29:45 +01:00
Tom Cafferkey a22ab08410 Remove min-height and padding for WP Button elements (https://github.com/woocommerce/woocommerce-blocks/pull/9260)
* Remove min-height and padding for WP Button elements

* Remove commented out code

* Add min-height style back in for .woocommerce-block-theme-has-button-styles themes
2023-04-28 10:49:12 +01:00
Andres 98222dda09 Fix store api documentation for min_price and max_price (https://github.com/woocommerce/woocommerce-blocks/pull/9258)
* Fixed store api documentation for min_price and max_price

* Update products.md

* Update products.md

* Update src/StoreApi/docs/products.md

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

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-04-28 10:56:22 +02:00
Manish Menaria 1e1b82ad63 Products block: Using nested selector to add margin between Product elements (https://github.com/woocommerce/woocommerce-blocks/pull/8993)
* Using nested selector to style Product elements in Products Block

This commit simplifies the INNER_BLOCKS_TEMPLATE array in the product-query constants.ts file by removing the style properties from the individual elements. Instead, the default styles are now managed in the style.scss file, providing a more consistent and centralized approach to styling.

In the style.scss file, a new section for default styling has been added to handle product elements inside the Products Block, adhering to the Gutenberg styling hierarchy. This ensures the lowest precedence in the hierarchy, allowing for easier overrides when needed.

* Decrease specificity of styles for product elements in Products Block

The commit changes the default styles for product elements inside the 'Products Block'. It changes the way the margin-bottom and margin-top properties are set by using the :where() selector instead of using the .products-block-post-template class selector. This is done to decrease the specificity of the CSS selector, ensuring that the styles have the lowest precedence in the hierarchy. It also removes the display: inline-block property from the a selector, and moves the styles to the .editor-styles-wrapper class selector.

* Decrease specificity of CSS selectors

In these changes, the product elements inside the Products Block have been restyled. The specificity of the CSS selector has been decreased using the :where() selector, to ensure that these styles have the lowest precedence in the hierarchy.

In constants.ts, a new class name, products-block-post-template, has been added to the inner block template for the post. This class is used to add default styles for inner blocks.

In style.scss, the CSS selector for the inner blocks has been updated to include the new class name. The :where() selector has also been used to ensure that these styles have the lowest precedence in the hierarchy.

* Update default margins and remove redundant entries

This commit updates the default margin values for the Product Title in the Products block, moving them from the style.scss file to the constants.ts file. It also removes unnecessary empty arrays in the INNER_BLOCKS_TEMPLATE and background-color property from the style.scss file.
2023-04-28 07:43:47 +00:00
Albert Juhé Lluveras d7fa7a3310 10.1.0 testing steps: move Mini Cart width items under Feature plugin section (https://github.com/woocommerce/woocommerce-blocks/pull/9263) 2023-04-28 09:17:53 +02:00
Tarun Vijwani 4934d19b6a Fix coupon code translation in e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/9247)
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-04-28 10:40:36 +04:00
Alexandre Lara aacd82c8fb Single Product block: Add wide and full-width alignments support (https://github.com/woocommerce/woocommerce-blocks/pull/8981)
* Add align support to single product block

* Fix block alignment that was not being set on the frontend

* Remove classname prop from the Single Product Edit component
2023-04-27 16:44:10 -03:00
Luigi Teschio 1d0ff02f8f Rename Add To Cart Form to Add To Cart Options (https://github.com/woocommerce/woocommerce-blocks/pull/9238) 2023-04-27 17:05:50 +00:00
Albert Juhé Lluveras 1dc7c953eb Rename docs which unnecessary mention the All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/9265)
* Rename docs which unnecessary mention the All Products block

* Fix two more links
2023-04-27 18:26:18 +02:00
Alba Rincón 4cea6664a5 [Patterns]: Add new `Header Centered Search` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9081)
* Add new `Header Centered Search` pattern

* Add margin support to the customer account block

* Add margin to the customer account to separate it from the search bar

* Update margin

* Add with, fix margins

* Remove unnecessary separator

* Updates after review

* Remove ref

* Remove separator

* Bring back separator and use product search

* Remove html block and fix search border
2023-04-27 10:23:24 +02:00
Alba Rincón 2b75d821fa [Patterns] Add new `Footer with 3 menus` menu (https://github.com/woocommerce/woocommerce-blocks/pull/9175)
* Add new `Footer with 3 menus` menu

* Stack menus on mobile, remove refs

* Change the site title to a `p` tag

* Align menus to the top and add paddings

* Make the `powered by` string translatable and add padding

* Improve search
2023-04-27 10:22:43 +02:00
Paulo Arromba 7fd3063239 re added codeql-analysis.yml (https://github.com/woocommerce/woocommerce-blocks/pull/9253) 2023-04-26 21:09:55 +01:00
Paulo Arromba a50e2a91a5 Update CodeQL/Analyse (https://github.com/woocommerce/woocommerce-blocks/pull/9156)
* yaml format, typescript test

* removed codeql-analysis.yml

* typo fix for CI trigger

* Revert "removed codeql-analysis.yml"

This reverts commit 0badabe02a006fd7b1cffa9aac1eb2bc138ff964.

* re-add codeql-analysis.yml

* removed codeql-analysis.yml
2023-04-26 19:50:19 +01:00
Alexandre Lara 27b3b47edd Update plugin version 2023-04-26 14:25:17 -03:00
Alexandre Lara cdb41422ca Update changelog and testing notes with PRs woocommerce/woocommerce-blocks#9195 and woocommerce/woocommerce-blocks#9196 2023-04-26 14:22:07 -03:00
Alexandre Lara 43b58d41d6 Add PR woocommerce/woocommerce-blocks#9196 to the release notes 2023-04-26 14:21:51 -03:00
Alexandre Lara b3f6bb7a61 Update woocommerce-gutenberg-products-block.zip link 2023-04-26 14:21:39 -03:00
Alexandre Lara 0dac78f781 Add some improvements to the testing notes 2023-04-26 14:21:27 -03:00
Alexandre Lara 54059baf00 Update testing notes 2023-04-26 14:21:02 -03:00
Alexandre Lara 3349140955 Add testing notes for the release 2023-04-26 14:20:49 -03:00
Alexandre Lara 7e1be7ab29 Increase WordPress and WooCommerce minimum versions 2023-04-26 14:20:32 -03:00
Alexandre Lara 59c6885476 Update version number in several files 2023-04-26 14:20:11 -03:00
Alexandre Lara 968337cc51 Add changelog entries to readme.txt 2023-04-26 14:18:54 -03:00
Mike Jolley 61bc923949 Add examples for adding variations to the cart (https://github.com/woocommerce/woocommerce-blocks/pull/9086)
Fixes woocommerce/woocommerce-blocks#8626
2023-04-26 16:24:33 +01:00
Albert Juhé Lluveras 0dae33e4b9 Use currentColor for Mini Cart footer border (https://github.com/woocommerce/woocommerce-blocks/pull/9245) 2023-04-26 16:59:35 +02:00
Luigi Teschio 8e0709eb9a Update the icon and description for the Product Details block (https://github.com/woocommerce/woocommerce-blocks/pull/9241)
* Update icon and description for the Product Details block

* fix alt
2023-04-26 16:19:01 +02:00
Luigi Teschio 2ca2287cb8 Update icon and description for the Product Meta block (https://github.com/woocommerce/woocommerce-blocks/pull/9243)
* Update icon and description for the Product Meta block

* fix alt
2023-04-26 12:16:54 +00:00
Albert Juhé Lluveras cb8040f7b0 Mini Cart Contents block: fix wide width not being applied in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/9201) 2023-04-26 12:16:43 +02:00
Daniel W. Robert aa219a1aa1 Fix Semgrep Security Scan Issues (https://github.com/woocommerce/woocommerce-blocks/pull/9204)
* Add late escaping to  call in MiniCart.

* Add escaping to  call in AssetsController.

* Add escaping to  calls in StoreAPI pagination utils.

* Add ignore line to file require - OK.

* Minor update to grammar in code comment.
2023-04-25 21:41:26 -04:00
Albert Juhé Lluveras 96bd0432cd Mini Cart Contents block: set minimum width (https://github.com/woocommerce/woocommerce-blocks/pull/9196)
* Mini Cart Contents block: set minimum width

* Mini Cart Contents block: allow changing the width only in the feature plugin

* Allow resetting the Mini Cart Contents width to the default

* Update assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx

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

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-04-25 18:54:35 +02:00
Alba Rincón 1673fcb3c2 [Patterns]: Add new `Featured products: 5-item grid` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9006)
* Add new pattern

* Style improvements after review

* Fix price on mobile and image thumbnail

* Remove columns for title and price

* Review improvements

* Use shop url

* Make the product title bold
2023-04-25 16:22:58 +02:00
Roy Ho 212a600477 Add testimonials single pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9184)
* Add testimonials single pattern

* Fix invalid content

* Align message
2023-04-25 06:58:27 -07:00
Albert Juhé Lluveras ce97f918ea Mini Cart block: fix slide in animation (https://github.com/woocommerce/woocommerce-blocks/pull/9195) 2023-04-25 13:39:21 +02:00
Albert Juhé Lluveras d0294f1abf Patch release checklist: clarify whether the PR must have trunk or release/x.y as the base branch (https://github.com/woocommerce/woocommerce-blocks/pull/9182) 2023-04-25 10:36:30 +02:00
Karol Manijak 948db63e95 Temporarily disable Playwright tests until the conflict with PHP version is resolved (https://github.com/woocommerce/woocommerce-blocks/pull/9183)
* Temporarily disable Playwright tests until the conflict with PHP versions is resolved

* Use a correct syntax

* Remove unwanted change
2023-04-24 16:57:38 +02:00
Alba Rincón 98dc3d2eab [Patterns]: Add new `Featured Products 2 columns` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9072)
* Add new `Featured Products 2 columns` pattern

* Remove line separator

* Change title and add shop url

* Improve copy
2023-04-24 10:33:15 +02:00
Alba Rincón f2c19e0ac2 Add new `Testimonials: 3 columns` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9159) 2023-04-24 10:15:55 +02:00
Thomas Roberts 30aecd2068 Reinstate "Hide shipping costs until an address is entered" but disable it when using local pickup (https://github.com/woocommerce/woocommerce-blocks/pull/8964)
* Add class property to track local pickup enabled

* Force shipping enabled only when local pickup is also enabled

Otherwise, skip filtering and leave it to the current value

* Disabled and add text to WC Core hide shipping option

* Skip forcing shipping to be enabled in all cases

* Remove WC Core setting changes for hidden shipping rates option

* Add warning to local pickup UI about hidden rates setting in core

* Add local_pickup_enabled util function

* Revert "Skip forcing shipping to be enabled in all cases"

This reverts commit 0bf1886e73d791f7828ac86988f681cdce808b12.

* Check if local pickup is enabled before force enabling shipping

* Show correct shipping placeholder if rates hidden until address entered

* Remove tests for removed functionality

* Remove shippingCostRequiresAddress prop

* Update tests for shipping settings

* Remove irrelevant tests and fix existing ones

* Fix typo in comment

* Disable local pickup after each test

* Get shipping data from useCustomerData hook

* Change div in help prop to span

This prevents a DOM Nesting error, div cannot appear as a descendant of p

* Prevent hide shipping notice showing if the setting was originally off
2023-04-22 02:10:11 -07:00
Daniel W. Robert 6903009af3 Add prepare script for Husky configuration. (https://github.com/woocommerce/woocommerce-blocks/pull/9167) 2023-04-21 16:51:56 -04:00
Roy Ho bb28479db5 Update php installation link (https://github.com/woocommerce/woocommerce-blocks/pull/9169)
* Update php installation link

* Set temporary debugging

* Add an exception to ignore valid link check
2023-04-21 13:18:30 -07:00
Tarun Vijwani e39a27bd74 Add theme-level global styles to Cart and Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/8809)
* Dummy commit to open a PR

* Revert the last change

* Ensure Checkout block supports the theme-level global styles for `Colors » Buttons` (https://github.com/woocommerce/woocommerce-blocks/pull/8844)

* Add GS support for button colors in Checkout block

* Sync button hover effect with GB

* Fix link margin/padding (https://github.com/woocommerce/woocommerce-blocks/pull/8908)

* Replace <AddToCartButton /> with <ProductButton /> (https://github.com/woocommerce/woocommerce-blocks/pull/8914)

* Add GS support for button typography in Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/8918)

* Ensure Checkout block supports the theme-level global styles for Typography » Buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8892)

* Remove classname from cart image to avoid conflicts (https://github.com/woocommerce/woocommerce-blocks/pull/8898)

Co-authored-by: Niels Lange <info@nielslange.de>

* Use consistent and semantically correct HTML elements in the Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/9065)

* Allow button height to adjust

* Ensure to display full width heading background

* Inherit font style and font weight for headings

* Inherit font style and font weight for textarea

* Inherit font family and font weight for buttons

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-04-22 00:11:10 +04:00
Kirtan Gajjar 030a9ae267 Fix filter by stock status dropdown ordering (https://github.com/woocommerce/woocommerce-blocks/pull/9127)
* Fix filter by stock status dropdown ordering

* Update assets/js/blocks/stock-filter/utils.ts

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

* Update assets/js/blocks/stock-filter/utils.ts

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

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-04-21 14:04:34 -03:00
Paulo Arromba 7c25db1c80 Add PHP 8.1/8.2 to unit testing matrix (https://github.com/woocommerce/woocommerce-blocks/pull/8757)
* Added PHP 8.1 to unit testing matrix

* Refactor unit testing to match Gutenberg repo 🤞

* Removed Gutenberg reference from debug information

* Updated image running phpunit binary

* Reverted image running phpunit binary

* Remove composer platform override

* Bump @wordpress/env and include phpunit

* Update phpunit and tests

* Change prefix

* Try admin context when install wc

* try wc install

* adjust phpunit config file

* Updated phpunit.xml.dist, composer.json and package.json

* Added PHP 8.1 to unit testing matrix

* Refactor unit testing to match Gutenberg repo 🤞

* Removed Gutenberg reference from debug information

* Updated image running phpunit binary

* Reverted image running phpunit binary

* Remove composer platform override

* Bump @wordpress/env and include phpunit

* Update phpunit and tests

* Change prefix

* Try admin context when install wc

* try wc install

* adjust phpunit config file

* Updated phpunit.xml.dist, composer.json and package.json

* Revert install changes

* updated npm packages

* updated composer lock

* updated check assets flow

* Updated check assets flow. Yaml file auto formatted.

* Updated check assets flow.

* Attempt at fixing E2E

* Reverted setup permissions step

* Add logging information to E2E

* Reverted E2E test flow

* test playwright perms fix

* test e2e perms fix

* test e2e perms fix

* test e2e perms fix

* test e2e perms fix

* languages update & debug

* languages update & debug

* revert

* force "@wordpress/env": "^4.9.0" on E2E

* update package lock

* update package lock

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-04-21 12:07:37 +01:00
github-actions[bot] a2ca41e367 Release: 10.0.3 (https://github.com/woocommerce/woocommerce-blocks/pull/9149)
* Empty commit for release pull request

* Add 10.0.3 changelog

* Update versions to 10.0.3

* Fix image editor in Featured Product/Category blocks on WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9142)

* Add 10.0.3 testing steps

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-04-21 12:40:53 +02:00
Albert Juhé Lluveras 8de8fc917c Add 10.0.3 testing steps 2023-04-21 10:44:43 +02:00
Albert Juhé Lluveras fa8d88a7c3 Add 10.0.3 changelog 2023-04-21 10:44:28 +02:00
Albert Juhé Lluveras 467e9734a2 Add 9.8.5 testing steps 2023-04-21 10:20:11 +02:00
Albert Juhé Lluveras 701a7269b2 Add 9.8.5 changelog 2023-04-21 10:19:06 +02:00
Albert Juhé Lluveras 813646be06 Update Husky config to v8 (https://github.com/woocommerce/woocommerce-blocks/pull/9150) 2023-04-21 10:07:55 +02:00
dependabot[bot] e745b44010 Bump @octokit/graphql from 4.8.0 to 5.0.5 (https://github.com/woocommerce/woocommerce-blocks/pull/8880)
Bumps [@octokit/graphql](https://github.com/octokit/graphql.js) from 4.8.0 to 5.0.5.
- [Release notes](https://github.com/octokit/graphql.js/releases)
- [Commits](https://github.com/octokit/graphql.js/compare/v4.8.0...v5.0.5)

---
updated-dependencies:
- dependency-name: "@octokit/graphql"
  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-20 19:55:37 +02:00
Roy Ho 90f59de4f6 Update minimal header patterns (https://github.com/woocommerce/woocommerce-blocks/pull/9126)
* Update minimal header patterns

* Remove ref

* Remove dark pattern and indent code
2023-04-20 07:46:15 -07:00
Karol Manijak d5ae033b54 Update @actions/core and @actions/github (https://github.com/woocommerce/woocommerce-blocks/pull/9133)
* Update @actions/core and @actions/github

* Add rimraf as a script to avoid actions failing

* Bump AbleLincoln/push-to-sftp which supports Node 16
2023-04-20 16:46:01 +02:00
Albert Juhé Lluveras 87ce986719 Fix image editor in Featured Product/Category blocks on WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9142) 2023-04-20 15:56:42 +02:00
Roy Ho 642f227753 Add workflow to label community contributors (https://github.com/woocommerce/woocommerce-blocks/pull/8995)
* Add workflow to label community contributors

* Add action dependencies to package.json
2023-04-20 05:44:28 -07:00
Siddharth Thevaril cb378d2e9d fix/8129: remove rounding the caused issue with UI (https://github.com/woocommerce/woocommerce-blocks/pull/9118)
* remove rounding the caused issue with UI

* jslint autofixes

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-04-20 08:41:36 -03:00
Luigi Teschio 7b2830eafa wrap getComputedStyle function inside a useMemo (https://github.com/woocommerce/woocommerce-blocks/pull/9132) 2023-04-20 11:30:29 +02:00
Siddharth Thevaril b3acdea73c add cursor:pointer to checkbox and radio fields (https://github.com/woocommerce/woocommerce-blocks/pull/9102)
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-04-20 12:40:02 +07:00
Dharmesh Patel 32f43e3d84 fix/8651: Use body background color as the Cart block sticky footer background color (https://github.com/woocommerce/woocommerce-blocks/pull/9103)
* Use body background color as the Cart block sticky footer background color

* Reduce the opacity of box-shadow.

* Fix the Proceed to Checkout button cut off.
2023-04-19 18:15:10 +01:00
Domenico Nusca 7dcb7768b2 decode entities for display in TextInput (https://github.com/woocommerce/woocommerce-blocks/pull/9117)
Co-authored-by: Domenico <dom@digitaltroop.net>
2023-04-19 17:53:26 +01:00
Siddharth Thevaril 50f08e6143 fix/8946: replace ToggleGroupControl with ToggleControl (https://github.com/woocommerce/woocommerce-blocks/pull/9098)
* replace ToggleGroupControl with ToggleControl

* eslint fix

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

---------

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

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

* changed fix approach by explicitly set payment method title.

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-04-19 12:23:20 +01:00
Albert Juhé Lluveras 7816bdda51 Release: 10.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9093)
* Empty commit for release pull request

* Add 10.0.2 changelog

* Update versions to 10.0.2

* 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>

* Add 10.0.2 testing steps

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
2023-04-19 11:12:03 +02:00
Albert Juhé Lluveras f92a4d8a13 Filter Products by Attribute e2e test: wait until networkidle before running tests (https://github.com/woocommerce/woocommerce-blocks/pull/9083)
* Wait until networkidle before running tests

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

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

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

---------

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

---
updated-dependencies:
- dependency-name: wp-phpunit/wp-phpunit
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 15:28:38 +02:00
Karol Manijak f3c28b9d78 Pass proper data to On Sale badge when used in the scope of Product Image (https://github.com/woocommerce/woocommerce-blocks/pull/9021)
* Don't use withProductDataContext in Sale Badge block

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

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

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

---
updated-dependencies:
- dependency-name: "@wordpress/browserslist-config"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 14:51:47 +02:00
dependabot[bot] a3db0c9e78 Bump AbleLincoln/push-to-sftp from 1.2 to 2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8597)
Bumps [AbleLincoln/push-to-sftp](https://github.com/AbleLincoln/push-to-sftp) from 1.2 to 2.0.
- [Release notes](https://github.com/AbleLincoln/push-to-sftp/releases)
- [Commits](https://github.com/AbleLincoln/push-to-sftp/compare/v1.2...v2.0)

---
updated-dependencies:
- dependency-name: AbleLincoln/push-to-sftp
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 14:49:47 +02:00
github-actions[bot] 94a0ba2887 Release: 10.0.1 (https://github.com/woocommerce/woocommerce-blocks/pull/9084)
* Single Product Template - Compatibility Layer: don't skip custom HTML (https://github.com/woocommerce/woocommerce-blocks/pull/9075)

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

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

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

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

* Empty commit for release pull request

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

* update version

* add changelog

* add testing instructions

* update zip link file testing

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

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

---------

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

---
updated-dependencies:
- dependency-name: yoast/phpunit-polyfills
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 14:17:51 +02:00
dependabot[bot] 57bdfa59e8 Bump husky from 2.4.1 to 8.0.3 (https://github.com/woocommerce/woocommerce-blocks/pull/8171)
Bumps [husky](https://github.com/typicode/husky) from 2.4.1 to 8.0.3.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v2.4.1...v8.0.3)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 14:03:02 +02:00
dependabot[bot] 2d20b10b9b Bump @emotion/styled from 11.10.5 to 11.10.6 (https://github.com/woocommerce/woocommerce-blocks/pull/8882)
Bumps [@emotion/styled](https://github.com/emotion-js/emotion) from 11.10.5 to 11.10.6.
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/styled@11.10.5...@emotion/styled@11.10.6)

---
updated-dependencies:
- dependency-name: "@emotion/styled"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 13:42:50 +02:00
dependabot[bot] b5db6e3ed1 Bump automattic/jetpack-autoloader from 2.11.16 to 2.11.18 (https://github.com/woocommerce/woocommerce-blocks/pull/8934)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.16 to 2.11.18.
- [Release notes](https://github.com/Automattic/jetpack-autoloader/releases)
- [Changelog](https://github.com/Automattic/jetpack-autoloader/blob/trunk/CHANGELOG.md)
- [Commits](https://github.com/Automattic/jetpack-autoloader/compare/v2.11.16...v2.11.18)

---
updated-dependencies:
- dependency-name: automattic/jetpack-autoloader
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 12:31:15 +02:00
Viktor Szépe dca02da47c Make Woo_Directive_Store PHP 7.3 compatible (https://github.com/woocommerce/woocommerce-blocks/pull/9033) 2023-04-18 12:13:23 +02:00
Manish Menaria be5356d30a Product Stock indicator: Add support for background color, margin, padding & various typography controls (https://github.com/woocommerce/woocommerce-blocks/pull/8954)
* Add color, typography, and spacing support to Product SKU block

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

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

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

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

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

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

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

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

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

* Fix minor issues

* Gate only experimental features behind isFeaturePluginBuild flag

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

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

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

* Refactor Product SKU block classname and style handling

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

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

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

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

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

* Refactor stock text generation and apply minor style adjustments

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

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

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

* Remove redundant block type supports in ProductStockIndicator

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

* Use caching in GitHub Actions

* Update tests/e2e-pw/README.md

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

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

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

* Remove obsolete log and adjusted disabled ESLint definition

* Remove conditional logic from actions/upload-artifact

---------

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

* Use get_block_templates_from_db() from BlockTemplateUtils

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

* Update section in JavaScript testing about WP versions

* Update TOC

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

* Add the dots at the end of sentences

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

* Search for product variation

* Add slug to tests

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

* Add width control to the settings sidebar

* Fix linting errors

* Remove comments

* Inline function

* Fix issue with smaller viewports

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

* Change the pattern to an inner block

* Allow customizing item counter block

* Rename block

* Allow removing the items counter block

* Add padding controls

* Preload new blocks

* Add title block back from the inserter

* Move h2 tag to the parent title

* Align items at the bottom

* Unify styles

* Add title class in the editor

* Prevent removing title blocks

* Disallow unlocking and inserter

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

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

* Fix customer account test classes

* Increase timeout limit for failing tests

---------

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

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

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

---------

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

* Add pickup details to confirmations

* Error handling

* Update test because columns may be hidden

* use address selector

* Custom selector for local pickup

* try forcing flat rate during test
2023-03-17 14:15:13 +00:00
Albert Juhé Lluveras ec19838355 Fix issue that prevented spaces being added to Mini Cart, Cart and Checkout buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8777)
* Fix issue that prevented spaces being added to Mini Cart, Cart and Checkout buttons

* Fix a couple of comments
2023-03-17 13:26:34 +01:00
kmanijak 28c7bfc801 Change the example of GET products by category from category name to ID (https://github.com/woocommerce/woocommerce-blocks/pull/8774) 2023-03-17 13:24:00 +01:00
Luigi Teschio 6dfee2664e fix isDescendentOfSingleProductTemplate check (https://github.com/woocommerce/woocommerce-blocks/pull/8767) 2023-03-17 10:22:51 +01:00
Alba Rincón dca03c3323 Add styles to the `Start shopping` button (https://github.com/woocommerce/woocommerce-blocks/pull/8766) 2023-03-16 14:57:54 +01:00
Luigi Teschio 235b37a626 Product Search Results template: fix the preview when the Inherit Query option is enabled (https://github.com/woocommerce/woocommerce-blocks/pull/7965)
* Product Search Results: fix the preview when the Inherit Query option is enabled

* create a component to make the code more readable

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-03-16 11:04:52 +01:00
Daniel W. Robert 30f08a644f Updates version for @woocommerce/block-library (https://github.com/woocommerce/woocommerce-blocks/pull/8733)
Lockfile is using v9.8.0-dev for the @woocommerce/block-library
dependency. This update bumps that dep version to v9.9.0-dev.
2023-03-15 12:22:06 -04:00
Luigi Teschio c893a795b1 inject hooks on the first block after the main div wrapper (https://github.com/woocommerce/woocommerce-blocks/pull/8702) 2023-03-15 14:12:31 +00:00
Albert Juhé Lluveras 9f3f460372 Add WC Blocks 9.8.1 changelog and testing steps 2023-03-15 14:37:34 +01:00
Roy Ho a55b63f96c Add get_product_by_metas method to query the lookup table (https://github.com/woocommerce/woocommerce-blocks/pull/8645)
* Add get_product_by_metas method to query the lookup table

* Remove cache and return db column instead

* Update src/StoreApi/Utilities/ProductQueryFilters.php

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

* Fix phpcs violations

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-15 05:32:25 -07:00
Tarun Vijwani ef63d807b9 Fix the local pickup price in the shipping type selector and pickup options (https://github.com/woocommerce/woocommerce-blocks/pull/8623)
* Fix local pickup price in the shipping type selector

- While calculating min and max value for local pickup, if the rate is not for local pickup, it will take already calculated lowest value instead of comparing it with the value of other shipping rate.

* Add the typecasting for price and tax to fix tax calculation

- We were concatenating the two strings instead of adding the integers. Add the typecasting for price and tax to fix it in local pickup.

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-03-15 13:26:06 +01:00
Roy Ho 44cdcc8770 Add method to get products based on filtered term (https://github.com/woocommerce/woocommerce-blocks/pull/8598)
* Add method to get products based on filtered term

* Use convenient taxonomy name wrapper

* Add caching and switch to return array instead of object

* Remove cache and address comments
2023-03-15 05:08:51 -07:00
kmanijak afa8672e49 Change the property name of the attribute slug in Products By Attribute after the refactor (https://github.com/woocommerce/woocommerce-blocks/pull/8759) 2023-03-15 12:29:13 +01:00
Luigi Teschio 5a3e7b5afc fix: disable compatibility layer for block themes that have a default block template (https://github.com/woocommerce/woocommerce-blocks/pull/8758) 2023-03-15 11:20:08 +00:00
Tarun Vijwani 8a35fc0fcf Fix Local pickup e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/8745)
* Fix local pick-up e2e tests

- Change location_country select input to location_country_state select input in e2e tests.
- Remove location_state select input in e2e tests.

* Fix country/state value

- Change country/state value from 'US' to 'United States (US) — California'

* Add inline comment about same field for Country and State fields

- We merged the Country and State fields into the same field in the local pickup modal. Add inline comment in e2e test to avoid confusion.
2023-03-15 10:59:04 +04:00
Roy Ho 112a402261 Add a higher z-index than the title for mini cart close button (https://github.com/woocommerce/woocommerce-blocks/pull/8737) 2023-03-14 10:08:10 -07:00
Alba Rincón d4fe2a5b5d Mini-cart: add setting to not render the block on the cart & checkout pages (https://github.com/woocommerce/woocommerce-blocks/pull/8700)
* Add `renderInCartAndCheckout` attribute and toggle

* Show setting only when inserted in a template

* Don't render the mini-cart if the setting is disabled

* Stop rendering the mini-cart if the setting is false

* method to snakecase

* Make the attribute a string

In the future we may want to add more rendering styles, so a boolean wasn't the
best option, a string will allowed us more than two options

* Change toggle copy
2023-03-14 15:59:46 +01:00
Patricia Hillebrandt a3b4dbcf76 Fix Markdown table in payment-method-integration.md > external contribution woocommerce/woocommerce-blocks#8158 (https://github.com/woocommerce/woocommerce-blocks/pull/8258)
* Fix Markdown table in payment-method-integration.md

* Update the hooks for eventRegistration

---------

Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-03-14 11:29:35 -03:00
Saad Tarhi abe3488861 Local Pickup: merge country and state into same field in location modal (https://github.com/woocommerce/woocommerce-blocks/pull/8408)
* Get the default store state

We are merging the Country & State fields. So, we should get both
default values

* Merge the Country & State fields

We merged both fields in the Pickup Location form modal

We can see a similar example in `WooCommerce -> Settings -> General`

* Clean up the code

* Show the state text field above the country select

* Create some util functions

* Refactor the Form component

* Display a user friendly country and state in admin

* Fix country defaulting to "Afghan" bug
2023-03-14 14:49:31 +01:00
Luigi Teschio a2945306ac Fix the related products block result when used along a grouped product (https://github.com/woocommerce/woocommerce-blocks/pull/8656)
* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* fix crash
2023-03-14 14:28:21 +01:00
Niels Lange 83b5019e4d Add client side postcode validation (https://github.com/woocommerce/woocommerce-blocks/pull/8503)
* Add client side postcode validation

* Prevent server-side validation

* Adjust translation

* Only validate postcode if country is available

* Specify return type of isPostcode()

* Convert function to static variable set

* Refactor <ValidatedTextInput> for postcode validation

* Refactor customValidationHandler

* Use customValidationHandler as intermediate function

* Hyphenate file names

* Update packages/checkout/utils/validation/is-postcode.ts

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

* Normalise postcode on input

* Fix usage of out of date value from input field

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-03-14 19:37:28 +07:00
Albert Juhé Lluveras 312d9b6582 Update dev version to 9.9.0-dev 2023-03-14 11:56:23 +01:00
Albert Juhé Lluveras cb79ce452f Add WC Blocks 9.8.0 testing steps 2023-03-14 11:54:43 +01:00
Albert Juhé Lluveras c90e5351f8 Add WC Blocks 9.8.0 changelog and update compatibility versions 2023-03-14 11:54:28 +01:00
Albert Juhé Lluveras b64a6b8a5e Add spacing below Mini Cart title (https://github.com/woocommerce/woocommerce-blocks/pull/8676) 2023-03-14 09:42:53 +01:00
Luigi Teschio 23c38a1e23 Enable the compatibility layer when Product Meta, Product Price and Breadcrumbs blocks are added (https://github.com/woocommerce/woocommerce-blocks/pull/8719) 2023-03-13 15:55:44 +00:00
Thomas Roberts bee8a74150 Add `ExperimentalOrderLocalPickupPackages` Slot/Fill (https://github.com/woocommerce/woocommerce-blocks/pull/8636)
* Add ExperimentalOrderLocalPickupPackages slot fill

* Render ExperimentalOrderLocalPickupPackages in local pickup block

* Update docs to include ExperimentalOrderLocalPickupPackages

* Use LocalPickupSelect component when rendering local pickup options
2023-03-13 12:00:02 +00:00
Thomas Roberts 991e407fa9 Remove WC Core shipping settings if Cart/Checkout blocks are in use (https://github.com/woocommerce/woocommerce-blocks/pull/8679)
* Add CartCheckoutUtils class

This class will store reusable methods relating to Cart/Checkout Blocks, i.e. whether they are used on the Cart/Checkout page.

* Update ShippingController to use the new CartCheckoutUtils function

This will reduce code duplication when checking if the Cart/Checkout blocks are in use on the Cart/Checkout page.

* Add filter to remove shipping settings when Cart/Checkout are default

* Ensure setting displays correctly if cart is default but not checkout

* Add tests to ensure core shipping settings update correctly

* Add setCartCheckoutPages function to update set the cart/checkout page

* Force shipping to be enabled if the Checkout block is in use.

* Add filter to override cost requires address option

* Add shippingCostRequiresAddress option

* Check if the address is required before showing rates

* Show shipping rates in editor

* Add shippingCostRequiresAddress attribute to shipping methods block

* Update frontend type to show shippingCostRequiresAddress is a prop

* Add control to toggle shippingCostRequiresAddress option

* Show address notice in the correct scenario

* Send shippingCostRequiresAddress to Block in front end context

* Add e2e test for editor control

* Add e2e tests for shipping options on the front end

* Add updateAttributeInSiblingBlock function

* Add shippingCostRequiresAddress to shipping method block

* Ensure attribute is updated in both blocks when editing

* In Shipping Methods Block, show correct component based on block setting

* Show correct block in editor

* Remove broken test from PR

* Clean up updateAttributeInSiblingBlock

* Add setCartCheckoutPages function to update set the cart/checkout page

* Add tests to ensure core shipping settings update correctly

* Add isAddressComplete function

Borrowed from woocommerce/woocommerce-blocks#8141

* Check if the address is required before showing rates

* Show shipping rates in editor

* Show address notice in the correct scenario

* Add e2e tests for shipping options on the front end

* Ensure errorId is passed to StateInput

* Add fullShippingAddressPushed action to wc/store/cart

* Add fullShippingAddressPushed case to reducer

* Ensure fullShippingAddressPushed is set when initialising cart store

* Add fullShippingAddressPushed selector and default state entry

* Add shippingAddressHasValidationErrors util function

* Do not overwrite addresses when selecting a rate

* Set whether full address has been pushed when saving address changes

* In Shipping Methods Block, show correct component based on block setting

* Don't show from price if rates should be hidden until address entered

* Check city validation errors to assert if shipping address is valid

* Rename merchant.js to merchant.ts

* Move local pickup functions to common merchant util

* Update local pickup tests to use common merchant utils

* Add test to ensure setting toggles in both blocks

* Add navigating to settings and saving in merchant util

* Create addPickupLocation merchant util

* Add test for local pickup and require full address

* Make sure correct conditions are met to show shipping options

* Ensure checkbox is checked during local pickup tests

* Unset the checkbox when tests are finished running

* Update checkout block fixture

* Prevent error in unit tests

* Import validation store key from constants

Required because importing from the index causes the validation data store to register twice

* Update checkout terms test to wait for button not to be disabled

* Revert "Add isAddressComplete function"

This reverts commit 9967dc0d4f10cf638859ae085e6f4cc2901dd299.
2023-03-13 11:49:28 +00:00
Mike Jolley 95efc38d1f Checkout - Available Payment Method Filtering (https://github.com/woocommerce/woocommerce-blocks/pull/8441)
* Document payment_gateways() usage

* Type in code comment

* Return available methods in cart/checkout StoreAPI responses

* Filter available methods in checkout

* fix tests

* fix TS error

* fix TS warnings in tests

* Update src/StoreApi/Schemas/V1/CartSchema.php

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

* Only apply filtering on frontend

* Avoid filter on express methods

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-03-13 10:29:17 +00:00
dependabot[bot] ad032a93e6 Bump @testing-library/jest-dom from 5.16.4 to 5.16.5 (https://github.com/woocommerce/woocommerce-blocks/pull/8167)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.16.4 to 5.16.5.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.16.4...v5.16.5)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  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>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-03-13 09:30:10 +01:00
Thomas Roberts aa83cae9bc Add filter to change proceed to checkout button text and URL (https://github.com/woocommerce/woocommerce-blocks/pull/8613)
* Fix up typescript of checkout filters

* Clear cached values when adding new filters

* Allow href on WPButton type

* Specify generic type of getSetting for checkout page link

* Apply filters to Proceed to Checkout button

* Add unit tests for proceed to checkout button and link filters

* Make cart extend a plain object

* Pass cart in args for proceed to checkout filters

* Add documentation for proceed to checkout filters

* Add unit test for multiple filter registration

* Change word to bump stuck GitHub actions

* Apply consistent casing to test names
2023-03-13 14:34:12 +07:00
Thomas Roberts f708214246 Add E2E test for third-party local pickup methods (https://github.com/woocommerce/woocommerce-blocks/pull/8543)
* Add third party local pickup method to woo-test-helper plugin

* Add test to check for checkout with local pickup

* Ensure local pickup is disabled when done with tests

* Add a more reliable selector for the "use same address for billing" box

* Prevent local pickup rates showing if local pickup is not enabled

* Check billing details after placing local pickup order

* Change local pickup unit test so rates dont show if localPickup disabled

* Use existing const instead of getSetting

* Update tests to mock constant from @woocommerce/block-settings

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-03-13 10:45:48 +07:00
Paulo Arromba 4067541ac2 return associative array for woocommerce_order_get_tax_location filter (https://github.com/woocommerce/woocommerce-blocks/pull/8681) 2023-03-10 16:21:39 +00:00
Thomas Roberts 3c6229879a Add `LocalPickupSelect` component (https://github.com/woocommerce/woocommerce-blocks/pull/8634)
* Add LocalPickupSelect component

This will be used to render the local pickup options and also display a title if there are more than one package (e.g. if WC subs adds them)

* Add tests for LocalPickupSelect component

* Make title optional

* Add packageCount as an option to LocalPickupSelect

* Revert "Add packageCount as an option to LocalPickupSelect"

This reverts commit 10b1dc9497aa6c4329aee7e74e1404cb9645c3b9.

* Add ackage count to LocalPickupSelect

* Add package count and remove unused variable from renderPickupLocation
2023-03-10 07:52:21 -08:00
Albert Juhé Lluveras 705c0937a2 Remove wc-settings from Mini Cart block dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/8703) 2023-03-10 13:36:20 +01:00
Alba Rincón 98f5f67ed1 Add border support to mini cart contents (https://github.com/woocommerce/woocommerce-blocks/pull/8654)
* Add border support to mini cart contents

* Fix buttons in firefox when logged out

* Fix mini cart in all browsers

* Fix border not visible on mobile because of the admin bar

* Add feature flag to the experimental border

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-03-10 09:25:24 +01:00
Daniel Dudzic 35860da21e Products: Update product element margins in patterns (https://github.com/woocommerce/woocommerce-blocks/pull/8401)
* Product Rating: Normalize the height of rating icons and the Add review link

* Products: Update inner blocks margins.

* Product Rating: Remove css changes from this PR.

* Products patterns: Remove px values and update the default pattern template.

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-03-10 11:34:47 +05:30
Albert Juhé Lluveras b88fcef0d5 Preload Mini Cart inner blocks frontend scripts (https://github.com/woocommerce/woocommerce-blocks/pull/8653)
* Preload Mini Cart inner blocks frontend scripts

* Don't call CartController inside Mini Cart code and add protections around WC_Cart usages

* Always preload empty and filled cart frontend scripts
2023-03-09 17:05:44 +01:00
Luigi Teschio 10516c3392 fix: Show sale bage on Product Image Gallery block (https://github.com/woocommerce/woocommerce-blocks/pull/8652)
* fix: show sale bage on Product Image Gallery block woocommerce/woocommerce-blocks#8528

* set multiple flag to false
2023-03-09 09:42:59 +01:00
Luigi Teschio 391105a71e Add Product Meta Block (https://github.com/woocommerce/woocommerce-blocks/pull/8484)
* 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

* remove unnecessary change

* fix compatibility layer when the Single Product template has the classic block

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-09 09:42:40 +01:00
Albert Juhé Lluveras f65a1afe15 Mini Cart drawer close button: inherit text color and improve alignment (https://github.com/woocommerce/woocommerce-blocks/pull/8605)
* Make Mini Cart drawer close button inherit the color

* Fix Mini Cart drawer close button alignment

* Increase opacity when Mini Cart drawer close icon is hover, focused or active
2023-03-09 09:28:55 +01:00
Niels Lange 0acbeb4770 Rename JS translation function name (https://github.com/woocommerce/woocommerce-blocks/pull/8674) 2023-03-09 13:26:56 +07:00
Lucio Giannotta 61eeeb3c68 Improve Products block Attributes Filter Inspector Controls (https://github.com/woocommerce/woocommerce-blocks/pull/8583)
This PR is meant to improve the UI and UX behind the Attributes filter
within the Inspector Controls of the “Products (Beta)“ block.

Also included:

* Refactor `useProductAttributes` hook
  * Move it into the shared hooks.
  * Fetch both terms AND attributes via the API (previously,
we got the attributes from the settings, but we'd get
partial objects compared to the API? Maybe a follow-up
to this could be to check why the attributes stored in
the settings are incomplete?)
  * Make sure the return values match the ones expected
from search items.
* Remove attribute-related types from PQ directory
* Improve functionality of `SearchListControl`
  * Allow the search input to be a Token based input.
  * Allow for search input to search even collapsed properties.
  * Use core `CheckboxControl` instead of radio buttons for
items having children (includes undeterminated state).
  * Enable removal of tokens from the input
* Improve styles:
  * Refactor classnames for `SearchItem`.
  * Add more semantic classes.
  * Align count label and caret to the right.
  * Make caret switch direction on expanded.
  * `cursor: pointer` on collapsible items.
  * Indent children of collapsible items.
  * Correctly pass through class names to search item
* Enable keyboard navigation for collapsible items
* Add link to manage attributes
* Change label inside the inspector controls
* Make search list attached when token type
* Implement more sophisticated behavior of parent checkbox
  * If indeterminate or unchecked, it will check all children.
  * If checked, it will uncheck all children.
* Remove hardcoded `isSingle` from `expandableSearchListItem`
2023-03-08 17:22:51 +01:00
Albert Juhé Lluveras 3de39425c2 Remove wc-blocks-registry from Mini Cart block dependencies so more scripts can be lazy-loaded (https://github.com/woocommerce/woocommerce-blocks/pull/8657)
* Remove wc-blocks-registry from Mini Cart block so more scripts can be lazy-loaded

* Make check more reliable in case window.wc is not defined
2023-03-08 17:15:07 +01:00
Tom Cafferkey a5025e0b70 Skip JSE2EWithGutenberg whilst we look into fixing failing tests due to GB update (https://github.com/woocommerce/woocommerce-blocks/pull/8668) 2023-03-08 14:28:47 +00:00
Albert Juhé Lluveras 3d3f4a5dae Fix a circular dependency in CartLineItemRow (https://github.com/woocommerce/woocommerce-blocks/pull/8664) 2023-03-08 14:16:22 +01:00
Albert Juhé Lluveras 4415746d55 Only print wp.apiFetch.createPreloadingMiddleware when needed (https://github.com/woocommerce/woocommerce-blocks/pull/8647) 2023-03-08 10:14:34 +01:00
Albert Juhé Lluveras 6d821202ee Move CartLineItemsTable from the Cart block directory to base-components (https://github.com/woocommerce/woocommerce-blocks/pull/8644) 2023-03-08 10:14:20 +01:00
dependabot[bot] 086cca602a Bump glob from 7.1.7 to 7.2.3 (https://github.com/woocommerce/woocommerce-blocks/pull/8168)
Bumps [glob](https://github.com/isaacs/node-glob) from 7.1.7 to 7.2.3.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v7.1.7...v7.2.3)

---
updated-dependencies:
- dependency-name: glob
  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>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-03-07 16:19:18 -03:00
dependabot[bot] e05dad583a Bump wp-types from 3.60.0 to 3.61.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8169)
Bumps [wp-types](https://github.com/johnbillion/wp-json-schemas) from 3.60.0 to 3.61.0.
- [Release notes](https://github.com/johnbillion/wp-json-schemas/releases)
- [Commits](https://github.com/johnbillion/wp-json-schemas/compare/3.60.0...3.61.0)

---
updated-dependencies:
- dependency-name: wp-types
  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>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-03-07 16:08:07 -03:00
dependabot[bot] 7d2f86d10f Bump dependabot/fetch-metadata from 1.3.1 to 1.3.6 (https://github.com/woocommerce/woocommerce-blocks/pull/8361)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.1 to 1.3.6.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.1...v1.3.6)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  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>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-03-07 15:16:09 -03:00
Mike Jolley 4e581a4825 Allow view switcher to toggle view when using Gutenberg list view (https://github.com/woocommerce/woocommerce-blocks/pull/8429)
* Remove old view switcher component (not used)

* Switch in list view

* useSelect

* Optional selection of parent block on changing view

---------

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2023-03-07 11:21:13 +00:00
Albert Juhé Lluveras e32fc79aec Fix Products block Add to Cart button when AJAX on archives is disabled (https://github.com/woocommerce/woocommerce-blocks/pull/8532) 2023-03-07 11:00:10 +01:00
Albert Juhé Lluveras 3bbf71febb Remove patch version from Requires at least (https://github.com/woocommerce/woocommerce-blocks/pull/8649) 2023-03-07 09:49:26 +01:00
Thomas Roberts 9cba7ed8ad Add tests to ensure dirty props are re-pushed if the original `pushChanges` request fails (https://github.com/woocommerce/woocommerce-blocks/pull/8648)
* Add tests for pushChanges and dirty props

* Update assets/js/data/cart/test/push-changes.ts

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

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-03-06 20:52:36 -08:00
Seghir Nadir e1ce806b17 use correct path when running php unit tests (https://github.com/woocommerce/woocommerce-blocks/pull/7489)
* use correct path when running php unit tests

* Update package.json

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

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-03-07 10:21:50 +07:00
dependabot[bot] b1e55f2d84 Bump @wordpress/dom from 3.16.0 to 3.27.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8486)
Bumps [@wordpress/dom](https://github.com/WordPress/gutenberg/tree/HEAD/packages/dom) from 3.16.0 to 3.27.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/dom/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/dom@3.27.0/packages/dom)

---
updated-dependencies:
- dependency-name: "@wordpress/dom"
  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>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-03-06 17:50:15 -03:00
dependabot[bot] 167ac21df3 Bump dns-packet from 5.3.1 to 5.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8612)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v5.3.1...5.4.0)

---
updated-dependencies:
- dependency-name: dns-packet
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-03-06 16:45:48 -03:00
Mike Jolley 26e7c51698 Undo dirty prop removal on error (https://github.com/woocommerce/woocommerce-blocks/pull/8633)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-03-06 16:05:38 +01:00
Luigi Teschio d08696de34 Product Price block: add support to the Single Product Template (https://github.com/woocommerce/woocommerce-blocks/pull/8609)
* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import
2023-03-06 15:14:08 +01:00
kmanijak dac10d58f3 [Products]: Fix attributes filters that do not update the editor preview correctly (https://github.com/woocommerce/woocommerce-blocks/pull/8611)
* Merge tax_query of attributes and visibility taxonomies when building Products query

* Add tests confirming the tax_query is merged correctly

* Improve syntax after code review
2023-03-06 14:36:40 +01:00
Niels Lange 627a11d045 Revert "Show Cart and Checkout blocks in Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8489)" (https://github.com/woocommerce/woocommerce-blocks/pull/8602)
This reverts commit 5944e229c2.
2023-03-06 12:19:08 +07:00
Albert Juhé Lluveras 9170f73e51 Update release steps mentioning the version on the WooCommerce.com plugin page takes some hours to update (https://github.com/woocommerce/woocommerce-blocks/pull/8620)
* Update release steps mentioning the version on the WooCommerce.com plugin page takes some hours to update

* Replace 'tomorrow' with 'the following day'
2023-03-03 16:25:07 +01:00
Alba Rincón b3db625215 Make the customer account icon bigger to match the mini-cart one (https://github.com/woocommerce/woocommerce-blocks/pull/8594)
* Make the customer account icon bigger to match the mini-cart one

* Add variation to increase the icon size for new blocks

* Improve class name

* Add variation explanation

* Add default attributes
2023-03-03 15:44:34 +01:00
Albert Juhé Lluveras 5d0237a22d Merge branch 'release/9.7.0' into trunk 2023-03-03 15:34:19 +01:00
Albert Juhé Lluveras 829545071e Add missing link to 9.7.2 testing instructions 2023-03-03 15:29:36 +01:00
Albert Juhé Lluveras 7d170baaac Bumping version strings to new version. 2023-03-03 13:17:14 +01:00
Albert Juhé Lluveras ba2a48be0a Clarify that only WP 6.1.1 needs to be tested 2023-03-03 13:08:00 +01:00
Alba Rincón 08d5e0af16 Fix add to cart form test (https://github.com/woocommerce/woocommerce-blocks/pull/8622) 2023-03-03 13:02:36 +01:00
Albert Juhé Lluveras e4d9e68681 Add 9.7.2 testing steps 2023-03-03 12:51:25 +01:00
Luigi Teschio 89cd344374 upgrade @types/wordpress__blocks package (https://github.com/woocommerce/woocommerce-blocks/pull/8624) 2023-03-03 12:42:50 +01:00
Albert Juhé Lluveras 631c2dc260 Add 9.7.1 changelog 2023-03-03 12:40:03 +01:00
Niels Lange 0c4618de5a Show three Express Payments buttons in-line (https://github.com/woocommerce/woocommerce-blocks/pull/8601)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-03-03 12:37:35 +01:00
Alba Rincón 7245ca519e Make the start shopping button show the theme style (https://github.com/woocommerce/woocommerce-blocks/pull/8567)
* Make the start shopping button show the theme style

* Center the button

* Fix test
2023-03-03 10:55:28 +01:00
Albert Juhé Lluveras 1d0adeed28 Replace react imports with wordpress/element (https://github.com/woocommerce/woocommerce-blocks/pull/8520)
* Replace react imports with wordpress/element

* Fix TS errors

* Update a couple of React type imports
2023-03-02 15:26:00 +01:00
Alba Rincón 363fe84039 Switch Select by Toggle for the 'Add-to-Cart behaviour' (https://github.com/woocommerce/woocommerce-blocks/pull/8558) 2023-03-02 15:09:37 +01:00
Alba Rincón 9a68faed1d Add support for global styles (https://github.com/woocommerce/woocommerce-blocks/pull/8517) 2023-03-02 15:08:51 +01:00
Alba Rincón 8ff958a0e2 Remove colorClassName and style from QuantityBadge (https://github.com/woocommerce/woocommerce-blocks/pull/8557) 2023-03-02 15:08:09 +01:00
Niels Lange 465732aeb8 Show three Express Payments buttons in-line (https://github.com/woocommerce/woocommerce-blocks/pull/8601)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-03-02 19:47:18 +07:00
David Arenas 96c6b47cd6 Fix Interactivity API setup (https://github.com/woocommerce/woocommerce-blocks/pull/8593)
* Only load Interactivity API if enabled

* Use requires again inside wp-html

* Check if class exist instead of plugin

* Remove `wp-html.php` file
2023-03-02 13:46:27 +01:00
Albert Juhé Lluveras 4b82793b33 Fix Mini Cart missing translations (https://github.com/woocommerce/woocommerce-blocks/pull/8591) 2023-03-02 11:16:32 +01:00
dependabot[bot] 0c4ad5ec13 Bump automattic/jetpack-autoloader from 2.11.14 to 2.11.16 (https://github.com/woocommerce/woocommerce-blocks/pull/8534)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.14 to 2.11.16.
- [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.14...v2.11.16)

---
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>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-03-02 13:46:51 +05:30
kmanijak 670bbe817d Check if WordPress version is 6.1 and higher to allow for template conversion (https://github.com/woocommerce/woocommerce-blocks/pull/8588)
* Check if WordPress version is 6.1.1 and higher to allow for template conversion

* Change the version the conversion is available from, from 6.1.1 to 6.1
2023-03-01 16:00:41 +01:00
Tung Du 2b419da2f7 Bump plugin versions to 9.8.0-dev (https://github.com/woocommerce/woocommerce-blocks/pull/8595) 2023-03-01 21:36:06 +07:00
github-actions[bot] 4a204d9eb9 Release: 9.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8565)
* Empty commit for release pull request

* update 9.7.0 changelog for readme.txt

* bump WC versions

* 9.7.0 testing notes

* Update 970.md

* remove 7945 and update 8489 testing note

* Remove 8264 testing notes

* remove 8482 from testing instructions

* Fix alignment of Add to Cart form block (https://github.com/woocommerce/woocommerce-blocks/pull/8578)

* update testing zip after cherry-picking 8578

* update changelog

* Move testing steps woocommerce/woocommerce-blocks#8438 to experimental section (https://github.com/woocommerce/woocommerce-blocks/pull/8580)

* Fix image is not showing at correct position (https://github.com/woocommerce/woocommerce-blocks/pull/8585)

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* fix 8478 testing note

* fix md error cause the last section hidden

* Add to Cart Form Block > Ensure the editor preview is properly displayed with the Gutenberg plugin disabled (https://github.com/woocommerce/woocommerce-blocks/pull/8582)

* Update the editor styles for the add to cart form button so it is properly displayed with the Gutenberg plugin disabled.

* update for the input height.

* update the min-height

* update testing zip link

* Bumping version strings to new version.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-03-01 21:25:34 +07:00
Paulo Arromba 6483ee08d0 Added debounce to shipping rate selection on cart (https://github.com/woocommerce/woocommerce-blocks/pull/8498) 2023-03-01 13:41:20 +00:00
Tung Du e803329473 Bumping version strings to new version. 2023-03-01 19:27:30 +07:00
Tung Du ecc5c8b3f7 update testing zip link 2023-03-01 17:04:54 +07:00
Patricia Hillebrandt cc6be3c3b9 Add to Cart Form Block > Ensure the editor preview is properly displayed with the Gutenberg plugin disabled (https://github.com/woocommerce/woocommerce-blocks/pull/8582)
* Update the editor styles for the add to cart form button so it is properly displayed with the Gutenberg plugin disabled.

* update for the input height.

* update the min-height
2023-03-01 16:54:47 +07:00
Patricia Hillebrandt a7f471d9ff Add to Cart Form Block > Ensure the editor preview is properly displayed with the Gutenberg plugin disabled (https://github.com/woocommerce/woocommerce-blocks/pull/8582)
* Update the editor styles for the add to cart form button so it is properly displayed with the Gutenberg plugin disabled.

* update for the input height.

* update the min-height
2023-03-01 10:39:54 +01:00
Luigi Teschio 8fa0abe841 Rename BlockTemplatesCompatibility class to ArchiveProductTemplatesCompatibility (https://github.com/woocommerce/woocommerce-blocks/pull/8579) 2023-03-01 10:37:19 +01:00
Tung Du fb4b7d784f fix md error cause the last section hidden 2023-03-01 16:36:20 +07:00
Albert Juhé Lluveras 000f5aa2ea Fix 'Edit Mini Cart template part' link in WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8574) 2023-03-01 09:43:53 +01:00
Tung Du 1c31517148 fix 8478 testing note 2023-03-01 13:56:58 +07:00
Manish Menaria a347950288 Fix image is not showing at correct position (https://github.com/woocommerce/woocommerce-blocks/pull/8585)
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-03-01 13:54:19 +07:00
kmanijak 8aa369f229 Move testing steps woocommerce/woocommerce-blocks#8438 to experimental section (https://github.com/woocommerce/woocommerce-blocks/pull/8580) 2023-03-01 13:46:27 +07:00
Tung Du 052ba76098 update changelog 2023-03-01 09:53:04 +07:00
Tung Du 9650ea44ce update testing zip after cherry-picking 8578 2023-03-01 07:23:38 +07:00
Albert Juhé Lluveras 5b73e02ecb Fix alignment of Add to Cart form block (https://github.com/woocommerce/woocommerce-blocks/pull/8578) 2023-03-01 07:13:52 +07:00
Roy Ho b9044a72df Add explicit CSS styling to mini-cart block amount in inserter preview (https://github.com/woocommerce/woocommerce-blocks/pull/8516)
* Add explicit CSS styling to mini-cart block amount in inserter preview

* Add preview specific class name

* Fix formatting
2023-02-28 09:40:06 -08:00
Tung Du ab8403d411 remove 8482 from testing instructions 2023-03-01 00:00:10 +07:00
David Arenas 8f76d41fe2 Serialize the Interactivity API's store from PHP and hydrate it on the client (https://github.com/woocommerce/woocommerce-blocks/pull/8447)
* Update Interactivity API

* Change `wp` prefixes to `woo`

* Use `woo` prefix for the directives runtime bundle

* Update Interactivity API runtime

* Hardcode php from interactivity API

* Temporarily add gutenberg plugin as dependency

* Exclude Interactivity API files from phpcs checks

* Update Interactivity API js files

* Update Interactivity API php files

* Remove gutenberg from wp-env plugins

* Fix registered runtime paths

* Fix prefixes when getting attributes in directives

* Fix directive prefix in constants

* Avoid a Fatal error when importing `wp-html`

* Remove TODO comments from Interactivity API files

* Add missing prefix to some global functions

* Use true as value for boolean attributes

* Add `wp-html` file

* Change requires in `wp-html` with includes
2023-02-28 17:33:33 +01:00
Luigi Teschio 8c35002247 Single Product Template: Add compatibility layer (https://github.com/woocommerce/woocommerce-blocks/pull/8442)
* 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

* address feedback

* remove unused import

* double empty line

* remove logic in the constructor

* remove hook

* generate the docs

* add missing hooks

* fix docs

* address feedback

* fix linter

* fix import

* Disable compatibility layer when the WooCommerce Product Grid Block block and WooCommerce Single Product Block are used (https://github.com/woocommerce/woocommerce-blocks/pull/8538)

* disable compatibility layer via hook

* update docs

* generate the docs

* fix version

* fix import

* fix code after merge

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-02-28 16:13:30 +01:00
Tung Du 07ae1165c8 Remove 8264 testing notes 2023-02-28 21:54:20 +07:00
Albert Juhé Lluveras 29d4f6f07a Fix alignment of Add to Cart form block (https://github.com/woocommerce/woocommerce-blocks/pull/8578) 2023-02-28 15:16:49 +01:00
Tung Du fd62eb91e3 remove 7945 and update 8489 testing note 2023-02-28 21:14:43 +07:00
Patricia Hillebrandt 98bb92c8c6 Update 970.md 2023-02-28 12:29:19 +01:00
Tung Du d4827ed1bf 9.7.0 testing notes 2023-02-28 16:45:01 +07:00
kmanijak a57ab52702 Add Store Breadcrumbs block and make Product Title a link in the blockified archive-product and product-search-results templates (https://github.com/woocommerce/woocommerce-blocks/pull/8508)
* Add Store Breadcrumbs block to the blockified archive-product and product-search-results templates

* Make Product Title a link by default

This has been changed in the Products block, so it should be relfected here as well
2023-02-28 09:28:07 +01:00
Tung Du 8b8494a5f6 bump WC versions 2023-02-28 14:32:35 +07:00
Tung Du 2f0684337a update 9.7.0 changelog for readme.txt 2023-02-28 14:07:27 +07:00
Thomas Roberts 0896d054a8 Fix more instances of hardcoded `pickup_location` string (https://github.com/woocommerce/woocommerce-blocks/pull/8542)
* Move get_local_pickup_method_ids to LocalPickupUtils file

This is because we need it to be accessible by other classes.

* Remove pickup_location strings & get all collectable methods dynamically

---------

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-02-28 13:50:32 +07:00
Saad Tarhi 31e1aae7ad Merge branch 'release/9.6.2' into trunk 2023-02-27 19:34:19 +01:00
github-actions[bot] 959a0195dc Release: 9.6.3 (https://github.com/woocommerce/woocommerce-blocks/pull/8552)
* 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.

---------

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: Niels Lange <info@nielslange.de>
2023-02-27 19:14:11 +01:00
Luigi 41b04f0ae4 Merge branch 'release/9.4.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-02-27 17:02:28 +01:00
github-actions[bot] 31bde6c3a1 Release: 9.4.4 (https://github.com/woocommerce/woocommerce-blocks/pull/8551)
* Empty commit for release pull request

* update readme

* Switch to select instead of resolveSelector (https://github.com/woocommerce/woocommerce-blocks/pull/8356)

* Mini Cart block - Fix the drawer content height to allow checkout button to show. (https://github.com/woocommerce/woocommerce-blocks/pull/8351)

* Add max-height to Mini Cart drawer.

By giving the Mini Cart contents a max height with the
-webkit-fill-available property, we can ensure that the browser chrome
is accounted for on mobile devices.

* Add `dvh` and keep `vh` as a fallback for height.

By adding `dvh`, we also account for non-webkit mobile browsers that
have the same hidden button issue.

See
https://github.com/woocommerce/woocommerce-blocks/pull/8351#pullrequestreview-1278867767

Keeping `vh` as a fallback, along with `-webkit-fill-available` gives us
the widest range of support.

* update readme with changelog

* add testing steps

* add pr links to readme

* Bumping version strings to new version.

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

* add testing instructions

* Empty commit for release pull request

* add zip link

* Update zip link

* update zip link for testing

* Bumping version strings to new version.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-02-27 17:00:04 +01:00
kmanijak 630f602f49 [Blockifying Product Archive Templates]: Implement the blockified template conversion for the Classic Template Block. (https://github.com/woocommerce/woocommerce-blocks/pull/8248)
* 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

* 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

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

* 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

* 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

* 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

* Align the variable naming to use  instead of

* 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

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

* Extend the get_classes_and_styles_by_attributes method with align and text_align attributes

* Add Archive Title block to the Blockified Classic Template

* Minor getRowBlock function refactor

* 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

* 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

* Improve the naming of BlockifiedTemplateConfig type

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

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

* Revert the margin fix which was added already on trunk

* Move the surrounding blocks as inner blocks of Products

* Hide the conversion behind the experimental build flag (as it was before)
2023-02-27 15:34:18 +01:00
Alba Rincón cb71f26efc Remove the term-description from the template string (https://github.com/woocommerce/woocommerce-blocks/pull/8549) 2023-02-27 15:14:57 +01:00
Alba Rincón 90e68175cf Fix "Product Price" block margin on the "All products" block (https://github.com/woocommerce/woocommerce-blocks/pull/8518)
* Only use margin for the feature plugin

* Return empty style if no support for spacing styling
2023-02-27 14:38:45 +01:00
Luigi Teschio ada39c2378 Disable compatibility layer via hook (https://github.com/woocommerce/woocommerce-blocks/pull/8550)
* Disable compatibility layer via hook

* Update src/Templates/BlockTemplatesCompatibility.php

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

* remove useless import

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-02-27 14:08:50 +01:00
Mike Jolley fd86d19cc2 Filter out payment methods for disabled gateways (https://github.com/woocommerce/woocommerce-blocks/pull/8461) 2023-02-27 13:06:49 +00:00
Mike Jolley bb67c0bcc3 Prevent hydration in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/8413) 2023-02-27 13:06:01 +00:00
Mike Jolley eae93e60b8 Do not mount form until shown (https://github.com/woocommerce/woocommerce-blocks/pull/8525) 2023-02-27 11:52:57 +00:00
Luigi Teschio 8a8adc1c54 Related Products: fix 404 error (https://github.com/woocommerce/woocommerce-blocks/pull/8553) 2023-02-27 12:47:22 +01:00
Mike Jolley a454e1ee0a Avoid rendering renamed props for inner blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8471) 2023-02-27 11:35:12 +00:00
Seghir Nadir 2b89cbff33 Prevent double triggering select shipping on the same rate (https://github.com/woocommerce/woocommerce-blocks/pull/8497)
* Prevent selecting already selected rates

* refactor reducer

* revert changes back to only block dubplicate requests
2023-02-27 11:52:38 +01:00
Niels Lange 49b42b627f Ensure express payment buttons are visible next to each other (https://github.com/woocommerce/woocommerce-blocks/pull/8548) 2023-02-27 17:30:22 +07:00
kmanijak 87cc35678a Move usage of wordpress-components to editor and replace with @wordpress-components (https://github.com/woocommerce/woocommerce-blocks/pull/8463) 2023-02-27 11:13:00 +01:00
Albert Juhé Lluveras 1b21d038ca Small cleanup of webpack-helpers (https://github.com/woocommerce/woocommerce-blocks/pull/8509) 2023-02-27 10:58:10 +01:00
Patricia Hillebrandt 25b434036d Fine-tune the Add to cart form block (https://github.com/woocommerce/woocommerce-blocks/pull/8482)
* Restrict usage to the single product template.

* Update class prefix from wc to wp

* Move the add-to-cart-form block to atomic blocks so it is aligned with the updated structure adopted for single product related blocks.

* Address CR

* ditch woocommerce class.

* remove attributes key

* Add new styles to account for the removal of the .summary and .entry-summary selectors

* Narrow down the styles to the add-to-cart-form class.
2023-02-24 23:12:53 +01:00
Luigi Teschio abd8cdbcc2 Add Related Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8522) 2023-02-24 16:35:43 +01:00
Saad Tarhi 9bfc8a633c Fix Payment Options settings crash in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/8535) 2023-02-24 16:08:19 +01:00
Seghir Nadir 48e30f868e Check for null session before going forward (https://github.com/woocommerce/woocommerce-blocks/pull/8537) 2023-02-24 15:53:11 +01:00
Thomas Roberts d64881b260 Fix E2E tests - Wait for the Checkout to push changes before proceeding with tests (https://github.com/woocommerce/woocommerce-blocks/pull/8502)
* Wait for push changes before clicking place order

* Blur last field and wait for network requests when entering addresses

* Use correct quote style

* Add address_2 to fake test address

* Use correct property names when filling test address

* Use correct comment style

* Update address values to reflect what is in the config file

* Remove unnecessary waits

* Improve batch request checking when filling shipping and billing address

* Wait for network idle before selecting shipping address

* Add checkCustomerPushCompleted function

* Override checkout data with test email

* Fill in the checkout data when testing for terms and conditions text

* Improve comments

---------

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2023-02-24 06:27:56 -08:00
Patricia Hillebrandt 721b52a939 Bump woocommerce/woocommerce-sniffs from 0.1.0 to 0.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/8031)
* Update WooCommerce Sniffs to version 0.1.3

* Add since versioning to all hooks to comply with the updated standards.

* Add since tags for hooks.

* Add the since tags to additional actions and filters

* Update build hook documentation via
> @woocommerce/block-library@9.2.0-dev prebuild:docs /Users/patriciahillebrandt/Woo/plugins/woocommerce-blocks
> rimraf docs/extensibility/actions.md & rimraf docs/extensibility/filters.md

> @woocommerce/block-library@9.2.0-dev build:docs /Users/patriciahillebrandt/Woo/plugins/woocommerce-blocks
> ./vendor/bin/wp-hooks-generator --input=src --output=bin/hook-docs/data && node ./bin/hook-docs

Scanning for files...
Found 212 files. Parsing hooks...
Done
Let's create some docs!
Generating Action Docs...
Creating file docs/third-party-developers/extensibility/hooks/actions.md...
Done!
Generating Filter Docs...
Creating file docs/third-party-developers/extensibility/hooks/filters.md...
Done!

> @woocommerce/block-library@9.2.0-dev postbuild:docs /Users/patriciahillebrandt/Woo/plugins/woocommerce-blocks
> ./bin/add-doc-footer.sh

* Add since tag for additional hooks.

* build hook documentation

* Update QuantityLimits filter_value docblock.

* Add the @since tags to recently added hooks.

* Add tag for the woocommerce_loop_add_to_cart_args filter.

* Update hooks documentation

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-02-24 13:08:34 +01:00
Saad Tarhi 39b6c1c320 Improve the dismissal behavior of the incompatible gateways notice (https://github.com/woocommerce/woocommerce-blocks/pull/8299)
* Fix notice persistence after dismissal

- This fix applied to the `incompatible payment gateway notice`.
- We used the same dismissal logic in the `sidebar compatibility notice`

* Get incompatible payments when initialized

We initially get the list of `globalPaymentMethods` shared from
the back-end as incompatible payments, because the front-end
`availablePaymentMethods` is empty before the
`paymentMethodsInitialized` state

* Introduce advanced notice dismissal handling

We want to display a dismissed incompatible gateways notice, when the
list of incompatible gateways is updated (e.g., a new incompatible
gateway is enabled)

* Use the full block name for the `Cart` & `Checkout`

* Update variable name for comprehension

* Fix TS errors

* Remove unused imports
2023-02-24 11:57:24 +01:00
Albert Juhé Lluveras c915123afc Fix Product Price and Product Rating alignment (https://github.com/woocommerce/woocommerce-blocks/pull/8526)
* Fix Product Price and Product Rating default alignment

* Refactor get_text_align_class_and_style() to simplify the logic
2023-02-24 09:17:22 +01:00
Tarun Vijwani bbe5b70e80 Add declaration of noticeContext (https://github.com/woocommerce/woocommerce-blocks/pull/8495)
Add the declaration of noticeContext to make notice appear in the shipping calculator
2023-02-23 18:49:03 +04:00
Roy Ho e8efd60d39 Add workflow to check valid links in all documentations (https://github.com/woocommerce/woocommerce-blocks/pull/8496)
* Add workflow to check valid links in all documentations

* Disable issue create link

* Correct storybook multiple components link

* Fix links

* Limit checks to certain paths

* Revert changes to contributors readme
2023-02-23 06:08:40 -08:00
kmanijak 23d9e1008c Add isLink attribute to the Products block title (https://github.com/woocommerce/woocommerce-blocks/pull/8519) 2023-02-23 14:00:44 +01:00
Niels Lange 5944e229c2 Show Cart and Checkout blocks in Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8489) 2023-02-23 12:29:05 +07:00
Luigi 5fc91976c6 Merge branch 'release/9.6.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-02-22 14:59:27 +01:00
github-actions[bot] eb066c80ef Release: 9.6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8506)
* 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.

---------

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>
2023-02-22 14:57:45 +01:00
Luigi e6cb7dd381 Bumping version strings to new version. 2023-02-22 14:56:11 +01:00
Luigi 760144c463 add zip link 2023-02-22 14:31:05 +01:00
Luigi 5565be7353 update changelog and testing instructions 2023-02-22 14:22:08 +01:00
Luigi Teschio 17171910a9 disable compatibilty layer (https://github.com/woocommerce/woocommerce-blocks/pull/8507) 2023-02-22 14:16:04 +01:00
Paulo Arromba 78b4e3fcb7 Ensure Product on Store API always contain an array of images that can be encoded into a JSON array (no named indexes), as per its own schema declaration. (https://github.com/woocommerce/woocommerce-blocks/pull/8499) 2023-02-22 13:12:12 +00:00
Albert Juhé Lluveras e580c1a6af Update Product Details block so it inherits more styles from the theme (https://github.com/woocommerce/woocommerce-blocks/pull/8494)
* Use wc-tabs selectors instead of tabs as WC core does

* Remove hardcoded colors from Product Details tabs
2023-02-22 09:31:20 +01:00
Seghir Nadir d3bda0f339 Pin node version in nightly build action (https://github.com/woocommerce/woocommerce-blocks/pull/8476)
* pin node version in nighlty build

* trigger action for this PR

* move step to its own file

* remove workflow_dispatch

* revert original trigger

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-02-22 07:57:58 +01:00
Tung Du 48a721c60c Update the archive templates to use Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8308)Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
* wip: update blockified archive templates

* Update product archive title to Shop

* Update product search template to blockified version

* new default templates, all blocks are Products block inner blocks

* revert change to fallack eligible archive templates

* remove unneccessary translated strings

* only filter the archive title on the shop page

* add missing categories header for patterns

* remove the term description block on the fly

* explain the reason for removing the term description block

---------

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2023-02-22 08:24:04 +07:00
dependabot[bot] 038f717b87 Bump ua-parser-js from 0.7.31 to 0.7.33 (https://github.com/woocommerce/woocommerce-blocks/pull/8294)
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.31 to 0.7.33.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.31...0.7.33)

---
updated-dependencies:
- dependency-name: ua-parser-js
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-02-21 16:07:23 +01:00
Albert Juhé Lluveras faa6f4ae4a Don't load opinionated button styles in themes that have button styles (https://github.com/woocommerce/woocommerce-blocks/pull/8478) 2023-02-21 15:37:41 +01:00
Albert Juhé Lluveras f742243c2e Fix e2e tests of the Product Details block (https://github.com/woocommerce/woocommerce-blocks/pull/8470)
* Fix e2e tests which use the insertBlock function

* Move more instances of insertBlock to insertWCBlock

* Ensure block inserter is open before searching for a block

* Get rid of openWidgetsEditorBlockInserter

* Rename insertWCBlocks to insertBlockDontWaitForInsertClose

* Fix e2e tests of the Product Details block

* Migrate to insertBlockDontWaitForInsertClose instead of insertBlock

* Go to single product template

* Fix Product Details classname and slug in tests

* Replace usage of 'foo' variable name

* Fix typo in 'can not be inserted in a post' test
2023-02-21 14:04:35 +01:00
Albert Juhé Lluveras 081a63ab8d Fix Catalog Sorting default color in dark backgrounds (https://github.com/woocommerce/woocommerce-blocks/pull/8483) 2023-02-21 13:59:13 +01:00
kmanijak 18e6ba0659 Move the usage of Notices from @wordpress/components from frontend to editor (Filter by Rating) (https://github.com/woocommerce/woocommerce-blocks/pull/8444)
* Move Notice component usage to editor in RatingFilter

* Remove unnecessary JSdoc in Filter by Rating block
2023-02-21 11:48:52 +01:00
Alba Rincón 9f035c6a51 Add more test to the BlockTemplateUtils (https://github.com/woocommerce/woocommerce-blocks/pull/8467) 2023-02-21 11:44:15 +01:00
dependabot[bot] 47c2549a60 Bump simple-git from 3.15.1 to 3.16.1 (https://github.com/woocommerce/woocommerce-blocks/pull/8492)
Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.15.1 to 3.16.1.
- [Release notes](https://github.com/steveukx/git-js/releases)
- [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md)
- [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.16.1/simple-git)

---
updated-dependencies:
- dependency-name: simple-git
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-21 11:20:23 +01:00
dependabot[bot] bf55547b37 Bump @sideway/formula from 3.0.0 to 3.0.1 (https://github.com/woocommerce/woocommerce-blocks/pull/8403)
Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sideway/formula/releases)
- [Commits](https://github.com/sideway/formula/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: "@sideway/formula"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-02-21 11:15:05 +01:00
dependabot[bot] 4905c18855 Bump http-cache-semantics from 4.1.0 to 4.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/8386)
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-21 10:44:48 +01:00
Daniel Dudzic 34fc847d9f All Products: Re-add alignment controls for Product Rating and Price (https://github.com/woocommerce/woocommerce-blocks/pull/8264)
* Product Rating and Price: Re-add alignment controls in the All Products context.

* Add default values to align attributes for price and rating product elements

---------

Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
2023-02-21 09:40:14 +00:00
Manish Menaria 33b3a1d82d Fix Product categories, Product Tags & Keyword filter not working in Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8377)
* Fix product categories & keyword filter not working

* Fix Product tags filter not working

* Make code readable by creating functions for the different parts of the query.

Functions:
- get_filter_by_product_categories_or_tags_query
- get_filter_by_keyword_query

Also rename the function `get_queries_by_attributes` to `get_queries_by_custom_attributes` to make it more clear what it does.

* Make function generic by including all taxonomies

As user can add custom taxonomies, we need to make sure that we include all taxonomies in the query.

To fetch all product taxonomies, I used following function:
```php
get_taxonomies( array( 'object_type' => array( 'product' ) ), 'names' )
```

* Minor improvements based on PR feedback

* Move null check for tax_query to function
2023-02-21 15:06:21 +05:30
Alba Rincón 6d3ca74ba8 Update actions (https://github.com/woocommerce/woocommerce-blocks/pull/8468)
* Update ataylorme/eslint-annotate-action to use node 16

* Update preactjs/compressed-size-action to use node 16

* Update actions/upload-artifact to v3
2023-02-21 09:32:08 +01:00
David Arenas 2ee332d4d4 Update directives prefix to `data-woo-` (https://github.com/woocommerce/woocommerce-blocks/pull/8316)
* Update Interactivity API

* Change `wp` prefixes to `woo`

* Use `woo` prefix for the directives runtime bundle
2023-02-20 17:48:33 +01:00
Roy Ho 2e27f38953 Add parsed border props to featured items (https://github.com/woocommerce/woocommerce-blocks/pull/8472) 2023-02-20 05:45:06 -08:00
kmanijak c872a0c8f3 Move the usage of Notices from @wordpress/components from frontend to editor only (https://github.com/woocommerce/woocommerce-blocks/pull/8457) 2023-02-20 14:31:33 +01:00
Albert Juhé Lluveras 98efe7c43b Fix e2e tests related to inserting blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8462)
* Fix e2e tests which use the insertBlock function

* Move more instances of insertBlock to insertWCBlock

* Ensure block inserter is open before searching for a block

* Get rid of openWidgetsEditorBlockInserter

* Rename insertWCBlocks to insertBlockDontWaitForInsertClose
2023-02-20 10:10:41 +01:00
Saad Tarhi 2dbc6a5f3f Update testing notes (950.md)
The woocommerce/woocommerce-blocks#8372 PR introduced a regression for the woocommerce/woocommerce-blocks#8251 PR

To avoid confusion we are removing it from the testing notes
2023-02-17 22:15:29 +01:00
Saad Tarhi 7cf094d297 Merge branch 'release/9.6.0' into trunk 2023-02-17 19:00:18 +01:00
Thomas Roberts 7c0b8af9ac Check for wc-blocks before checking payment dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/8428) 2023-02-17 07:56:13 -08:00
github-actions[bot] e5ba22df0d Release: 9.6.1 (https://github.com/woocommerce/woocommerce-blocks/pull/8466)
* 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.

---------

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>
2023-02-17 16:29:48 +01:00
Saad Tarhi 2d95f24c69 Bumping version strings to new version. 2023-02-17 15:57:16 +01:00
Saad Tarhi 1299502315 Update testing notes file 2023-02-17 15:53:43 +01:00
Saad Tarhi b88c206ad7 Update testing notes 2023-02-17 15:42:39 +01:00
Saad Tarhi 1ba454368b Update testing notes zip file 2023-02-17 15:34:26 +01:00
Albert Juhé Lluveras e2f192125d Add minimum height to Mini Cart Contents block in the Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8458) 2023-02-17 15:31:01 +01:00
Thomas Roberts 43b0753d65 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
2023-02-17 15:30:36 +01:00
Albert Juhé Lluveras 36a387f373 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
2023-02-17 15:29:20 +01:00
kmanijak 155a693dda In editor use the components from @wordpress/components instead of wordpress-components (https://github.com/woocommerce/woocommerce-blocks/pull/8432) 2023-02-17 15:09:26 +01:00
kmanijak 766b3a20d0 Simplify unused Add to Cart button form placeholder for grouped product (https://github.com/woocommerce/woocommerce-blocks/pull/8438)
* Simplify Add to Cart grouped version as it's never displayed
2023-02-17 15:08:57 +01:00
Saad Tarhi ea43d5bc3b Update testing notes 2023-02-17 15:02:15 +01:00
Saad Tarhi 2aa3a0fb77 Add testing notes 2023-02-17 14:59:47 +01:00
Saad Tarhi a0b1898508 Update readme.txt 2023-02-17 14:51:50 +01:00
Seghir Nadir 9dcf435569 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>
2023-02-17 14:50:33 +01:00
Seghir Nadir 19eb813666 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>
2023-02-17 14:46:10 +01:00
Albert Juhé Lluveras fcd29f8c98 e2e tests: update close modal aria-label to match new versions of GB (https://github.com/woocommerce/woocommerce-blocks/pull/8459)
* Update close modal aria-label to match new versions of GB

* Simplify code based on PR feedback
2023-02-17 12:49:38 +01:00
Saad Tarhi 817b159e5c Add changelog to readme.txt 2023-02-17 12:07:57 +01:00
Alex Florisca 9a6e0833cd Rename the checkout events (https://github.com/woocommerce/woocommerce-blocks/pull/8381)
* WIP

* Deprecate isPaymentPristine and undeprecate isPaymentStarted

* Set payment status to FAILED or SUCCESS when the storeAPI fetch returns

* Remove FINISHED as a status

* Remove ready status

* Revert "Remove FINISHED as a status"

This reverts commit 38d66ed1d9565756d2373533c7a7c5b107a68ddd.

* Add payment status READY

* Removed payment statuses pristine, failed and success

* Remove deprecated selectors and update docs

* Rename the checkout events

* Merge conflicts

* Update test observer

* Update deprecation notice

* deprecation versions

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-02-17 11:03:13 +00:00
Albert Juhé Lluveras b67eed1ace Add minimum height to Mini Cart Contents block in the Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8458) 2023-02-17 11:45:42 +01:00
Alba Rincón 1d3bbad9a5 Skip action when label present on the PR (https://github.com/woocommerce/woocommerce-blocks/pull/8450) 2023-02-17 09:32:50 +01:00
Thomas Roberts 4603576fa6 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
2023-02-16 16:06:55 +01:00
Albert Juhé Lluveras a312b91842 Add support for woocommerce_loop_add_to_cart_args filter in Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8422)
* Add support for woocommerce_loop_add_to_cart_args filter in Products block

* Reuse  placeholder

* Use isset() instead of array_key_exists() to keep code consistent

* Add aria-label attribute to Add to Cart button
2023-02-16 15:30:51 +01:00
Alba Rincón 6f652ae31e Check if property exists before accessing (https://github.com/woocommerce/woocommerce-blocks/pull/8443) 2023-02-16 14:53:06 +01:00
Patricia Hillebrandt 9e0c20d43e Create the Add to Cart Form Block (https://github.com/woocommerce/woocommerce-blocks/pull/8284)
* Add the initial basis for the Add to Cart button

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

* 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.

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

* Update CSS.

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

* Update the button CSS.

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* 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

* Update the icon for the block to match the core icon button
2023-02-16 11:43:37 +01:00
Luigi Teschio 3b04dbb01f fix: not declare the same method twice (https://github.com/woocommerce/woocommerce-blocks/pull/8451) 2023-02-16 11:25:55 +01:00
Alexandre Lara bd9295eb32 Add Single Product Details block (https://github.com/woocommerce/woocommerce-blocks/pull/8225)
* Add minimum structure for Single Product Details block

* Add tests for Single Product Details block

* wip: create block structure and add initial styles

* Add block details to the SingleProductDetails.php file

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Remove customizations for the Single Product Details block

* 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

* Fix PHP Coding Standards warnings

* update block name

* fix SCSS linter error

* move blocks into product-elements folder and rename to product-details

* avoid 404 error

* disable js asset enqueue

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-02-16 11:18:16 +01:00
Albert Juhé Lluveras 56c154737f 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
2023-02-16 10:07:44 +01:00
Luigi Teschio b1fb54ebfd fix 404 error (https://github.com/woocommerce/woocommerce-blocks/pull/8445) 2023-02-16 10:05:13 +01:00
Saad Tarhi e797b56a94 Bump version to 9.7.0-dev 2023-02-15 18:13:47 +01:00
github-actions[bot] 5e5a3e210f Release: 9.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8419)
* Empty commit for release pull request

* Add the changelog entries to readme.txt

* Remove internal change from testing notes

* Add testing notes for the release

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

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

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

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

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

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

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

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

* Update testing notes (960.md)

* Update images size in release notes (960.md)

* Update release notes (960.md) — images size

* Checkout/Store API - Allow partial pushes without country (https://github.com/woocommerce/woocommerce-blocks/pull/8425)

* Support partial push without country field

* Increase timeout to prevent excessive pushes

* Push on focusout

* Only flush inputs

* change debounce timer to 1s

---------

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>

* Add link to PR that deprecated experimental functions (https://github.com/woocommerce/woocommerce-blocks/pull/8430)

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

* Update ZIP link after cherry-picking

* Add testing notes for the cherry picked PR

* Add changelog entry of the cherry picked PR

* Bumping version strings to new version.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-02-15 17:59:20 +01:00
Saad Tarhi 2ef59861c5 Merge branch 'trunk' into release/9.6.0 2023-02-15 16:03:09 +01:00
Saad Tarhi c3637ddee0 Bumping version strings to new version. 2023-02-15 13:25:59 +01:00
Saad Tarhi 5820710dbb Add changelog entry of the cherry picked PR 2023-02-15 13:22:28 +01:00
Saad Tarhi de9b6193a4 Add testing notes for the cherry picked PR 2023-02-15 13:21:26 +01:00
Saad Tarhi a5d7ae26dd Update ZIP link after cherry-picking 2023-02-15 13:18:09 +01:00
Thomas Roberts 4a31f31dde Add link to PR that deprecated experimental functions (https://github.com/woocommerce/woocommerce-blocks/pull/8430)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-02-15 13:07:14 +01:00
Mike Jolley a6b6d1c251 Checkout/Store API - Allow partial pushes without country (https://github.com/woocommerce/woocommerce-blocks/pull/8425)
* Support partial push without country field

* Increase timeout to prevent excessive pushes

* Push on focusout

* Only flush inputs

* change debounce timer to 1s

---------

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2023-02-15 13:06:08 +01:00
Thomas Roberts 44715355aa Add link to PR that deprecated experimental functions (https://github.com/woocommerce/woocommerce-blocks/pull/8430)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-02-15 13:00:42 +01:00
Mike Jolley ce733a07b7 Checkout/Store API - Allow partial pushes without country (https://github.com/woocommerce/woocommerce-blocks/pull/8425)
* Support partial push without country field

* Increase timeout to prevent excessive pushes

* Push on focusout

* Only flush inputs

* change debounce timer to 1s

---------

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2023-02-15 13:00:16 +01:00
Daniel Dudzic e36da268f8 Product Price: Fix typography styles in the editor. (https://github.com/woocommerce/woocommerce-blocks/pull/8398)
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2023-02-15 11:03:42 +00:00
Luigi Teschio c13bf15862 Wrap the Single Product Template in a div with the product class (https://github.com/woocommerce/woocommerce-blocks/pull/8364)
* wrap the Single Product Template in a div with the product class

* improve logic and increase coverage of unit test

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* address feedback

* fix name block and fix check

* wrap single product template only on the frontend
2023-02-15 10:27:18 +01:00
Luigi Teschio 336591f8d4 Add Product Image Gallery (https://github.com/woocommerce/woocommerce-blocks/pull/8235)
* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* Add Product Image Gallery block

* remove support global styles

* remove support global styles

* address CSS feedback

* add support for the custom classname

* remove save function

* add second parameter to the subscribe function

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig
2023-02-14 14:21:48 +01:00
Alex Florisca 39682160c2 Refactor payment status (https://github.com/woocommerce/woocommerce-blocks/pull/8110)
* WIP

* Change payment status from pristine to idle

* Deprecate isPaymentStarted and isPaymentFinished

* Correct comments

* Deprecate isPaymentPristine and undeprecate isPaymentStarted

* Set payment status to FAILED or SUCCESS when the storeAPI fetch returns

* Remove FINISHED as a status

* Remove ready status

* Revert "Remove FINISHED as a status"

This reverts commit 38d66ed1d9565756d2373533c7a7c5b107a68ddd.

* Add payment status READY

* Update use-payment-interface

* Removed payment statuses pristine, failed and success

* Remove deprecated selectors and update docs

* Deprecate isPaymentStarted in favour of isExpressPaymentStarted

* Fix tests

* Update assets/js/base/context/providers/cart-checkout/payment-events/index.tsx

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

* Mikes suggestions

* Change since version

* Fix tests

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-02-14 12:08:19 +00:00
Saad Tarhi bc045a1d57 Update release notes (960.md) — images size 2023-02-14 13:07:25 +01:00
Saad Tarhi 7da5c4d908 Update images size in release notes (960.md) 2023-02-14 13:03:35 +01:00
Saad Tarhi 29535964e2 Update testing notes (960.md) 2023-02-14 12:56:10 +01:00
Saad Tarhi 2721e99aae Update docs/internal-developers/testing/releases/960.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-02-14 12:47:31 +01:00
Saad Tarhi 71ff3d37ad Update docs/internal-developers/testing/releases/960.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-02-14 12:47:09 +01:00
Saad Tarhi 6cccb23d0c Update docs/internal-developers/testing/releases/960.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-02-14 12:46:39 +01:00
Saad Tarhi 5ef329832e Update docs/internal-developers/testing/releases/960.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-02-14 12:44:45 +01:00
Darren Ethier a371cf027c Fixes CSS spacing and availability issues for breadcrumb, catalog sort, and result count blocks. (https://github.com/woocommerce/woocommerce-blocks/pull/8391)
* Reset margin on result count block

* Reset margin for catalog sort block

* reset margin and other fixes for breadcrumb block.

* Move styles to relevant files
2023-02-14 05:53:33 -05:00
Mike Jolley 48ffbcdeae Clarify __experimental_woocommerce_blocks_hidden (https://github.com/woocommerce/woocommerce-blocks/pull/8414) 2023-02-14 10:08:10 +00:00
Saad Tarhi 2006c875d8 Add testing notes for the release 2023-02-14 10:04:27 +01:00
Saad Tarhi 12a1ffcf72 Remove internal change from testing notes 2023-02-14 09:53:04 +01:00
Saad Tarhi 2a7ea9ace3 Add the changelog entries to readme.txt 2023-02-14 09:17:14 +01:00
Raluca Stan 142de23168 Remove newsletter repo example from the docs (https://github.com/woocommerce/woocommerce-blocks/pull/8417)
* Remove newsletter repo example from the docs

The newsletter is not maintained anymore and we use the @woocommerce/extend-cart-checkout-block to showcase our extensibility points

* Update docs/README.md

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

---------

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-02-13 18:24:17 +01:00
Alba Rincón 74e522e889 Set inherit default to true when products is inserted on archive product templates (https://github.com/woocommerce/woocommerce-blocks/pull/8375)
* Set inherit default to true when products is inserted on archive products templates

* Create new query attributes object

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

* Extract the products registration to a separate function

* Bring back variation name

* Move variation name

* Unregister the block before registering it again

* Use subscribe only on the site editor

* Undo change

* Try fixing tests

* Fix test

* Revert test only

---------

Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-02-13 16:36:38 +01:00
Seghir Nadir 0c0afec76d sync back email (https://github.com/woocommerce/woocommerce-blocks/pull/8410)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-02-13 13:58:54 +01:00
Thomas Roberts f3588635d7 Add stricter observer type checks in payments thunk to improve resilience to bad observer responses (https://github.com/woocommerce/woocommerce-blocks/pull/8319)
* Allow observers to set billingAddress by returning billingData

This is required since we didn't correctly deprecate billingData when we changed the name to billingAddress

* Add tests for shippingAddress and paymentMethodData

* Add mocked __internalSetPaymentMethodData to correct object

It was in registry, but should be in dispatch as the action is on the same store as the thunk. Registry is used for actions on other stores.

* Re-add FieldValidationStatus type

* Add FieldValidationStatus back

* Remove empty file

* Import FieldValidationStatus from correct place

* Remove import of deleted types file

* Add isObserverResponse type guard

* Use error constant instead of magic string in event emitter

* Remove composite project tsconfig

* Add ObserverResponse type

* Add types to emitEventWithAbort

* Check if paymentmethod data is an object before dispatching

* Set types on observer responses

* Add validationErrors type guards

* Add tests for validation typeguards

* Add validation errors as option on observer response

* Add more granular observer response types

* Check observer response has correct types before dispatching actions

* Force type on deprecated billingData and shippingData

* Remove unnecessary comment
2023-02-13 03:43:57 -08:00
Thomas Roberts 3797418079 Graduate `__experimentalApplyCheckoutFilter` and `__experimentalRegisterCheckoutFilters` to stable. (https://github.com/woocommerce/woocommerce-blocks/pull/8346)
* Add wrapper for __experimentalRegisterCheckoutFilters and deprecate it

* Update internal references from __experimentalRegisterCheckoutFilters

* Add wrapper for deprecated __experimentalApplyCheckoutFilter

* Update references from `__experimentalApplyCheckoutFilter`
2023-02-13 03:30:09 -08:00
Lucio Giannotta a7c730fbd0 Change location of Feedback prompt in Products block. (https://github.com/woocommerce/woocommerce-blocks/pull/8382)
With WordPress 6.2, the inspector controls are going to be
tabbed into a “Styles” and “Setting” section (where applicable).
Previously, in order to display our Feedback Prompt at the bottom
of the controls, we had hooked it into the “Colors” section
as a temporary/hacky solution to the problem.

Now that the styles sections are all moved, the problem
doesn't really exist anymore, and we can just place it
at the bottom of the controls.
2023-02-13 12:26:39 +01:00
Thomas Roberts 73788d4378 Prevent coupon error being removed when blurring the input and fix tests (https://github.com/woocommerce/woocommerce-blocks/pull/8349)
* Prevent coupon error disappearing on blur if value unchanged

* Check for inline selector on coupon error

* Prevent coupon error disappearing on blur if value unchanged

* Check for inline selector on coupon error

* Update selector for coupon E2E test
2023-02-13 03:11:00 -08:00
github-actions[bot] 3b79c8de18 Release: 9.4.3 (https://github.com/woocommerce/woocommerce-blocks/pull/8357)
* Empty commit for release pull request

* update readme

* Switch to select instead of resolveSelector (https://github.com/woocommerce/woocommerce-blocks/pull/8356)

* Mini Cart block - Fix the drawer content height to allow checkout button to show. (https://github.com/woocommerce/woocommerce-blocks/pull/8351)

* Add max-height to Mini Cart drawer.

By giving the Mini Cart contents a max height with the
-webkit-fill-available property, we can ensure that the browser chrome
is accounted for on mobile devices.

* Add `dvh` and keep `vh` as a fallback for height.

By adding `dvh`, we also account for non-webkit mobile browsers that
have the same hidden button issue.

See
https://github.com/woocommerce/woocommerce-blocks/pull/8351#pullrequestreview-1278867767

Keeping `vh` as a fallback, along with `-webkit-fill-available` gives us
the widest range of support.

* update readme with changelog

* add testing steps

* add pr links to readme

* Bumping version strings to new version.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
2023-02-10 13:11:50 +01:00
Tarun Vijwani ee9a1e9ed1 Change coupon component label to "Add a coupon" (https://github.com/woocommerce/woocommerce-blocks/pull/8385)
- Revert the label change  to "Add a coupon"  so that it will be merged to WC Core and translation for the new string will be available.

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-02-10 00:56:30 +01:00
Seghir Nadir 54ad47e53b Handle single notice issues (https://github.com/woocommerce/woocommerce-blocks/pull/8404)
* Capture notices from hidden block into siblings block

* switch to using a single context

* make change bwc

* support context as array in StoreNotice

* Handle single context use cases
2023-02-09 16:04:02 +01:00
Seghir Nadir b396584e50 Capture notices from hidden block into siblings block (https://github.com/woocommerce/woocommerce-blocks/pull/8390)
* Capture notices from hidden block into siblings block

* switch to using a single context

* make change bwc

* add tests

* support context as array in StoreNotice

* move filter logic to Notice component
2023-02-09 14:41:18 +01:00
Alex Florisca 495339a073 Push address changes for email, name and address fields (https://github.com/woocommerce/woocommerce-blocks/pull/8400) 2023-02-09 11:53:25 +00:00
Mike Jolley aeed7b22b0 Update Cart/Checkout Default Template Styling (https://github.com/woocommerce/woocommerce-blocks/pull/8380)
* Switch default cart headings for cross sells to h2/h3

Fixes woocommerce/woocommerce-blocks#8193

* Style empty cart icon

woocommerce/woocommerce-blocks#8360

* Ensure editable content fields are transparent in the editor

woocommerce/woocommerce-blocks#8359 woocommerce/woocommerce-blocks#7007
2023-02-07 16:47:13 +01:00
Saad Tarhi a9296c7b3f Update the incompatible gateways notice design (https://github.com/woocommerce/woocommerce-blocks/pull/8365)
* Fix the alert icon's name

* Add "status" to the Alert's API

* Update the incompatible gateways notice's design

* Set the list's bullet points from CSS
2023-02-07 08:06:05 +01:00
Seghir Nadir 41e8c83719 add settings as a supports prop for local pickup (https://github.com/woocommerce/woocommerce-blocks/pull/8389) 2023-02-06 16:58:44 +01:00
Tung Du 5b542fa54f Fix: color setting for Catalog Sorting (https://github.com/woocommerce/woocommerce-blocks/pull/8372)
* fix select color

* add more priority to css selector

* add missing classname
2023-02-04 00:47:36 +07:00
Lucio Giannotta a750bb1c1b Remove Cart block from Style Book. (https://github.com/woocommerce/woocommerce-blocks/pull/8369)
Currently, the Cart block doesn't fully support Global Styles,
so, in orderto avoid providing the users with a confusing
or broken experience, we have decided to remove it
for the time being, until proper support has been added.
2023-02-03 18:27:52 +01:00
Lucio Giannotta a8789a09f0 Remove Classic Template from Style Book. (https://github.com/woocommerce/woocommerce-blocks/pull/8371)
The Classic Template is not style-able, also, removing the
example doesn't make us lose much in terms of UX.
2023-02-03 18:26:41 +01:00
Thomas Roberts 130827a2c3 Allow third party methods to appear in local pickup area (https://github.com/woocommerce/woocommerce-blocks/pull/8256)
* Add get_collectible_method_ids function

* Add collectibleMethodIds to asset data registry

* Check whether method id is pickup_location/in collectibleMethodIds

* Allow selectShippingRate to be called without a package id

* Prevent collectible methods showing in the main shipping area

* Remove unnecessary pluck and add pickup_location to returned array

* No longer insert pickup_location in collectibleMethodIds

* Allow third party methods to influence low/high collection price

* Update useShippingData to consider any collectible method

* Add hasSelectedLocalPickup to shipping types

* Add dependency to selectShippingRate in useShippingData

* Register collectibleMethodIds as a callback

This is so the shipping methods get change to register before this is called. Passing a callback to `add` means it won't be called until just before it is output.

* Update supports key to 'local_pickup'

* Rename utils/shipping-rates to TS

* Convert to TS, add isPackageRateCollectible & hasCollectableRate

* Add tests for hasCollectableRate and isPackageRateCollectible

* Update shipping controller to output only method names

* Make PickupLocation shipping method support local_pickup

* Set prefersCollection based on rate ID being collectible

* Remove need to retrieve settings and use helper function instead

* rename hasCollectableRate to hasCollectibleRate

* Use array_reduce and update comments in  get_local_pickup_method_ids

* Switch order of array_unique and array_values

* Remove unneeded dependency

* Hyphenate local-pickup so it follows the same format as other features

* Update use of collectible to collectable

* Change supports feature to be hyphenated
2023-02-03 08:00:24 -08:00
Mike Jolley 093ec68061 Fix/extension data conflicts (https://github.com/woocommerce/woocommerce-blocks/pull/8354)
* Update __internalSetExtensionData to require namespaces

* Test coverage for __internalSetExtensionData

* Rename of select is no longer needed

* Update doc
2023-02-03 11:18:18 +00:00
Daniel Dudzic 04a618ba6f Sale Badge: Add support for text settings and margin (https://github.com/woocommerce/woocommerce-blocks/pull/8334)
* Sale Badge: Add support for text settings and margin.

* Sale Badge: Remove redundant __experimentalSkipSerialization.
2023-02-03 11:09:12 +01:00
Daniel Dudzic d7defe2a0c Global Styles: Add support for additional text settings (https://github.com/woocommerce/woocommerce-blocks/pull/8329)
* Global Styles: Add support for text settings

* StyleAttributesUtils: Change function order

* Global Styles: Remove redundant isFeaturePluginBuild() from useTypographyProps().
2023-02-03 10:54:16 +01:00
Daniel Dudzic 076ba46ccb Product Rating: Add support for the padding setting (https://github.com/woocommerce/woocommerce-blocks/pull/8347)
* Product Rating: Add support for padding and background color settings.

* Product Rating: Remove the background color setting.
2023-02-02 22:45:03 +01:00
Roy Ho 0b28e33b2a Remove unneeded isloading attribute (https://github.com/woocommerce/woocommerce-blocks/pull/8340) 2023-02-02 09:35:48 -08:00
Alex Florisca f73eba338d Add how checkout block processes an order to the repo docs (https://github.com/woocommerce/woocommerce-blocks/pull/8240)
* Add how checkout block processes an order to the repo docs

* Update docs/third-party-developers/extensibility/README.md

Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>

* Tarun changes

---------

Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
2023-02-02 17:25:29 +00:00
Roy Ho 0a6daae35f Add reset button to all filter blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8366) 2023-02-02 05:50:28 -08:00
Tom Cafferkey e0c4052bfa Use setProductRatingsQuery to reset the filter when Apply Button is enabled (https://github.com/woocommerce/woocommerce-blocks/pull/8374) 2023-02-02 11:47:17 +00:00
Seghir Nadir a1d0b6d9f1 Switch to select instead of resolveSelector (https://github.com/woocommerce/woocommerce-blocks/pull/8356) 2023-02-02 10:12:52 +01:00
Daniel W. Robert 376bbc8993 Mini Cart block - Fix the drawer content height to allow checkout button to show. (https://github.com/woocommerce/woocommerce-blocks/pull/8351)
* Add max-height to Mini Cart drawer.

By giving the Mini Cart contents a max height with the
-webkit-fill-available property, we can ensure that the browser chrome
is accounted for on mobile devices.

* Add `dvh` and keep `vh` as a fallback for height.

By adding `dvh`, we also account for non-webkit mobile browsers that
have the same hidden button issue.

See
https://github.com/woocommerce/woocommerce-blocks/pull/8351#pullrequestreview-1278867767

Keeping `vh` as a fallback, along with `-webkit-fill-available` gives us
the widest range of support.
2023-02-01 11:48:37 -05:00
Niels Lange b368835638 Merge branch 'trunk' of github.com:woocommerce/woocommerce-blocks into trunk 2023-02-01 16:34:00 +01:00
Niels Lange e0d23f2ec0 Bump version to 9.6.0-dev 2023-02-01 16:33:27 +01:00
Patricia Hillebrandt d329ceee89 Store breadcrumbs block > Ensure experimental global styles are limited to the Feature plugin (https://github.com/woocommerce/woocommerce-blocks/pull/8345)
* Store breadcrumbs block: Gate global styles added via experimental flags to the feature plugin.

* Rename the const to featurePluginSupport and invoke it on block registration.

* Address CR
2023-02-01 16:31:45 +01:00
github-actions[bot] 6f9e394f83 Release: 9.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8330)
* Empty commit for release pull request

* Update readme.txt

* Bump “minimum_supported_wp_version” in phpcs.xml

* Add testing notes

* Update 950.md

* Update 950.md

* Update 950.md

* Update 950.md

* Update 950.md

* Update 950.md

* Update woocommerce/woocommerce-blocks#8202 testing instructions.

* Revert "Set inherit default to true only when is inserted in the archive product template (https://github.com/woocommerce/woocommerce-blocks/pull/8251)" (https://github.com/woocommerce/woocommerce-blocks/pull/8352)

This reverts commit b0f2198e35.

* Update release ZIP file

* Bumping version strings to new version.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-02-01 16:24:50 +01:00
Mike Jolley 7bc927b38b Merge pull request woocommerce/woocommerce-blocks#8325 from woocommerce/add/payment-data-example
Add example for passing custom data via a payment method
2023-02-01 14:35:02 +00:00
Mike Jolley 0f6b0da296 usePaymentMethodInterface link 2023-02-01 14:33:30 +00:00
Alba Rincón 011f225e2a Revert "Set inherit default to true only when is inserted in the archive product template (https://github.com/woocommerce/woocommerce-blocks/pull/8251)" (https://github.com/woocommerce/woocommerce-blocks/pull/8352)
This reverts commit b0f2198e35.
2023-02-01 13:48:17 +01:00
Albert Juhé Lluveras 4371b6a480 Remove __experimentalDefaultControls from Filter by Stock and Filter by Rating blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8326)
* Remove __experimentalDefaultControls from Filter by Stock and Filter by Rating blocks

* Remove link color from Filter by Stock block
2023-02-01 11:46:50 +01:00
Albert Juhé Lluveras 831cf20a4d Remove unnecessary __experimentalDuotone instances (https://github.com/woocommerce/woocommerce-blocks/pull/8328) 2023-02-01 10:28:23 +01:00
Roy Ho 9d2c7ec30d Update apply button description to be more clear for filter blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8339) 2023-01-31 05:58:00 -08:00
Mike Jolley 0dc585f770 Update docs/internal-developers/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-01-31 13:51:44 +00:00
Luigi Teschio d0d6c756f9 Style Book: Hide all the products grid (https://github.com/woocommerce/woocommerce-blocks/pull/8315) 2023-01-31 10:07:02 +01:00
Mike Jolley 1d45dacc3e Cart Action Promises with success/reject handling (https://github.com/woocommerce/woocommerce-blocks/pull/8272)
* move thinks and create consistent promise rejection

* Remove notifyErrors

* Combine error handling

* Ensure thunk usage handles errors

* Use promise in coupon form

* onsubmit type

* receiveCartContents during checkout

* Update mocks

* receiveCartContents mocks/types

* Fix receiveCartContents tests

* Move thunks back to actions, add todo for follow up

* Sort actions alphabetically

* Null check is unnecessary
2023-01-30 15:12:17 +00:00
Mike Jolley 586826269d Add example for passing custom data via a payment method 2023-01-30 13:18:46 +00:00
Niels Lange dc283a0e0a Document how to add multiple items via batch request (https://github.com/woocommerce/woocommerce-blocks/pull/8266)
* Document how to add multiple items via batch request

* Remove “Add Items” section title

* Remove “data” part from JSON example payload
2023-01-30 11:26:07 +01:00
Roy Ho 883d856c28 Add reset button in the editor for product attributer filter (https://github.com/woocommerce/woocommerce-blocks/pull/8285)
Co-authored-by: Niels Lange <info@nielslange.de>
2023-01-30 10:45:09 +01:00
Niels Lange 30a987a27a Adjust return to cart arrow (https://github.com/woocommerce/woocommerce-blocks/pull/8289) 2023-01-30 09:53:14 +01:00
Albert Juhé Lluveras 7ee1ea00ca Remove font family styling support from Catalog Sorting and Product Results Count blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8311) 2023-01-30 04:30:36 +01:00
Roy Ho 44f04c1cd1 Add border attributes to featured items block to show border styles in editor (https://github.com/woocommerce/woocommerce-blocks/pull/8304) 2023-01-27 12:29:39 -08:00
Alba Rincón f695b92c1f Fix `catalog sorting` and `checkout` tests (https://github.com/woocommerce/woocommerce-blocks/pull/8292)
* Try fixing tests

* test

* Simplify tests

* Fix other tests

* Add comment
2023-01-27 20:52:10 +01:00
Luigi Teschio 5025b80106 Hide blocks from Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8309) 2023-01-27 19:11:18 +01:00
Patricia Hillebrandt 9563468dc1 Create Store Breadcrumbs Block (https://github.com/woocommerce/woocommerce-blocks/pull/8222)
* Initial structure for the breadcrumbs block

* ditch inline comment

* Fine-tune the store breadcrumbs

* Disable the breadcrumbs block for regular posts & pages

* Update the breadcrumbs block details.

* Add tests

* rely on sprintf to render the breadcrumb

* Ditch usesContext.

* Add a link to the breadcrumb editor preview

* Disable all pointer-events for the breadcrumb link in the editor preview

* Add the align attribute

* Use the Disabled component to prevent interactions and update the copy for the block description.
2023-01-27 18:31:13 +01:00
Albert Juhé Lluveras fe0908ae96 Show JETPACK_AUTOLOAD_DEV notice if it's not set to true (https://github.com/woocommerce/woocommerce-blocks/pull/8312) 2023-01-27 16:52:39 +01:00
Luigi Teschio c02726e1c1 Style Book: Fix Featured Product and Featured Category Blocks preview (https://github.com/woocommerce/woocommerce-blocks/pull/8313)
* Subscribe only to changes on core/block-editor

* Improve performance of useForcedLayou

This is because by the time we reach this line, innerBlocks will be an empty array (or we wouldn't make it this far) and if nextBlocks contains ANY items it will, by definition be unequal, so a length check is simpler and more performant. Also we can remove the dependence on yet another lodash function by doing it this way.

* Check if templates synced before doing it again in useForcedLayout

* Style Book: Fix Featured Product and Featured Category Blocks

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-01-27 14:19:40 +01:00
Daniel Dudzic 5fc14d42a0 Product Button and Rating: Allow margin styles in WC core (https://github.com/woocommerce/woocommerce-blocks/pull/8280)
* Product Button and Rating: Allow margin styles in WC core.

* Product Button: Fix spacing logic.
2023-01-27 12:13:42 +01:00
Thomas Roberts 282bb81046 Fix `useForcedLayout` to prevent breaking style book (https://github.com/woocommerce/woocommerce-blocks/pull/8243)
* Subscribe only to changes on core/block-editor

* Improve performance of useForcedLayou

This is because by the time we reach this line, innerBlocks will be an empty array (or we wouldn't make it this far) and if nextBlocks contains ANY items it will, by definition be unequal, so a length check is simpler and more performant. Also we can remove the dependence on yet another lodash function by doing it this way.

* Check if templates synced before doing it again in useForcedLayout

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-01-27 11:45:49 +01:00
Luigi 5fc57e9fea Merge branch 'release/9.4.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-01-26 17:42:13 +01:00
github-actions[bot] 0860aef2ad Release: 9.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8303)
* Empty commit for release pull request

* add testing instructions

* add zip file for testing

* update readme

* upload new zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Remove feature flag from Element variations (https://github.com/woocommerce/woocommerce-blocks/pull/8297)

Removes feature flag from:

* Product Summary
* Product Template
* Product Title

* Empty commit for release pull request

* add testing instructions

* add zip link for testing

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2023-01-26 17:40:55 +01:00
Lucio Giannotta 11fc29a4c8 Remove feature flag from Element variations (https://github.com/woocommerce/woocommerce-blocks/pull/8297)
Removes feature flag from:

* Product Summary
* Product Template
* Product Title
2023-01-26 14:33:33 +01:00
Luigi Teschio 6f6fd16546 Disable ESLint for the interactivity package (https://github.com/woocommerce/woocommerce-blocks/pull/8301) 2023-01-26 14:13:53 +01:00
David Arenas d2c5c4a9c3 Add the Interactivity API runtime to WooCommerce blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8220)
* Add Interactivity API scripts

* Enqueue scripts if Products exists for testing

* Test client-side transitions

* Remove script enqueue

* Remove hpq dependency

* Update Interactivity scripts to latest version

* Remove interactivity scripts from core entries

* Create webpack config for interactivity api

A plugin for optional chaining is required as the repo uses Webpack 4 for now.

* Enqueue the directives runtime

* Updated wp directives code

* Use a filter to enque the directives runtime

* Remove base-interactivity alias for now

* Add path for modules inside base-interactivity

* Revert "Remove base-interactivity alias for now"

This reverts commit 7c6cbee372c65e430590d98c1819b6b4b0a97d93.

* Remove unnecessary filter and enqueue

* Update router code

* Update Interactivity location and alias

* Use hook `init` for script registering

Co-authored-by: Mario Santos <santosguillamot@gmail.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
2023-01-26 12:39:25 +01:00
Paulo Arromba 729bec698c Fix for wrong shipping schema in checkout (https://github.com/woocommerce/woocommerce-blocks/pull/8291)
Co-authored-by: Niels Lange <info@nielslange.de>
2023-01-26 16:31:02 +07:00
Mike Jolley 06b9b29454 Refresh the cart when using the browser back button (https://github.com/woocommerce/woocommerce-blocks/pull/8236)
* Refresh on back

* Move refresh code to a hook in useStoreCart

* Load mini cart scripts when page is invalid

* Update code comments

* refreshDataIfPersisted->refreshCachedCartData

* Avoid deprecated code

* Only notify if cart resolution has finished

* Fix tests to check for cart resolution

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-01-25 16:28:41 +00:00
Luigi Teschio 77dbee8ed9 Fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/8263)
* Fix E2E tests

* skip catalog sorting E2E tests
2023-01-25 16:41:22 +01:00
Alba Rincón f830740908 Make `Notice` component legible in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/8278)
* Make Notice component color black

The Notice component text is not legible in dark themes since the background color
is light and and the text color is too. With this change we are setting the color
always to black for our blocks, so it's always legible.

* Make the text black for notices displayed on the editor

* Import editor.scss
2023-01-25 15:29:17 +01:00
Paulo Arromba d4806016c9 Fix/ Ensure variation data is populated with unspecified default attribute values (https://github.com/woocommerce/woocommerce-blocks/pull/8226)
* Fixes a bug where cart response only reflects variation data submitted and not full variation data with default values.

* Sort variation data by attribute alphabetically

* PHP unit test for checking variation data.
2023-01-25 13:03:44 +00:00
Alba Rincón 781e1c266d Update testing instructions (https://github.com/woocommerce/woocommerce-blocks/pull/8290) 2023-01-25 12:45:21 +01:00
kmanijak d621f4c04c Remove duplicated key from the object containing TEMPLATES in a test file (https://github.com/woocommerce/woocommerce-blocks/pull/8260) 2023-01-24 17:16:05 +01:00
Mike Jolley 1f0253795a Checkout/Store API: Push valid changes selectively (https://github.com/woocommerce/woocommerce-blocks/pull/8030)
* support partial updates

* revised error ids to reference in validation class

* Validate before push

* Fix logic + TS

* Avoid need for PUT by delaying validation/sanitization

* $cart change was not needed

* Revert changes in schema - fix is handled at route level

* Put back wc_do_deprecated_action

* Extra validation is not needed

* No need to export isValidAddressKey - its not used anywhere

* No longer using RouteException in customer update route

* Fix setting shipping to billing with changes

* Update error ids

* Only validate posted props

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2023-01-24 14:52:59 +00:00
Albert Juhé Lluveras 4c2ac7341b Product Price: allow margin styles in WC core (https://github.com/woocommerce/woocommerce-blocks/pull/8269) 2023-01-24 12:52:49 +01:00
Alba Rincón b0f2198e35 Set inherit default to true only when is inserted in the archive product template (https://github.com/woocommerce/woocommerce-blocks/pull/8251) 2023-01-24 11:04:00 +01:00
Alba Rincón eaffd05bf4 Remove the color inherit (https://github.com/woocommerce/woocommerce-blocks/pull/8270) 2023-01-24 10:57:59 +01:00
Niels Lange 3cb443ff67 Move notices to corresponding context (https://github.com/woocommerce/woocommerce-blocks/pull/8228)
* Updated package-lock.json

* fixed method sig

* PHP versions matrix

* removed extra space

* renamed step

* Update E2E and coding standards to use PHP 8.0

* Un-linted unit-tests.yml. Github flows use 4 spaces indent, while our .editorconfig file enforces 2 spaces.

* Refactor unit-tests.yml

* Linted unit-tests.yml to proper 2 space indents

* Removed composer caching

* Test without hacky permissions step

* Concurrency disable.
Jobs renaming.

* Add step to install wp-env for PHP unit tests.

* Another try at fixing perms for wp-env

* Another try at fixing perms for wp-env

* Restore missing steps

* Move notices to corresponding context

* Change `errorMessageContext` to `context`

* Fix MD lint errors

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-01-24 11:58:30 +07:00
Mike Jolley aedcd5ff2a Document filter usage (https://github.com/woocommerce/woocommerce-blocks/pull/8232)
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2023-01-23 17:05:39 +00:00
Thomas Roberts c5aecceb5a Allow observers to set `billingAddress` by returning `billingData` (https://github.com/woocommerce/woocommerce-blocks/pull/8163)
* Allow observers to set billingAddress by returning billingData

This is required since we didn't correctly deprecate billingData when we changed the name to billingAddress

* Add link to original PR

* Set billingAddress when observer errors

* Rename  shippingData to shippingAddress

* Add isBillingAddress and isShippingAddress type guards

* Add tests for new type guards

* Only set billing and shipping if they are valid objects

* Add tests for __internalEmitPaymentProcessingEvent thunk

* Update deprecated version

* Return promise from this function to aid with testability

* Add tests for shippingAddress and paymentMethodData

* Ensure correct value is used to set shipping address

* Move test data out of tests to aid with reusability

* Improve success callback name

* Add mocked __internalSetPaymentMethodData to correct object

It was in registry, but should be in dispatch as the action is on the same store as the thunk. Registry is used for actions on other stores.

* Add test for failed observers

* Add test for mixed observers

* Add comments explaining the destructure & deprecation
2023-01-23 08:27:59 -08:00
Seghir Nadir 637c1a735f Use cart item key instead of index in shipping items (https://github.com/woocommerce/woocommerce-blocks/pull/8199)
* use cart item key instead of index

* Update src/StoreApi/Schemas/V1/CartShippingRateSchema.php

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

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-01-23 15:45:10 +01:00
Tarun Vijwani 018af7c3af Change coupon component label to "Apply a coupon code" (https://github.com/woocommerce/woocommerce-blocks/pull/8254)
The "Coupon code" text was changed to "Add a coupon" and it resulted in the failing of an e2e test as it couldn't find the translated text for "Coupon code". The translation for  "Add a coupon" is not available so changing the text to "Apply a coupon code" until the next WC Core release since the translation for the text "Apply a coupon code"  is already available.
2023-01-23 16:11:44 +04:00
Luigi adcfff67bc Merge branch 'release/9.4.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-01-23 11:47:15 +01:00
github-actions[bot] 7cec5a2bea Release: 9.4.1 (https://github.com/woocommerce/woocommerce-blocks/pull/8262)
* Empty commit for release pull request

* add testing instructions

* add zip file for testing

* update readme

* upload new zip

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
2023-01-23 11:45:51 +01:00
Thomas Roberts cd5972938c Stop notice removal when current notices changes (https://github.com/woocommerce/woocommerce-blocks/pull/8253)
* Stop notice removal when current notices changes

* Move select inside useEffect
2023-01-23 01:56:14 -08:00
Niels Lange a2a7c131d8 Fix broken markdown table 2023-01-23 12:34:57 +07:00
Daniel Dudzic 48c4c71839 Product Button: Transition from using CSS margin to Global Styles (https://github.com/woocommerce/woocommerce-blocks/pull/8239) 2023-01-20 16:23:00 +01:00
Daniel Dudzic dc38c2a4a1 Product Rating: Transition from using CSS margin to Global Styles (https://github.com/woocommerce/woocommerce-blocks/pull/8202)
* Product Rating: Transition from using CSS margin to Global Styles

* Product Rating: Re-add css margins for Product Rating inside of the All Products block.

* Product Rating: Change bottom margin to 1rem

* Product Rating: Re-add the Classic Template fix.

* Product Rating: Remove the Classic Template fix.
2023-01-20 16:04:00 +01:00
Daniel Dudzic da637b8b64 Product Price: Transition from using CSS margin to Global Styles (https://github.com/woocommerce/woocommerce-blocks/pull/8195)
* Product Price: Transition from using CSS margin to Global Styles

* Product Price: Re-add css margins for Product Price inside of the All Products block.

* Product Price: Change bottom margin to 1rem

* Product Price: Fix the margin typescript declaration.
2023-01-20 15:56:29 +01:00
Mike Jolley 246f4442a9 Update free price display (https://github.com/woocommerce/woocommerce-blocks/pull/8241) 2023-01-20 14:34:25 +00:00
Albert Juhé Lluveras eaad45eb8a Avoid changing the markup of all ratings when the Product Rating block is present in the page (https://github.com/woocommerce/woocommerce-blocks/pull/8247) 2023-01-20 14:44:01 +01:00
Tung Du 2eafec1044 Add a compatibility layer to keep extensions continue working with Blockified Archive Templates (https://github.com/woocommerce/woocommerce-blocks/pull/8172)
* wip: initial BlockTemplatesCompatibility class

* full support for archive template

* early return

* fix early return using wc conditional functions

* address code review

* remove_default_hooks is only called with inherited block

* refactor the data structure

* shorter hook name

* Move additional hooks to remove_default_hooks

* Update src/Templates/BlockTemplatesCompatibility.php

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Add check that  is an array

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-01-20 12:44:02 +01:00
Mike Jolley 435e341fe6 Expose cart errors as notices (https://github.com/woocommerce/woocommerce-blocks/pull/8162)
* Scroll to errors when interacting with radio buttons

* Fix full stop wrapping in checkout

* Make type guard for api response reusable

* Merge useShippingData  and useSelectShippingRate

Overlapping functionality and responsibility easily merged into a single hook.

* ShippingDataProvider Typescript

* Create errors when receiving errors via thunk

* Update DEFAULT_ERROR_MESSAGE

* Update tests since all errors are set via new action

* Correct SET_ERROR_DATA

* Update json error text and allow it to be dismissed

* Add back missing comment in types

* Put back typedef

* Allow Store Notice Containers to display subContexts without changing original context

* receiveError handles cart

* Update assets/js/data/cart/notify-errors.ts

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

* Update assets/js/base/context/hooks/shipping/types.ts

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

* Remove debug

* Revise type (remove as)

* rename to unregisteredSubContexts

* getNoticeContexts comment

* Add test for unregistered errors

* Update comment

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-01-19 16:40:52 +00:00
Daniel W. Robert c86ea1aa66 Updates version for @woocommerce/block-library (https://github.com/woocommerce/woocommerce-blocks/pull/8223)
Lockfile is using v9.4.0 for the @woocommerce/block-library dependency.
This update bumps that dep version to v9.5.0.
2023-01-18 17:23:53 -05:00
Tarun Vijwani ca8f7aa4ea Fix "Writing Your First Block Type" tutorial link in docs (https://github.com/woocommerce/woocommerce-blocks/pull/8231)
Changed the URL of  "Writing Your First Block Type" in doc from Gutenberg project to block development guide.
2023-01-18 21:04:20 +04:00
Mike Jolley 9492c6f37d Update Shipping Calculator Handling so errors are reported to the customer (https://github.com/woocommerce/woocommerce-blocks/pull/8182)
* Allow the context to be overridden when processing errors

* Export all error functions

* Allow customer data update if not editing fields

* removeNoticesWithContext Helper

* Hide rates when editing the address

* New update address logic

* Handle cancel for the form
2023-01-18 17:02:38 +00:00
Alba Rincón fbd86f8762 Add Store Notices block (https://github.com/woocommerce/woocommerce-blocks/pull/8157)
* Block scaffolding

* Rename to store notices

* Register only in the site editor

* Update description

* Add woocommerce class

* Add tests

* Delete old test file

* Update notices message in the editor

* Remove customization

* Disable the block server side

* Fix TS error

* Add custom classes

* Reprashed test description

* Escape notices

* Remove unnecessary disabled component

* Only allow to insert the block once

* Improve class name

* Merge edit and block files

* Fix copy

* Simplify test case

* Remove align support

* Remove attributes

* Change editor markup

* Use the Notice component to display the notice placeholder on the editor

* Use sprintf to improve readability

* Inline component

* Remove styles and unregister scripts

* Use ordered placeholders

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* Use info as the notices status

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* Fix php lint error

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-01-18 13:40:30 +01:00
Alba Rincón 34c7fa95e1 Add Catalog Sorting filter block (https://github.com/woocommerce/woocommerce-blocks/pull/8122)
* WIP

* Render in editor and add styles

* Simplify select

* Undo change

* Update titles and description

* Wrapped text for translation

* Remove from products inner blocks

* Allow the block in the inserter

* Rename test file and add new tests for catalog-sorting block

* Register on the site editor only

* Fix tests

* Disable block server side

* Override the `enqueue_assets`

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* Fix TS error

* Simplify edit

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* Disable background color

* Add custom classes

* Remove alignment

* Inherit color and font properties

* Merge edit and block files

* Use sprintf to improve code readability

* Make fontsize small by default

* Add order placeholders and woocommerce class

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* Fix floating issue

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* Add woocommerce class

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-01-17 16:20:10 +01:00
kmanijak d00a21fbaf [Blockifying Product Archive Templates] Add Results Count block (https://github.com/woocommerce/woocommerce-blocks/pull/8078)
* Init setup to add a new block Results Count

* Render  template part as a content of ResultsCount block

* Switch to template part rendering

* Rename the block to ProductResultsCount

* Fix typo in BlockTypesController

* Change the ProductResultsCount class name

* Remove Product Results Count block from Product Query template

* Improve the way Product Results Count is rendered in the editor

* Add  prefix to places that missed renaming from ResultsCount to ProductResultsCount

* Remove unnecessary frontend.tsx file for ProductResultsCount

* Make sure global styles are applied and respected by Product Results Count block

* Make sure the Product Results Count is available inly in Product Catalog template

* Add basic tests to Product Results Count

* Remove empty line in style file

* Fix TS issue in Product Results Count

* Fix typo

* Override the enqueue_assets method to prevent unnecessary enqueue and 404 error on the frontend

* Add necessary property to block's metadata

* Address code review feedback

* Update description

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

* Remove disabled component

* Improve test description

* Merge edit and block files

* Remove align support

* Remove background support

* Simplify edit component

* Improve readability with sprintf and add custom class

* Simplify test case

* Add styles and order placeholders

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* Fix markup to match with the frontend

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-01-17 16:19:42 +01:00
Luigi f1e79d6ca8 bump version to 9.5.0-dev 2023-01-17 15:10:39 +01:00
github-actions[bot] 67c4a4741f Release: 9.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8198)
* Empty commit for release pull request

* update WooCommerce compatibility

* adding testing instructions

* add zip file testing for the release 9.4.0

* add gif to testing instructions

* remove add to cart testing instructions

* Correctly detect compatible express payment methods (https://github.com/woocommerce/woocommerce-blocks/pull/8201)

* Remove unused action and type action

* Derive the incompatible payment methods with selector

Instead of adding the incompatiblePaymentMethods to the payment state.
Let's simply derive it using a selector to keep a minimal state.

* Check compatibility with express payments

* update testing instructions

* add new zip file for testing

* Refresh shipping cache when saving Local Pickup (https://github.com/woocommerce/woocommerce-blocks/pull/8203)

* invalidate cache on page load

* always flesh settings after save

* use correct prefix

* Account for local pickup rates before disabling shipping in editor (https://github.com/woocommerce/woocommerce-blocks/pull/8207)

* Account for local pickup rates before disabling

* check for local pickup before disabling shipping in editor

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2023-01-17 15:09:02 +01:00
Luigi b916bd035a Bumping version strings to new version. 2023-01-17 14:28:47 +01:00