Commit Graph

5534 Commits

Author SHA1 Message Date
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
Seghir Nadir 187a6dd536 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
2023-01-17 12:20:46 +01:00
Seghir Nadir 3f46da0424 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
2023-01-17 10:32:32 +01:00
Tarun Vijwani 93441e2e52 Add coupon link instead of dropdown in Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/7993)
* Add coupon link instead of dropdown in Cart and Checkout blocks

* Fix state names used for displaying the link and coupon form

* Fix storybook for coupon block

* Fix unit test for coupon block

* Fix css and accessibility

* Fix coupon block position on Checkout

* Update e2e test cases for coupon block (https://github.com/woocommerce/woocommerce-blocks/pull/8022)

* Update e2e test cases for coupon block

* Fix perfomance test for coupon block

* Fix double await typo

* Fix perfomance test for coupon block

* Remove CSS

* Use classnames to add and remove classes

Improved the code to use classnames to add and remove classes. Also, moved the logic to handle click and submit to separate functions.
2023-01-17 13:10:50 +04:00
Seghir Nadir 1e957c5d4d 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
2023-01-17 10:04:09 +01:00
Luigi 18a7d0fee5 add new zip file for testing 2023-01-17 09:59:47 +01:00
Luigi 12348a3a67 update testing instructions 2023-01-17 09:58:09 +01:00
Saad Tarhi 7fd3ca96bf 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
2023-01-17 09:54:28 +01:00
Saad Tarhi daf36de9a5 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
2023-01-16 23:06:48 +01:00
Lucio Giannotta 26ae17ffa0 Products: Fix variable products add to cart (https://github.com/woocommerce/woocommerce-blocks/pull/8173)
Variable products would get added to cart via the button, even
when the button said “Select options” and contained a link.

This was because the button was automatically hydrated
through a CSS class.
2023-01-16 18:54:25 +01:00
Seghir Nadir f438ea8ba2 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
2023-01-16 17:56:56 +01:00
Albert Juhé Lluveras 8b27294167 Remove purple color from WC Blocks icons (https://github.com/woocommerce/woocommerce-blocks/pull/8200) 2023-01-16 13:55:40 +01:00
Luigi d38daee436 remove add to cart testing instructions 2023-01-16 13:00:43 +01:00
Luigi 3e4c15112b add gif to testing instructions 2023-01-16 12:46:50 +01:00
Luigi a986b5d814 add zip file testing for the release 9.4.0 2023-01-16 12:32:14 +01:00
Luigi a6d64c109f adding testing instructions 2023-01-16 12:26:34 +01:00
Luigi d9975683db update WooCommerce compatibility 2023-01-16 12:12:42 +01:00
Mike Jolley fcc9bacdc9 Prevent undefined variable notice on checkout (https://github.com/woocommerce/woocommerce-blocks/pull/8197) 2023-01-16 11:53:12 +01:00
Tarun Vijwani e9b07c9ebf Update package-lock.json file (https://github.com/woocommerce/woocommerce-blocks/pull/8194)
Updating the package-lock.json file to fix the nightly build release failed error: npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
2023-01-16 11:48:18 +01:00
Albert Juhé Lluveras a588d4075a Update release checklist adding a step to add highlights to WC core release post (https://github.com/woocommerce/woocommerce-blocks/pull/8183) 2023-01-16 08:21:11 +01:00
Mike Jolley db96991492 Custom validation messages using the field name/label (https://github.com/woocommerce/woocommerce-blocks/pull/8143)
* Custom validation strings using a new function named getValidityMessageForInput

* getValidityMessageForInput tests

* Added integration test for error message

* Clear value

* update test strings
2023-01-13 15:54:35 +00:00
Nadir Seghir 7d874e736a Local Pickup: Refactor E2E tests for locations 2023-01-13 13:03:48 +01:00
Nadir Seghir 380ef202e4 Local Pickup: fix checkout shipping summary test 2023-01-13 11:50:57 +01:00
Nadir Seghir 34dc0b9ac0 Local Pickup: remove zip from testing guide 2023-01-12 15:56:19 +01:00
Mike Jolley 7196a76577 Correctly detect selected location on first mount 2023-01-12 15:42:43 +01:00
Mike Jolley 5076541597 Local Pickup: hide regular shipping rates when Local pickup is selected. 2023-01-12 15:42:43 +01:00
Nadir Seghir 7bfda113b0 Local Pickup: Fix render logic for regular shipping rates 2023-01-12 15:42:43 +01:00
Nadir Seghir 612ddb34d2 Add default title to pickup method field 2023-01-12 15:42:43 +01:00
Nadir Seghir 3cbf0d7404 Local Pickup: don't allow negative values 2023-01-12 15:42:43 +01:00
Nadir Seghir 4cb19a2c76 Local Pickup: refactor useBillingAsShipping 2023-01-12 15:42:43 +01:00
Nadir Seghir fb18a7a76d Use custom error messages for Local Pickup admin screen 2023-01-12 15:42:43 +01:00
Nadir Seghir 737972d8a8 Local Pickup: change pickup locations block icon to Store instead of truck 2023-01-12 15:42:43 +01:00
Nadir Seghir 549358c65c Local Pickup: Change location modal to have store country as default country 2023-01-12 15:42:43 +01:00
Nadir Seghir 994491c2b8 Local Pickup: rename pickup options block 2023-01-12 15:42:43 +01:00
Nadir Seghir 86a3b2a0ef Local Pickup: Fix default status for local pickup enabling setting 2023-01-12 15:42:43 +01:00
Nadir Seghir 7f84e9348a Local Pickup: only allow digits in cost 2023-01-12 15:42:43 +01:00
Nadir Seghir 2396736041 Update testing file for Local Pickup 2023-01-12 15:42:43 +01:00
Nadir Seghir fc720defb1 Parse shipping prices before getting lowest and highest 2023-01-12 15:42:43 +01:00
Seghir Nadir 3eb51342a9 Add validation to local pickup fields (https://github.com/woocommerce/woocommerce-blocks/pull/8007)
* add form validation for admin screen

* add types

* add validation to fields

* restore form ref
2023-01-12 15:42:43 +01:00
Nadir Seghir 8c64915197 Local Pickup: add testing steps 2023-01-12 15:42:43 +01:00
Nadir Seghir 4338944681 ungate the ShippingController class 2023-01-12 15:42:43 +01:00
Mike Jolley c611635179 Handle Local Pickup Selection in the Cart (https://github.com/woocommerce/woocommerce-blocks/pull/7958)
* Shipping and collection method block package support (https://github.com/woocommerce/woocommerce-blocks/pull/7383)

* Shipment wordage

* Hide panel if collection is not available for an item

* Update selection when displayed

* Register a global local pickup method for the block based checkout (https://github.com/woocommerce/woocommerce-blocks/pull/7414)

* Register a blocks local pickup method globally

* Remove local pickup plucking from store api

* Multiple pickup locations

* Unused code

* Translate meta data

* Update UI to match zones table

* Description

* Handle new shipping method in client

* Improve location rendering

* Only split out pickup location methods

* Fix enabled toggle

* Show and hide shipping text in sidebar based on pickup

* No need for "from" when min and max are the same price

* Update sample data for the editor

* fix errors

* Force method/pickup in the checkout layout (https://github.com/woocommerce/woocommerce-blocks/pull/7910)

* Split up ShippingRatesControl for readability

* Alignment styling

* Split tidy packages for readability

* Combine hooks to prevent circular dependency

* Notice styling

* Conflict

* Hide notice with 1 package

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2023-01-12 15:42:43 +01:00
Mike Jolley 81f248b294 Local Pickup: filter out local pickup rates from regular shipping. 2023-01-12 15:42:43 +01:00
Mike Jolley 020d9f3919 Remove regressed useForcedLayout logic 2023-01-12 15:42:43 +01:00
Mike Jolley 963c8dcebe Local Pickup: set prefersCollection to false if we don't have shipping. 2023-01-12 15:42:43 +01:00
Mike Jolley d9fbaa5ec3 Force method/pickup in the checkout layout (https://github.com/woocommerce/woocommerce-blocks/pull/7910) 2023-01-12 15:42:43 +01:00
Mike Jolley cb830f5ec8 Maintain Local Pickup Selection (https://github.com/woocommerce/woocommerce-blocks/pull/7894)
* prefersCollection starts undefined

* When undefined, look at shipping rate data
2023-01-12 15:42:43 +01:00
Seghir Nadir 7d9602253c Restrict Local Pickup Checkout block users only (https://github.com/woocommerce/woocommerce-blocks/pull/7893)
* limit page visiblity to Checkout block

* only enable pickup_locations if checkout block

* always register local pickup
2023-01-12 15:42:43 +01:00
Mike Jolley abaea4fff8 Fix up the missing details section for local pickup
Fixes woocommerce/woocommerce-blocks#7898
2023-01-12 15:42:04 +01:00
Mike Jolley 1f69e4b5e6 Local Pickup: add empty state UI for location table (https://github.com/woocommerce/woocommerce-blocks/pull/7871) 2023-01-12 15:42:04 +01:00
Seghir Nadir 3c824053d7 Show notice if merchant has legacy local pickup enabled alongside the new pickup (https://github.com/woocommerce/woocommerce-blocks/pull/7842)
* add notice when there are existing enabled legacy local pickups

* Fix PHP warning

* Link though to the settings page

* Fix setting save

* Enabling this will produce duplicate options at checkout.

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-01-12 15:42:04 +01:00
Mike Jolley f2318060e1 Local Pickup: handle some UI issues
Duplicate selector

Convert to sentence case

Swap location and name in rate
2023-01-12 15:42:04 +01:00
Mike Jolley 65bc740518 Block Checkout: Apply selected Local Pickup rate to entire order (all packages) (https://github.com/woocommerce/woocommerce-blocks/pull/7484)
* Avoid duplicates in selected shipping method display

* Correct types

* Render pickup locations - not rates

* Always show "from" when there are multiple packages

* Pickup must be available for all packages

* Derive locations from rates

* Improve code style/docs

* Packagecount

* Introduce woocommerce_store_api_cart_select_shipping_rate

* Update docblock
2023-01-12 15:40:15 +01:00
Mike Jolley c49426570d React Based Local Pickup Settings Screen (https://github.com/woocommerce/woocommerce-blocks/pull/7581)
* Move payment methods

* Setup entrypoints

* Sortable implementation

* Sortable

* Basic UI in place for settings

* Hydrate real settings

* Form updates values

* Styling and save button placement

* useSettings hook

* Prepare for save

* delete

* Add location button

* Remove className

* Conditional display of taxes

* Save via API

* Update general settings to designs

* Modal styles

* Style table

* Border colors and radius

* Added e2e tests

* use node 16

* Enqueue states in admin

* Use render from wordpress/element

* Missing handle style

* Enable translations

* Remove curried function

* Todo for inline settings

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2023-01-12 15:40:15 +01:00
Mike Jolley 3d0109f1dc Enhancement/pickup location editor improvements (https://github.com/woocommerce/woocommerce-blocks/pull/7446)
* Hide form step descriptions when empty unless block has focus

* Make editor style match frontend

* Add links to settings in sidebar

* update sample costs

* phpcs
2023-01-12 15:40:15 +01:00
Mike Jolley bc2a52b85d Local Pickup: merge packages into a single package 2023-01-12 15:40:15 +01:00
Mike Jolley 16fa7f7b85 Enhance and fix add button in Local Pickup admin UI 2023-01-12 15:39:41 +01:00
Mike Jolley 82e9155167 Rename collection to shipping to reflect the block purpose 2023-01-12 15:38:06 +01:00
Mike Jolley 87c51d822f Local Pickup: add support for addresses and base taxes on them
Break address into multiple pieces for pickup Break address into multiple pieces for pickup Break address into multiple pieces for pickup locations

Apply taxes based on location

Require locations

Customer location tax logic

Improved editing
2023-01-12 15:38:06 +01:00
Mike Jolley 586bc90f1b Shipping and collection method block package support (https://github.com/woocommerce/woocommerce-blocks/pull/7383)
* Shipment wordage

* Hide panel if collection is not available for an item

* Update selection when displayed

* Register a global local pickup method for the block based checkout (https://github.com/woocommerce/woocommerce-blocks/pull/7414)

* Register a blocks local pickup method globally

* Remove local pickup plucking from store api

* Multiple pickup locations

* Unused code

* Translate meta data

* Update UI to match zones table

* Description

* Handle new shipping method in client

* Improve location rendering

* Only split out pickup location methods

* Fix enabled toggle

* Show and hide shipping text in sidebar based on pickup

* No need for "from" when min and max are the same price

* Update sample data for the editor
2023-01-12 15:35:57 +01:00
Mike Jolley 23b175d246 Create Pickup Locations Block (https://github.com/woocommerce/woocommerce-blocks/pull/7316)
* prefersCollection controls shipping visibility

* Remove log

* Create skeleton pickup options block based on shipping methods

* Filter locations to local pickup methods

* Correct case of block name

* Location styling

* Pull pickup details from new core fields

* Fix linting warnings on new types

* Remove blocks_local_pickup check (this does not exist yet)

* Move enable_local_pickup_without_address so it works under all contexts

* Fix display of FREE when there are a mix of prices

* Remove undefined return value

* Update block descriptions

* fix message

* Correct case

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2023-01-12 15:35:57 +01:00
Mike Jolley b74a9f92f2 Introduce Toggle between Shipping Options and Pickup Locations (https://github.com/woocommerce/woocommerce-blocks/pull/7308)
* prefersCollection controls shipping visibility

* Toggle shipping visibility based on prefersCollection

* Remove log

* Toggle in admin
2023-01-12 15:35:57 +01:00
Mike Jolley 4263b57d2c Rename Shipping options to "method" to avoid duplicate heading 2023-01-12 15:35:57 +01:00
Seghir Nadir 1c8d2e6074 Support editing collection method titles in editor. (https://github.com/woocommerce/woocommerce-blocks/pull/7293)
* support editing blocks title in editor

* disable formats
2023-01-12 15:34:44 +01:00
Nadir Seghir 9ee5b40186 Introduce shipping method toggle block 2023-01-12 15:34:44 +01:00
Thomas Roberts 9a2535f434 Remove old cart notices before showing new ones (https://github.com/woocommerce/woocommerce-blocks/pull/7363)
* Remove cart notices before showing new ones

* bot: update checkstyle.xml

* Update deps for useEffect

* Remove outdated notices from mini cart

* Add comment to note that this functionality is also present in mini cart

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-12 04:44:26 -08:00
Tarun Vijwani 80344fa04b Convert tabs component to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7865)
* Convert tabs component to TypeScript

* Add tabs component story

* Add desciptions in comments to the Tab props

* Rename and export tabs component to display descriptions in Storybook

Renamed Tabs component to __Tabs as a sign it should not be used directly. Since we were using withInstanceId as the default export and were not exporting the Tabs component, Storybook could not retrieve the description and default values. We have renamed and exported the component to make sure Storybook can pick up the descriptions and default values.

* Rename exported Tabs component

Changed the exported Tabs component from __Tabs to __TabsWithoutInstanceId to make it more descriptive.
2023-01-12 16:16:32 +04:00
Albert Juhé Lluveras a8184695d3 Update minimum PHP required version to 7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8154) 2023-01-12 12:57:53 +01:00
dependabot[bot] 42006d4841 Bump @wordpress/babel-preset-default from 6.14.0 to 7.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8113)
Bumps [@wordpress/babel-preset-default](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default) from 6.14.0 to 7.8.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/babel-preset-default/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/babel-preset-default@7.8.0/packages/babel-preset-default)

---
updated-dependencies:
- dependency-name: "@wordpress/babel-preset-default"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-01-12 12:39:37 +01:00
Daniel Dudzic 792c4a84db Product Elements [Variations]: Change block icon colors to match the core blocks. Fixes woocommerce/woocommerce-blocks#8084 (https://github.com/woocommerce/woocommerce-blocks/pull/8155) 2023-01-12 12:39:01 +01:00
kmanijak c0f33efb1c Order blocks alphabetically in webpack-entries and BlockTypesController (https://github.com/woocommerce/woocommerce-blocks/pull/8109)
* Order blocks in webpack-entries alphabetically

* Order blocks in BlockTypesController.php alphabetically
2023-01-12 08:34:45 +01:00
Mike Jolley bb1504dd84 Avoid usage of `@wordpress/components` inside base components (https://github.com/woocommerce/woocommerce-blocks/pull/7996)
* Use local package rather than WP package in base components

* Missing type on imports

* Move hasSpecingStyleSupport inline to avoid polluting utils with the block-editor external

* Use local wordpress-block-editor import to avoid the external

* Add readme to base directory to warn against using editor/components externals

* Check functions exist

* Revert "Check functions exist"

This reverts commit ce95800b79ddb48369cd22d2b7854384db0d8891.

* Revert wordpress-block-editor import

* Add todos to the hooks that need refactoring

* Update assets/js/atomic/blocks/product-elements/button/supports.ts

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

* Update assets/js/atomic/blocks/product-elements/image/supports.ts

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

* Update assets/js/atomic/blocks/product-elements/rating/support.ts

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

* Update assets/js/atomic/blocks/product-elements/sale-badge/support.ts

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

* Update assets/js/atomic/blocks/product-elements/title/index.ts

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

* Reference issue

* Update assets/js/base/README.MD

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

* spacing

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-01-11 17:12:06 +00:00
Albert Juhé Lluveras 886786eee1 Use DAY_IN_SECONDS constant instead of calculating the value (https://github.com/woocommerce/woocommerce-blocks/pull/8156) 2023-01-11 17:11:41 +01:00
dependabot[bot] 621473f5e5 Bump @wordpress/is-shallow-equal from 4.13.0 to 4.24.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8126)
Bumps [@wordpress/is-shallow-equal](https://github.com/WordPress/gutenberg/tree/HEAD/packages/is-shallow-equal) from 4.13.0 to 4.24.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/is-shallow-equal/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/is-shallow-equal@4.24.0/packages/is-shallow-equal)

---
updated-dependencies:
- dependency-name: "@wordpress/is-shallow-equal"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-01-11 12:38:26 +01:00
dependabot[bot] 8e5db74b3d Bump @wordpress/api-fetch from 6.19.0 to 6.21.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8125)
Bumps [@wordpress/api-fetch](https://github.com/WordPress/gutenberg/tree/HEAD/packages/api-fetch) from 6.19.0 to 6.21.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/api-fetch/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/api-fetch@6.21.0/packages/api-fetch)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-01-11 11:14:51 +01:00
Lucio Giannotta 56f3a57b92 Remove the “Products (Beta)” block from WP 6.0 or lower (https://github.com/woocommerce/woocommerce-blocks/pull/8112)
* Remove the Products block from WP < 6.0

Too many APIs which are required for the Products block experience
are just plainly unavailable in versions lower than 6.0.

(cherry picked from commit ccfb1210bcbdb14ab52f6f240916fb4fcaa3ff18)
(cherry picked from commit 8c7bcce8218a83a9498943b23c971de1199bcad7)
2023-01-11 01:30:10 +01:00
dependabot[bot] 2c51c444f9 Bump @storybook/react from 6.5.13 to 6.5.15 (https://github.com/woocommerce/woocommerce-blocks/pull/8124)
Bumps [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/app/react) from 6.5.13 to 6.5.15.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/app/react)

---
updated-dependencies:
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-01-10 17:17:18 +01:00
dependabot[bot] b38eed2c61 Bump @types/react-dom from 18.0.9 to 18.0.10 (https://github.com/woocommerce/woocommerce-blocks/pull/8127)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 18.0.9 to 18.0.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

---
updated-dependencies:
- dependency-name: "@types/react-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-01-10 16:35:29 +01:00
Patricia Hillebrandt 2ddddbe50e useCollection hook: Do not bail early if isEditor (https://github.com/woocommerce/woocommerce-blocks/pull/8079) 2023-01-10 15:17:51 +01:00
Tung Du 8662d853f4 Fix: unable to customize All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8140) 2023-01-10 17:14:43 +07:00
Thomas Roberts 88b19bceb4 Add thunk support for < WP 5.9 (https://github.com/woocommerce/woocommerce-blocks/pull/8136) 2023-01-09 15:01:49 -08:00
Lucio Giannotta b1d5976163 Convert `Add to Cart` to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/8077)
* Add `@wordpress/components` types as `devDep`
2023-01-09 19:21:09 +01:00
Albert Juhé Lluveras e1340d8432 Add testing steps for WC Blocks 8.9.3 and 8.9.4 (https://github.com/woocommerce/woocommerce-blocks/pull/8123) 2023-01-09 18:36:35 +01:00
Tung Du e141e286a6 Fix broken E2E tests cause by edit template button class name change in latest Gutenberg release (https://github.com/woocommerce/woocommerce-blocks/pull/8107) 2023-01-09 23:44:53 +07:00
Albert Juhé Lluveras 116dcac67b Update the docs to create a WC core changelog entry when doing a release (https://github.com/woocommerce/woocommerce-blocks/pull/8088) 2023-01-09 13:59:37 +01:00
Manish Menaria 8d4df3d102 Add Customer Account block name to readme.txt (https://github.com/woocommerce/woocommerce-blocks/pull/8114) 2023-01-09 14:17:54 +05:30
Thomas Roberts 676ed6b679 Add checkout data store docs (https://github.com/woocommerce/woocommerce-blocks/pull/8117) 2023-01-06 07:52:02 -08:00
Paulo Arromba 86c6e975eb Context for aria-label on cart quantity controls (https://github.com/woocommerce/woocommerce-blocks/pull/8099)
* Aria label context for "Remove item" action on cart

* Aria label context for quantity controls on cart
2023-01-06 15:21:56 +00:00
Thomas Roberts 2575fd10bd Ensure checkout order summary and totals block cannot be removed (https://github.com/woocommerce/woocommerce-blocks/pull/7873) 2023-01-06 07:05:01 -08:00
Thomas Roberts 5d439855e2 Ensure Slot/Fills render in editor (https://github.com/woocommerce/woocommerce-blocks/pull/8111)
* Wrap Checkout Edit in SlotFillProvider

Required to render Slot/Fills in the editor

* Remove editor check when rendering ExperimentalOrderShippingPackages

We want to render it in the editor and on the front end, so checking is no longer necessary

* Wrap Cart in SlotFillProvider when in editor

This is so Slot/Fills can be rendered in the preview
2023-01-06 06:53:53 -08:00
dependabot[bot] 3860001949 Bump @wordpress/base-styles from 4.0.4 to 4.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7971)
Bumps [@wordpress/base-styles](https://github.com/WordPress/gutenberg/tree/HEAD/packages/base-styles) from 4.0.4 to 4.14.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/base-styles@4.14.0/packages/base-styles/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/base-styles@4.14.0/packages/base-styles)

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

Signed-off-by: dependabot[bot] <support@github.com>

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-01-05 16:10:49 -03:00
Thomas Roberts 719fbadf2d Add internal validation data store docs (https://github.com/woocommerce/woocommerce-blocks/pull/8100)
* Add internal validation docs

* Add TOC entries
2023-01-05 06:44:11 -08:00
Thomas Roberts c3873f4950 Add example request and example payment data to Checkout docs (https://github.com/woocommerce/woocommerce-blocks/pull/8083) 2023-01-05 06:43:51 -08:00
Tung Du 1fc5d2d91a E2E: Product Query: Popular filters presets (https://github.com/woocommerce/woocommerce-blocks/pull/7749) 2023-01-05 18:21:22 +07:00
Tarun Vijwani bc116f002e Convert sidebar layout component to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7904) 2023-01-05 11:56:05 +04:00
dependabot[bot] eebb3e41ea Bump automattic/jetpack-autoloader from 2.11.12 to 2.11.14 (https://github.com/woocommerce/woocommerce-blocks/pull/8036)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.12 to 2.11.14.
- [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.12...v2.11.14)

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

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-01-04 17:52:55 -03:00
Daniel Dudzic 9214c99724 Attribute, Rating and Stock filters: Fix the dropdown indicator icon display (https://github.com/woocommerce/woocommerce-blocks/pull/8080)
* Filter blocks: Fix the dropdown indicator icon display for 'single option' mode. Closes woocommerce/woocommerce-blocks#8075

* Filter blocks: Fix the dropdown indicator for multiple items option. Closes woocommerce/woocommerce-blocks#7889
2023-01-04 18:37:08 +01:00
Manish Menaria 2933727878 Bump version strings to 9.4.0-dev in package-lock.json 2023-01-04 16:39:42 +05:30
Manish Menaria 3da812ea0b Bump version strings to 9.4.0-dev 2023-01-04 16:34:26 +05:30
Tung Du 2b20e2d3f3 Refactor Filter Wrapper to remove usage of useInnerBlocksProps (https://github.com/woocommerce/woocommerce-blocks/pull/8095) 2023-01-04 17:31:17 +07:00
github-actions[bot] 6c379258e6 Release: 9.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8072)
* Empty commit for release pull request

* Add changelog

* Add testing notes

* Fix a typo

* load all JSON translation files correctly (https://github.com/woocommerce/woocommerce-blocks/pull/8034)

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

* Disable Rate Limiting when editing Blocks in admin (https://github.com/woocommerce/woocommerce-blocks/pull/7934)

* Disable Rate Limiting for users who can edit posts

To avoid limiting the number of edits in WP admin to our Woo Blocks, we
need to disable rate limiting altogether.

We simply disabled rate limiting for users who can edit posts!

* Refactor rate limiting code

* Fix disabled rate limiting bug for non admin users

* Refactored applying rate limiting code.

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

* Update woocommerce-gutenberg-products-block.zip

* Update ZIP file

* Add screenshots to testing notes

* Fix markdown linting issues

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-01-04 15:24:54 +05:30
dependabot[bot] 2a32ae7577 Bump json5 from 1.0.1 to 1.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8090)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

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-01-03 18:42:10 -03:00
dependabot[bot] 771866f33e Bump @wordpress/html-entities from 3.12.0 to 3.24.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8092)
Bumps [@wordpress/html-entities](https://github.com/WordPress/gutenberg/tree/HEAD/packages/html-entities) from 3.12.0 to 3.24.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/html-entities/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/html-entities@3.24.0/packages/html-entities)

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

Signed-off-by: dependabot[bot] <support@github.com>

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-01-03 18:08:45 -03:00
dependabot[bot] aa6bbf4d22 Bump @typescript-eslint/eslint-plugin from 5.30.5 to 5.47.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8037)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.30.5 to 5.47.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.47.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>

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-01-03 17:48:39 -03:00
dependabot[bot] 0e402970bf Bump @wordpress/i18n from 4.14.0 to 4.24.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8076)
Bumps [@wordpress/i18n](https://github.com/WordPress/gutenberg/tree/HEAD/packages/i18n) from 4.14.0 to 4.24.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/i18n/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/i18n@4.24.0/packages/i18n)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-03 15:59:47 -03:00
Lucio Giannotta c708ff2f56 Hide `core/no-results` as default in Product Query if WP <= 5.9 (https://github.com/woocommerce/woocommerce-blocks/pull/8082)
`core/no-results` was not available until WP 6.0.
2023-01-03 19:14:33 +01:00
Seghir Nadir 156737d9b7 load all JSON translation files correctly (https://github.com/woocommerce/woocommerce-blocks/pull/8034)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-01-02 16:21:47 +01:00
Saad Tarhi a22465796b Disable Rate Limiting when editing Blocks in admin (https://github.com/woocommerce/woocommerce-blocks/pull/7934)
* Disable Rate Limiting for users who can edit posts

To avoid limiting the number of edits in WP admin to our Woo Blocks, we
need to disable rate limiting altogether.

We simply disabled rate limiting for users who can edit posts!

* Refactor rate limiting code

* Fix disabled rate limiting bug for non admin users

* Refactored applying rate limiting code.

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-01-02 14:49:12 +01:00
Patricia Hillebrandt 9868d948a4 Dependabot: Enable auto-merge on pull requests. (https://github.com/woocommerce/woocommerce-blocks/pull/8040)
* Dependabot: Enable auto-merge on pull requests.

* Update auto-merge dependency list

* Update dependabot documentation and invert the order of the auto-merge action for clarity.
2023-01-02 11:06:25 +01:00
Patricia Hillebrandt 0959bb1122 Ensure filter blocks are not reloaded every time they are selected in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/8002)
* Filter Rating Block > Prevent reload on select.

* Filter by Stock Block > Prevent reload on select.

* Disable debounce for the editor.

* Filter by Price Block > Prevent reload on select.

* Filter by Attribute Block > Prevent reload on select.

* Make the isEditor and isSelected params optional.

* Make isSelected optional.

* Address CR

* update to use isObject
2023-01-02 00:22:08 +01:00
Lucio Giannotta b81b8a9220 Product Query: Remove the “Products on Sale” Product Query variation (https://github.com/woocommerce/woocommerce-blocks/pull/7926) 2022-12-30 17:02:01 +01:00
Lucio Giannotta cfe4725bc7 Product Query: create variation of `core/post-template` as a Product Query inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7838) 2022-12-30 16:51:27 +01:00
kmanijak 95d5b51949 Include the types of Jest customer matchers for unit tests 2022-12-30 16:36:37 +01:00
kmanijak 3ddf4dd929 Update the docs with more details about external dependencies and wordpress-components alias (https://github.com/woocommerce/woocommerce-blocks/pull/8052) 2022-12-30 14:17:42 +01:00
Tung Du 8c24200e73 Update E2E tests for Gutenberg 14.8.x (https://github.com/woocommerce/woocommerce-blocks/pull/8050) 2022-12-30 18:47:33 +07:00
kmanijak 00ac537474 Make each Bundle Analyzer report open in new tab with the proper title (https://github.com/woocommerce/woocommerce-blocks/pull/8045)
* Make each Bundle Analzyer report open in new tab with the proper title
2022-12-29 17:00:30 +01:00
Stian 056e9bf73f Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme() (https://github.com/woocommerce/woocommerce-blocks/pull/7496) 2022-12-29 13:14:00 +01:00
Rodrigo Primo 077c8fa3ff PHP 8.2: fix "Using ${var} in strings is deprecated, use {$var} instead" (https://github.com/woocommerce/woocommerce-blocks/pull/7782)
PHP 8.2 deprecated using ${var} in strings
(https://kinsta.com/blog/php-8-2/#deprecate--string-interpolation). {$var}
should be used instead. This commit fixes the occurrences of ${var} in
woocommerce-blocks to prepare for the next version of PHP which is
scheduled to be released early in December.

I found this in the context of testing MailPoet with PHP 8.2. I'm not
familiar with the woocommerce-blocks so I might be missing something. I did
not test the changes in this commit.
2022-12-29 13:13:15 +01:00
Albert Juhé Lluveras 78d8f1a626 9.1.1 testing steps: move testing steps for PR woocommerce/woocommerce-blocks#7909 and woocommerce/woocommerce-blocks#7914 under 'Feature plugin' (https://github.com/woocommerce/woocommerce-blocks/pull/8042) 2022-12-29 09:42:23 +01:00
Saad Tarhi 230606c7f7 Highlight incompatible payment gateways (https://github.com/woocommerce/woocommerce-blocks/pull/7412)
* Set up incompatiblePaymentMethods in data store

* Save incompatible payment methods in data store

* Create the IncompatibilityPaymentGatewaysNotice

* Fix hidden notice bug

* Rename "paymentAdminLink" to GlobalPaymentMethod and move to types dir

* Add all registered methods to incompatiblePaymentMethods state

* Rename selector to getIncompatiblePaymentMethods

* Remove incompatible methods when adding available ones

* Remove unused reducer cases

* Stop adding incompatible methods now that we add them in default state

* Display incompatible methods in the notice from the data store

* Refactor incompatible payment gateways notice

* Update the incompatible extensions notice's design

* Hide Make as default notice

We hide this notice while the notification for incompatible payment
gateways is visible

* Hide the sidebar compatibility notice

Hide this notice while  the notification for incompatible payment
gateways is visible. And show it otherwise.

* Capitalize the label for the button on the page settings notice

* Fix missing 'globalPaymentMethods' bug on frontend

* Highlight incompatible payments in sidebar

Highlight incompatible payment gateways within the Payment Options Block

* Rename the incompatible gateways notice's component

* Support plural and singular forms for the notice

* Update incompatible extensions notice's design

* Use the simplified types import

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

* Add translation support to notice message

* Fix failing unit tests

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-12-28 17:30:46 +01:00
kmanijak 32119dc8f9 Move annotation from incorrect place to the function it describes (https://github.com/woocommerce/woocommerce-blocks/pull/8023)
* Move annotation from incorrect place to the function it described
2022-12-28 16:17:04 +01:00
kmanijak 1bb1ad5f40 Display "Add review" link if there's no product rating (https://github.com/woocommerce/woocommerce-blocks/pull/7929)
* Display Add Review link in the All Products if there's no product rating in All Products and Products

* Apply the font-size mixin to the Add Review link

* Make Add review link NOT clickable in editor

* Improve styles of Rating component so they support alignment in product grids
2022-12-28 14:24:43 +01:00
Seghir Nadir 2c6694551a Revert push changes validation check (https://github.com/woocommerce/woocommerce-blocks/pull/8029)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-12-28 12:54:03 +01:00
Paulo Arromba 586e8ea884 Fix dev version strings (https://github.com/woocommerce/woocommerce-blocks/pull/8038) 2022-12-27 15:51:00 +00:00
Niels Lange 6bfd2b9c8f Convert product-elements/button to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/8003)
* Convert product-elements/button to TypeScript

* Fix TS errors

* Fix TS errors

* Update assets/js/atomic/blocks/product-elements/button/attributes.ts

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>

* Import BlockAttributes from @wordpress/blocks as type

* Solve TS error

* Move BlockAttributes interface to increase readability

* Fix TS error

* Simplify TS declaration

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-12-23 23:01:16 +07:00
Niels Lange 63bb47bb3d Convert product-elements/price to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7683)
* Convert product-element/price to TypeScript

* Apply feedback from woocommerce/woocommerce-blocks#7095 to this PR

* Export block due to Cross-Sells dependency

* Update assets/js/atomic/blocks/product-elements/price/edit.tsx

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

* bot: update checkstyle.xml

* Apply review feedback

* Outsource supports section

* bot: update checkstyle.xml

* Resolve merge conflicts

* bot: update checkstyle.xml

* Solve TS error in cart-cross-sells-product.tsx

* bot: update checkstyle.xml

* Solve TS error regarding min_amount and max_amount

* bot: update checkstyle.xml

* Empty-Commit

* Fix TS problems in product-elements/price/block.tsx

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Resolve merge conflicts

* Convert product-element/price to TypeScript

* Apply feedback from woocommerce/woocommerce-blocks#7095 to this PR

* Export block due to Cross-Sells dependency

* Apply review feedback

* Update assets/js/atomic/blocks/product-elements/price/edit.tsx

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Solve TS error in cart-cross-sells-product.tsx

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Solve TS error regarding min_amount and max_amount

* Empty-Commit

* bot: update checkstyle.xml

* Fix TS problems in product-elements/price/block.tsx

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Solve TS errors

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Empty checkstyle.xml

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Use BlockAttributes from @wordpress/blocks

* Fix TS error

* Fix TS errors

* Fix TS error

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-23 22:30:10 +07:00
Niels Lange 46f0330a0a Use Woo Blocks instead Woo core translation within the Checkout order Summary block (https://github.com/woocommerce/woocommerce-blocks/pull/7995)
* Use Woo Blocks instead Woo core translation

* Activale previously skipped e2e tests

* Adjust loading order of $shared_chunks, $vendor_chunks and $chunks

* Revert chunk order of MiniCart.php
2022-12-23 19:54:04 +07:00
Niels Lange aae39f5266 Simplify @woocommerce/types imports (https://github.com/woocommerce/woocommerce-blocks/pull/8019)
* Simplify @woocommerce/types imports

* Fix TS errors
2022-12-23 18:59:02 +07:00
Alba Rincón f9dd42a36a Add `Customer account` to patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7944)
* Render the block in the frontend

* Add icon style selector to Display settings

This adds an icon style selector in which users can choose the customer account link icon.

* Display on the frontend depending on the icon style

* Rename attributes

* Refactor block rendering

* Improve styling

* Add link to account settings

* Split css file

* Switch to SSR

* Add customer account block to header patterns

* Add customer account block to footer patterns

* Adapt minimal header to designs

* Adapt large header to designs

* Adapt header patterns to new designs and format code

* Adapt footer patterns to the designs

* Change display style for the essential header

* Increase alt icon size

* Make the icon resize with the label

* Adjust icon size on headers

* Add padding and move second row to the right

* Remove unused enum

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2022-12-23 10:08:44 +01:00
Mike Jolley fdbe4e7c54 Remove legacy handling on the PHP side (https://github.com/woocommerce/woocommerce-blocks/pull/7978) 2022-12-22 17:04:54 +01:00
Luigi Teschio 0dd980998c Update @wordpress/e2e-test-utils package (https://github.com/woocommerce/woocommerce-blocks/pull/7955) 2022-12-22 16:47:23 +01:00
Alba Rincón a223af0ad5 Add 'Customer Account' block (https://github.com/woocommerce/woocommerce-blocks/pull/7876)
* Add empty 'Customer Account' block

* Add edit to render the block on the editor

* Add Customer Account icon to @woocommerce/icons library

This icon is used in the Customer Account block.

* Use customerAccount icon in the Customer Account block

* Add Block Settings to Customer Account block

Add Typography and Color settings to the Customer Account block that can be used during Edit mode.

* Add Customer Account style icons

This adds the customer account style icons to be used by the customer account block.

* Render the block in the frontend

* Add Display setting to the Customer Account block

This setting allow users to choose if they want to include an icon with the customer account link.

* Add icon style selector to Display settings

This adds an icon style selector in which users can choose the customer account link icon.

* Display on the frontend depending on the icon style

* Rename attributes

* Refactor block rendering

* Improve styling

* Make the account link dynamic

* Add alignment menu

* Get dashboardUrl with getSettings and add fallback

* Add link to account settings

* Add tests

* Fix test

* Change display title

* Split css file

* Switch to SSR

* Add styles to the front end

* Address latest feedback

* Remove experimental flag

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2022-12-22 16:01:01 +01:00
Luigi Teschio d6b3b26c01 Mini Cart block - added notice support (https://github.com/woocommerce/woocommerce-blocks/pull/7234)
* Mini Cart block - added notice support woocommerce/woocommerce-blocks#6941

Mini Cart block - added notice support

* set isDismissible to true

* address feedback

* improve layout

* fix style and update close button label

* fix UI when the admin bar is visible

* Split out dismissible notices

* fix css

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-22 15:48:24 +01:00
Mike Jolley 637f47cac7 Refactor View Switcher to use Block Attributes (https://github.com/woocommerce/woocommerce-blocks/pull/8006)
* Add cart view switcher

* Attribute based switched POC

* Tidy up view handling

* Mini cart

* Not sure who clint is. Typo - rename to clientId

* Avoid string casting in TS

* Add margin to title

* Set custom source to prevent currentView saving to post content.

Note this also removes `save` which does not exist in Gutenberg.

* Remove higher order component from withViewSwitcher

* Import view switcher in main file

* Add to side effects

* Move view switcher import

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2022-12-22 14:35:24 +00:00
Mike Jolley ece76603bb Split out dismissible notices (https://github.com/woocommerce/woocommerce-blocks/pull/8018) 2022-12-22 14:15:33 +00:00
Luigi 33c41f3493 Merge branch 'release/9.1.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-12-22 10:22:05 +01:00
github-actions[bot] 2b29e63375 Release: 9.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/8011)
* Empty commit for release pull request

* Update the readme file with 9.1.1 release changes

* Product Query: Add `Sorted by title` preset. (https://github.com/woocommerce/woocommerce-blocks/pull/7949)

* Add `Sort by title` preset.

* sorted, thanks @nerrad

* Update the readme file with woocommerce/woocommerce-blocks#7949 changes

* 9.1.1 Release: Add testing docs

* Atomic Block: fix ancestor definition (https://github.com/woocommerce/woocommerce-blocks/pull/7947)

* Fix the incorrect layout of Rating and Price in Classic Template and Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7932)

* Fix the incorrect layout of Rating and Price in Classic Template

There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block

* Add dropdown version of Filter by Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7831)

* Extend Filter by Stock Editor options with dropdown and single/multiple choice

* Add dropdown implementation for Filter by Stock Status

* Adjust font-sizes to the rest of the filters

* Add tests to Filter by Stock: dropdown and list variants

* Change test file extension from .js to .tsx, so it handles types as well

* Add E2E test to Filter by Stock checking if display style can be toggled

* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions

* Change the name of the filter blocks in the test files

* Remove unnecessary waiting step in E2E test for Filter by Stock

toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed

* Improve the STOCK_STATUS_OPTIONS type handling

* Extract onDropdownChange function instead of inline arrow function

* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single

* Product Query: Add patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7857)

* Product Query: First attempt at adding patterns

* Product Query: Update patterns and the default block template

* Product Query: And new and update existing patterns

* Product Query: Adjust layout of the Minimal Product Row pattern

* Product Query: Update pattern names

* Product Query: Polish spaces between blocks inside the patterns

* Product Query patterns: Link product titles and improve spacing between product elements

* Product Query patterns: Button font-size update

* Product Query patterns: Center the pagination

* Product Query patterns: Center the pagination for the default pattern

* Product Query patterns: Remove an empty column

* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern

* Add dropdown version of Filter by Rating (https://github.com/woocommerce/woocommerce-blocks/pull/7771)

* Rename the setting section to match Filter by Attribute

* Add Display Style toggle to the block settings

* Set list as a default value of displayStyle for Filter by Rating

* Add dropdown variant of Filter by Rating

* Extend the Editor settings with selectType: single or multiple

* Adjust the styles of a FormTokenField to other dropdown

* Align Editor settings order and wording between Filter by Attribute and Rating

* Fix the issue with cut off corners of dropdown borders

* Provide translated screen reader messages and placeholder

* Revert the label property, which is necessary to display checkbox list

* Make classname for Rating component optional and remove styling in Filter by Rating

* Cover the case when filter with zero products needs string methods for comparison

* Handle Typescript errors and add ts-ignore annotations when necessary

* Remove explicit key prop assignment in Rating component

* Remove leftover property in type definition

* Refactor JSX element extension with custom properties to more robust way with object copy

* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)

* Filter by Rating tests:
  - List single
  - List multiple
  - Dropdown single
  - Dropdown multiple

* Adjust the font-size of Filter by Rating dropdown to the rest of the filters

* Fix E2E tests after the Editor settings label has been changed

* Improve sorting in Filter by Rating dropdown

With this change the order of options is always descending: in the chips, suggestions, active filters and URL

* Change the name of the filter blocks in the test files

* Prevent single dropdown input to overflow the wrapper

The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css

* Remove the unused styles of active options in Filter by Rating

Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then

* Change the approach of shared styles to fix the dropdown issue in filters

Instead of using direct classes, rewrite it to mixin and include in the filters

* Fix the Filter by Rating with Products block

The problem was with the Products block, that there was incorrect initial value of product ratings query

* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* Product Query - Enable "Inherit Query from template" option (https://github.com/woocommerce/woocommerce-blocks/pull/7641)

* Add Inherit Query from template option

* Update label

* Product Elements: Fix block settings (https://github.com/woocommerce/woocommerce-blocks/pull/7914)

* Product Elements: Fix block settings

* Rating: Fix inactive star color

* Product Rating: Fix color inheritance

* StyleAttributesUtils: Fix PHP notices and invalid CSS output (https://github.com/woocommerce/woocommerce-blocks/pull/7909)

* StyleAttributesUtils: Fix PHP notices and invalid CSS output. Closes woocommerce/woocommerce-blocks#7899.

* StyleAttributesUtils: Fix border radius and width support

* StyleAttributesUtils: Fix border radius and border color support

* StyleAttributesUtils: Include additional checks to deal with PHP warnings

* StyleAttributesUtils: Improve the custom border array check

* Update MiniCart.php to fix price total amount on page load prices are including tax (https://github.com/woocommerce/woocommerce-blocks/pull/7832)

* Update MiniCart.php

Added an update to the '$cart_contents_total' variable on the 'get_cart_price_markup' function if $cart->display_prices_including_tax is active. Currently displaying wrong amount total on page load if items are already in the basket.

* Update MiniCart.php

Removed white spaces?

* Update MiniCart.php

Fixed IF statement

* Remove whitespace at end of line

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

* Product Query: implement compatibility with Filter by Rating block (https://github.com/woocommerce/woocommerce-blocks/pull/7792)

* Product Query: implement compatibility with Filter by Rating block woocommerce/woocommerce-blocks#7631

Product Query: implement compatibility with Filter by Rating block

* address feedback

* address feedback

* add comment

* add new zip file link

* add missing class

* add testing instructions about woocommerce/woocommerce-blocks#7947

* add new zip file link

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

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

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

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

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

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

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

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

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

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

* Bumping version strings to new version.

* Remove feature flag from Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8001)

* Remove feature flag from Products block

* Remove Products block from feature flags documentation

* Empty commit for release pull request

* Update changelog

* Add zip file link

* Bumping version strings to new version.

* Enable Product SKU and Product Stock Indicator in Core (https://github.com/woocommerce/woocommerce-blocks/pull/8009)

* Update changelog

* Update changelog

* Empty commit for release pull request

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Luke O'Regan <oregan.luke@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-12-22 10:19:31 +01:00
Niels Lange ec334678d0 Convert product-elements/rating to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7540)
* Convert product-elements/rating to TypeScript

* bot: update checkstyle.xml

* Import decleration type only

* Rebase against trunk

* Interim TS fixes

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Fix TS error

* Fix TS error

* Fix TS errors

* Use BlockAttributes from @wordpress/blocks

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-22 14:23:11 +07:00
Tung Du b3ea73f3bb Revert woocommerce/woocommerce-blocks#7504 for ProductButton.php to avoid loading unnecessary JS files (https://github.com/woocommerce/woocommerce-blocks/pull/7966) 2022-12-22 09:05:54 +07:00
Tung Du da4221a9a7 Fix: workflows using comment-aggregator are failing on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/8010) 2022-12-21 23:30:25 +07:00
github-actions[bot] 753d3478d9 Release: 9.1.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8004)
* Empty commit for release pull request

* Update the readme file with 9.1.1 release changes

* Product Query: Add `Sorted by title` preset. (https://github.com/woocommerce/woocommerce-blocks/pull/7949)

* Add `Sort by title` preset.

* sorted, thanks @nerrad

* Update the readme file with woocommerce/woocommerce-blocks#7949 changes

* 9.1.1 Release: Add testing docs

* Atomic Block: fix ancestor definition (https://github.com/woocommerce/woocommerce-blocks/pull/7947)

* Fix the incorrect layout of Rating and Price in Classic Template and Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7932)

* Fix the incorrect layout of Rating and Price in Classic Template

There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block

* Add dropdown version of Filter by Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7831)

* Extend Filter by Stock Editor options with dropdown and single/multiple choice

* Add dropdown implementation for Filter by Stock Status

* Adjust font-sizes to the rest of the filters

* Add tests to Filter by Stock: dropdown and list variants

* Change test file extension from .js to .tsx, so it handles types as well

* Add E2E test to Filter by Stock checking if display style can be toggled

* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions

* Change the name of the filter blocks in the test files

* Remove unnecessary waiting step in E2E test for Filter by Stock

toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed

* Improve the STOCK_STATUS_OPTIONS type handling

* Extract onDropdownChange function instead of inline arrow function

* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single

* Product Query: Add patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7857)

* Product Query: First attempt at adding patterns

* Product Query: Update patterns and the default block template

* Product Query: And new and update existing patterns

* Product Query: Adjust layout of the Minimal Product Row pattern

* Product Query: Update pattern names

* Product Query: Polish spaces between blocks inside the patterns

* Product Query patterns: Link product titles and improve spacing between product elements

* Product Query patterns: Button font-size update

* Product Query patterns: Center the pagination

* Product Query patterns: Center the pagination for the default pattern

* Product Query patterns: Remove an empty column

* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern

* Add dropdown version of Filter by Rating (https://github.com/woocommerce/woocommerce-blocks/pull/7771)

* Rename the setting section to match Filter by Attribute

* Add Display Style toggle to the block settings

* Set list as a default value of displayStyle for Filter by Rating

* Add dropdown variant of Filter by Rating

* Extend the Editor settings with selectType: single or multiple

* Adjust the styles of a FormTokenField to other dropdown

* Align Editor settings order and wording between Filter by Attribute and Rating

* Fix the issue with cut off corners of dropdown borders

* Provide translated screen reader messages and placeholder

* Revert the label property, which is necessary to display checkbox list

* Make classname for Rating component optional and remove styling in Filter by Rating

* Cover the case when filter with zero products needs string methods for comparison

* Handle Typescript errors and add ts-ignore annotations when necessary

* Remove explicit key prop assignment in Rating component

* Remove leftover property in type definition

* Refactor JSX element extension with custom properties to more robust way with object copy

* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)

* Filter by Rating tests:
  - List single
  - List multiple
  - Dropdown single
  - Dropdown multiple

* Adjust the font-size of Filter by Rating dropdown to the rest of the filters

* Fix E2E tests after the Editor settings label has been changed

* Improve sorting in Filter by Rating dropdown

With this change the order of options is always descending: in the chips, suggestions, active filters and URL

* Change the name of the filter blocks in the test files

* Prevent single dropdown input to overflow the wrapper

The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css

* Remove the unused styles of active options in Filter by Rating

Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then

* Change the approach of shared styles to fix the dropdown issue in filters

Instead of using direct classes, rewrite it to mixin and include in the filters

* Fix the Filter by Rating with Products block

The problem was with the Products block, that there was incorrect initial value of product ratings query

* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* Product Query - Enable "Inherit Query from template" option (https://github.com/woocommerce/woocommerce-blocks/pull/7641)

* Add Inherit Query from template option

* Update label

* Product Elements: Fix block settings (https://github.com/woocommerce/woocommerce-blocks/pull/7914)

* Product Elements: Fix block settings

* Rating: Fix inactive star color

* Product Rating: Fix color inheritance

* StyleAttributesUtils: Fix PHP notices and invalid CSS output (https://github.com/woocommerce/woocommerce-blocks/pull/7909)

* StyleAttributesUtils: Fix PHP notices and invalid CSS output. Closes woocommerce/woocommerce-blocks#7899.

* StyleAttributesUtils: Fix border radius and width support

* StyleAttributesUtils: Fix border radius and border color support

* StyleAttributesUtils: Include additional checks to deal with PHP warnings

* StyleAttributesUtils: Improve the custom border array check

* Update MiniCart.php to fix price total amount on page load prices are including tax (https://github.com/woocommerce/woocommerce-blocks/pull/7832)

* Update MiniCart.php

Added an update to the '$cart_contents_total' variable on the 'get_cart_price_markup' function if $cart->display_prices_including_tax is active. Currently displaying wrong amount total on page load if items are already in the basket.

* Update MiniCart.php

Removed white spaces?

* Update MiniCart.php

Fixed IF statement

* Remove whitespace at end of line

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

* Product Query: implement compatibility with Filter by Rating block (https://github.com/woocommerce/woocommerce-blocks/pull/7792)

* Product Query: implement compatibility with Filter by Rating block woocommerce/woocommerce-blocks#7631

Product Query: implement compatibility with Filter by Rating block

* address feedback

* address feedback

* add comment

* add new zip file link

* add missing class

* add testing instructions about woocommerce/woocommerce-blocks#7947

* add new zip file link

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

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

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

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

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

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

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

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

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

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

* Bumping version strings to new version.

* Remove feature flag from Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8001)

* Remove feature flag from Products block

* Remove Products block from feature flags documentation

* Empty commit for release pull request

* Update changelog

* Add zip file link

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Luke O'Regan <oregan.luke@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-12-21 16:49:22 +01:00
Luigi Teschio a6c30f3c70 Enable Product SKU and Product Stock Indicator in Core (https://github.com/woocommerce/woocommerce-blocks/pull/8009) 2022-12-21 16:45:43 +01:00
Tung Du 0a026ed81c Create merge comments action (https://github.com/woocommerce/woocommerce-blocks/pull/7973) 2022-12-21 22:24:01 +07:00
Tarun Vijwani 7a4fa29f0c Convert Reviews component to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7936)
* Convert review-sort-select to TS.

* Convert review-list and review-list-item to TS.

* Fix reviewer_avatar_urls type

* Fix TypeScript errors

* Fix TypeScript errors in frontend-block.js

* Update assets/js/base/components/reviews/review-sort-select/index.tsx

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* Update assets/js/base/components/reviews/types.ts

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* fix Review type and remove index file details

* fix ReviewSortSelect component 'value' prop type

* fix typo

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-12-21 17:09:48 +04:00
Albert Juhé Lluveras 101034c4f0 Remove feature flag from Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8001)
* Remove feature flag from Products block

* Remove Products block from feature flags documentation
2022-12-21 12:16:48 +01:00
Albert Juhé Lluveras 86604e8945 Rename configurateFilterProductsByAttributeBlock() to configureAttributeFilterBlock() (https://github.com/woocommerce/woocommerce-blocks/pull/7970)
* Rename configurateFilterProductsByAttributeBlock() to configurateFilterByAttributeBlock()

* Rename configurateFilterProductsByAttributeBlock() to configureAttributeFilterBlock()
2022-12-20 17:19:20 +01:00
Albert Juhé Lluveras 77b08b6ed3 Remove opinionated styles from Button component on TT3 and Zaino themes (https://github.com/woocommerce/woocommerce-blocks/pull/7992)
* Add Mini Cart button styles to Button component

* Add wp-element-button class to Button component

* Don't load opinionated button styles in TT3 and Zaino

* Remove bold styles from Mini Cart buttons
2022-12-20 16:02:12 +01:00
Alex Florisca 828ba01142 Bump version strings to 9.2.0-dev 2022-12-20 12:01:22 +00:00
github-actions[bot] 29dae38ba3 Release: 9.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7977)
* Empty commit for release pull request

* Update readme.txt

* Update WC versions

* Testing instructions for release 9.2.0

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-12-20 11:41:14 +00:00
Mike Jolley 9e00b015fc New contexts for `StoreNoticesContainer` and notice grouping (https://github.com/woocommerce/woocommerce-blocks/pull/7711)
* Refactor Store Notices

Move snackbar hiding filter before notice creation

Implements showApplyCouponNotice

Refactor context providers

Use STORE_NOTICE_CONTEXTS

use refs to track notice containers

Refactor ref usage

Use existing noticeContexts

* Move new notice code to checkout package

* Combine store and snackbars

* Update noticeContexts imports

* Remove context provider

* Update data store

* Fix 502

* Add new error contexts

* Force types

* Unnecessary reorder of imports

* Fix global handling

* Document forceType

* Optional props are undefined

* Remove function name

* Missing condition

* Remove context prop

* Define ACTION_TYPES

* Remove controls

* Update assets/js/base/context/event-emit/utils.ts

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

* CONTACT_INFORMATION

* Remove ref from registerContainer

* Abstract container locating methods

* pass context correctly when displaying notices

* Remove debugging buttons

* Update filter usage - remove useMemo so filter can work inline

* Refactor existing error notices from the API (https://github.com/woocommerce/woocommerce-blocks/pull/7728)

* Update API type defs

* Move create notice utils

* Replace useCheckoutNotices with new contexts

* processCheckoutResponseHeaders should check headers are defined

* Scroll to error notices only if we're not editing a field

* Error handling utils

* processErrorResponse when pushing changes

* processErrorResponse when processing checkout

* remove formatStoreApiErrorMessage

* Add todo for cart errors

* Remove unused deps

* unused imports

* Fix linting warnings

* Unused dep

* Update assets/js/types/type-defs/api-response.ts

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

* Add todo

* Use generic

* remove const

* Update array types

* Phone should be in address blocks

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

* Update store name to wc/store/store-notices

* Fix assertResponseIsValid

* Funnel woocommerce_rest_invalid_email_address to the correct place

* woocommerce_rest_missing_email_address

* Move comments around

* Move data back into const

* Spacing

* Remove spacing

* Remove forced snack bar and styling

* Move notices within wrapper

* Remove type

* hasStoreNoticesContainer rename

* Group by status/context

* Remove global context

* Remove white space

* remove changes to simplify diff

* white space

* Move comment to typescript

* List style

* showApplyCouponNotice docs

* See if scrollIntoView exists

* fix notice tests

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-12-19 15:30:13 +00:00
Alba Rincón 5b095eb1a2 Fix overriding `archive-product` when saving a fallback template (https://github.com/woocommerce/woocommerce-blocks/pull/7975)
* Fix overriding archive-product when saving a fallback template

* Add comment
2022-12-19 15:31:00 +01:00
Niels Lange 7dfced254a Respect core settings for showing the Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/7883)
* Respect core settings for showing the Checkout block

* Add account creation option from core to checkout context provider

* Fix TS errors

* Adjust display logic of <LoginPrompt />

* Update assets/js/blocks/checkout/block.tsx

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

* Rename <LoginPrompt> to <MustLoginPrompt>

* Show space between login text and login link

* Fix TS error

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-19 21:19:52 +07:00
Tung Du b02b7f9348 Product Query: Add product visibility query support (https://github.com/woocommerce/woocommerce-blocks/pull/7951) 2022-12-19 21:05:16 +07:00
Mike Jolley e22d6e7fcf Remove country and state autocomplete fields (https://github.com/woocommerce/woocommerce-blocks/pull/7953) 2022-12-19 12:26:02 +00:00
Mike Jolley 0e1b05b92a Update MD editor config (https://github.com/woocommerce/woocommerce-blocks/pull/7968)
* Remove MD from editor config. Prettier handles formatting.

* Resave docs

* Update MD files
2022-12-19 12:06:48 +00:00
Thomas Roberts ebe05700ab Add notice on quantity change and update `wc/store/cart` to use thunks (https://github.com/woocommerce/woocommerce-blocks/pull/7938)
* Add receiveCart thunk

* Add mapCartResponseToCart helper

* Add getItemsPendingQuantityUpdate selector

* Update cart resolvers to be thunks

* Remove RECEIVE_CART action and replace with SET_CART_DATA

receiveCart will turn into a thunk.

* Add notifyQuantityChanges functions

* Remove receiveCart from action type definition, replace with setCartData

* Move apiFetchWithHeaders out of controls

This will just be a normal function since we'll be updating actions to thunks which will use this instead of a control.

* Include thunks in actions file

* Update receiveCart action to setCartData

* Update applyCoupon action to a thunk

* Update useStoreCartCoupons to get action from correct place

* Update StoreCartCoupon types

* Add types for Thunk and ThunkReturnType in mapped-types

* Change applyCoupon to a thunk

* Get applyCoupon, removeCoupon, receiveApplyingCoupon from useDispatch

This is to separate the concerns of actions vs. selectors. Previously the actions were fetched during useSelect which is not a pattern we use anywhere else in the codebase. Since we updated the MapToDispatch type, we can now get correctly typed thunks from the data store.

* Improve apiFetchWithHeaders typings

* Convert removeCoupon from generator to thunk

* Add applyCoupon and removeCoupon to CartAction type

* Remove unused old-style type-def

* Add receiveApplyingCoupon & receiveRemovingCoupon to StoreCartCoupon

* Correct issues with StoreCartCoupon type

These were not intended to reflect the actions in data store, rather the functions offered by the useStoreCartCoupons hook.

* Update applyExtensionCartUpdate to a thunk

* Update addItemToCart to thunk

* Add ResolveSelectFromMap type that works with thunks

* Add CartDispatchFromMap and CartResolveSelectFromMap types

We can add this to all data stores to get them working with thunks properly.

* Add docs and update generic name in ResolveSelectFromMap

* Add correct types for thunk resolvers in cart data store

* Update removeItemFromCart to thunk

* Update apiFetchWithHeaders to use generic

* Update selectShippingRate to thunk

* Update resolver tests to test correct thunk functionality

* Update updateCustomerData to thunk

* Update reducer test to reflect new action name

* Update comments on CartDispatchFromMap and CartResolveSelectFromMap

* Add quantity_limits to preview cart

* Make notices speak when shown

* Remove copilot comment

* Add isWithinQuantityLimits function

This is because we shouldn't show a notice if the quantity limits change, but the item's quantity is still OK.

* Add tests for notifyQuantityChanges

* Show notice when multiple_of is updated

* Update test to test for multiple_of changes

* Remove empty export

* Remove controls from cart data store

Not needed anymore since the exported value from the shared-controls file was empty.

* Export a control and async function for apiFetchWithHeaders

This is required because async functions cannot be called from sync generators.

* Use control version of apiFetchWithHeaders in the collections store

* Improve comments and remove incorrect TypeScript

* Update assets/js/data/cart/actions.ts

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

* Update ResolveSelectFromMap to include selectors too

* Update TS in actions

* Use finally to remove duplicate code

* remove item pending delete/qty update after action runs in all cases

This will also reset the state when the request to remove it/change quantity errors

* Remove unnecessary type from param.

Not needed because we have TS now. The description can stay though, it is useful.

* Update snackbar wording to use active voice

* Remove old WP version check

* Set max quantity to high number instead of null

This would only happen in a niche case, and would require several TS changes to fix, so it's better to set it as a number here. 9999 should be high enough, and is the default quantity limit set below in get_product_quantity_limit

* Set code on woocommerce_rest_cart_invalid_key to 409

This is so the cart is returned in the response, so the client can update.

* Fix typo in comment and add CartSelectFromMap

* Remove unnecessary docblock

* Add getItemsPendingDelete selector

This is needed so we can show a notice for items that are unexpectedly removed from the cart. We need to know which ones are pending delete so we can skip showing the notice for them.

* Add type for notifyQuantityChanges args and change args to object

* Add notifyIfRemoved function

This will check items that have been removed and show a notice for them.

* Fix TS in receiveCart & pass itemsPendingDelete to notifyQuantiyChanges

* Update wording on removal notice

* Update types for notifyQuantityChanges args

* Update tests to reflect new wording and args being an object

* Check item is truth before running comparison of keys

* Update tests for unexpectedly and expectedly removed items

* Ignore print_r to satisfy phpcs

* Update PHP tests to reflect correct response code when deleting items

* Remove unnecessary controls and dispatch events directly from thunk

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-16 08:06:37 -08:00
kmanijak 6ea35ccc93 Remove Legacy Webpack Configs along with FallbackModuleDirectoryWebpackPlugin (https://github.com/woocommerce/woocommerce-blocks/pull/7961) 2022-12-16 12:00:06 +01:00
Mike Jolley 5625ea46cd Correct data table (https://github.com/woocommerce/woocommerce-blocks/pull/7935) 2022-12-16 10:23:58 +00:00
Tarun Vijwani ee2adeb994 Convert cart-checkout/totals/shipping component to TypeScript. (https://github.com/woocommerce/woocommerce-blocks/pull/7881)
* Convert cart-checkout/totals/shipping component to TypeScript.

* Change hasRates tyep to boolean and fix renderOption type

* fix type for renderOption in ShippingRatesControlProps
2022-12-15 18:45:17 +04:00
Seghir Nadir b58c5beb3e Handle multiple packages coming from slots (https://github.com/woocommerce/woocommerce-blocks/pull/7829)
* Handle multiple packages coming from slots

* fix missing prop

* fix typo

* remove collapse param

* rename trinary to ternary
2022-12-15 15:17:22 +01:00
Luigi Teschio e71a2fdbb0 Filter By Stock: Add E2E for the Product Query Block (https://github.com/woocommerce/woocommerce-blocks/pull/7937) 2022-12-15 14:36:54 +01:00
Niels Lange 0cd069e9ee Remove account creation setting from Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/7941)
* Remove account creation setting from Checkout block

* Add CartCheckoutFeedbackPrompt

* Adjust e2e test
2022-12-15 18:13:28 +07:00
Niels Lange 36b37458e8 Make place order button editable (https://github.com/woocommerce/woocommerce-blocks/pull/7843)
* WIP: Make place order editable

* Remove obsolete undefined

* Wrap <ReturnToCartButton> within <Noninteractive>

* Rename const from submitButtonText to paymentMethodButtonLabel

* Simplify defaultValue logic
2022-12-15 17:28:23 +07:00
Luigi c86502ecff Merge branch 'release/9.1.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-12-15 10:09:40 +01:00
github-actions[bot] 0fde3c761f Release: 9.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7948)
* Empty commit for release pull request

* Update the readme file with 9.1.1 release changes

* Product Query: Add `Sorted by title` preset. (https://github.com/woocommerce/woocommerce-blocks/pull/7949)

* Add `Sort by title` preset.

* sorted, thanks @nerrad

* Update the readme file with woocommerce/woocommerce-blocks#7949 changes

* 9.1.1 Release: Add testing docs

* Atomic Block: fix ancestor definition (https://github.com/woocommerce/woocommerce-blocks/pull/7947)

* Fix the incorrect layout of Rating and Price in Classic Template and Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7932)

* Fix the incorrect layout of Rating and Price in Classic Template

There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block

* Add dropdown version of Filter by Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7831)

* Extend Filter by Stock Editor options with dropdown and single/multiple choice

* Add dropdown implementation for Filter by Stock Status

* Adjust font-sizes to the rest of the filters

* Add tests to Filter by Stock: dropdown and list variants

* Change test file extension from .js to .tsx, so it handles types as well

* Add E2E test to Filter by Stock checking if display style can be toggled

* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions

* Change the name of the filter blocks in the test files

* Remove unnecessary waiting step in E2E test for Filter by Stock

toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed

* Improve the STOCK_STATUS_OPTIONS type handling

* Extract onDropdownChange function instead of inline arrow function

* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single

* Product Query: Add patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7857)

* Product Query: First attempt at adding patterns

* Product Query: Update patterns and the default block template

* Product Query: And new and update existing patterns

* Product Query: Adjust layout of the Minimal Product Row pattern

* Product Query: Update pattern names

* Product Query: Polish spaces between blocks inside the patterns

* Product Query patterns: Link product titles and improve spacing between product elements

* Product Query patterns: Button font-size update

* Product Query patterns: Center the pagination

* Product Query patterns: Center the pagination for the default pattern

* Product Query patterns: Remove an empty column

* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern

* Add dropdown version of Filter by Rating (https://github.com/woocommerce/woocommerce-blocks/pull/7771)

* Rename the setting section to match Filter by Attribute

* Add Display Style toggle to the block settings

* Set list as a default value of displayStyle for Filter by Rating

* Add dropdown variant of Filter by Rating

* Extend the Editor settings with selectType: single or multiple

* Adjust the styles of a FormTokenField to other dropdown

* Align Editor settings order and wording between Filter by Attribute and Rating

* Fix the issue with cut off corners of dropdown borders

* Provide translated screen reader messages and placeholder

* Revert the label property, which is necessary to display checkbox list

* Make classname for Rating component optional and remove styling in Filter by Rating

* Cover the case when filter with zero products needs string methods for comparison

* Handle Typescript errors and add ts-ignore annotations when necessary

* Remove explicit key prop assignment in Rating component

* Remove leftover property in type definition

* Refactor JSX element extension with custom properties to more robust way with object copy

* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)

* Filter by Rating tests:
  - List single
  - List multiple
  - Dropdown single
  - Dropdown multiple

* Adjust the font-size of Filter by Rating dropdown to the rest of the filters

* Fix E2E tests after the Editor settings label has been changed

* Improve sorting in Filter by Rating dropdown

With this change the order of options is always descending: in the chips, suggestions, active filters and URL

* Change the name of the filter blocks in the test files

* Prevent single dropdown input to overflow the wrapper

The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css

* Remove the unused styles of active options in Filter by Rating

Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then

* Change the approach of shared styles to fix the dropdown issue in filters

Instead of using direct classes, rewrite it to mixin and include in the filters

* Fix the Filter by Rating with Products block

The problem was with the Products block, that there was incorrect initial value of product ratings query

* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* Product Query - Enable "Inherit Query from template" option (https://github.com/woocommerce/woocommerce-blocks/pull/7641)

* Add Inherit Query from template option

* Update label

* Product Elements: Fix block settings (https://github.com/woocommerce/woocommerce-blocks/pull/7914)

* Product Elements: Fix block settings

* Rating: Fix inactive star color

* Product Rating: Fix color inheritance

* StyleAttributesUtils: Fix PHP notices and invalid CSS output (https://github.com/woocommerce/woocommerce-blocks/pull/7909)

* StyleAttributesUtils: Fix PHP notices and invalid CSS output. Closes woocommerce/woocommerce-blocks#7899.

* StyleAttributesUtils: Fix border radius and width support

* StyleAttributesUtils: Fix border radius and border color support

* StyleAttributesUtils: Include additional checks to deal with PHP warnings

* StyleAttributesUtils: Improve the custom border array check

* Update MiniCart.php to fix price total amount on page load prices are including tax (https://github.com/woocommerce/woocommerce-blocks/pull/7832)

* Update MiniCart.php

Added an update to the '$cart_contents_total' variable on the 'get_cart_price_markup' function if $cart->display_prices_including_tax is active. Currently displaying wrong amount total on page load if items are already in the basket.

* Update MiniCart.php

Removed white spaces?

* Update MiniCart.php

Fixed IF statement

* Remove whitespace at end of line

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

* Product Query: implement compatibility with Filter by Rating block (https://github.com/woocommerce/woocommerce-blocks/pull/7792)

* Product Query: implement compatibility with Filter by Rating block woocommerce/woocommerce-blocks#7631

Product Query: implement compatibility with Filter by Rating block

* address feedback

* address feedback

* add comment

* add new zip file link

* add missing class

* add testing instructions about woocommerce/woocommerce-blocks#7947

* add new zip file link

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

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

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

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

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

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

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

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

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

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

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Luke O'Regan <oregan.luke@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-12-15 10:02:35 +01:00
Thomas Roberts fbe6b6127b Refactor `useForcedLayout` to subscribe to store changes and to batch block insertions (https://github.com/woocommerce/woocommerce-blocks/pull/7879)
* Add type for lock attribute in isBlockLocked

* Add getMissingBlocks function

* Add findBlockPosition function

* Refactor useForcedLayout to use registry batch & insert multiple blocks

* Improve comment on getMissingBlocks function
2022-12-14 07:54:59 -08:00
Tung Du 7a8cd47e65 Product Query: Add `Sorted by title` preset. (https://github.com/woocommerce/woocommerce-blocks/pull/7949)
* Add `Sort by title` preset.

* sorted, thanks @nerrad
2022-12-14 13:50:09 +01:00
Luigi Teschio 9be9e6b010 Atomic Block: fix ancestor definition (https://github.com/woocommerce/woocommerce-blocks/pull/7947) 2022-12-14 13:26:06 +01:00
kmanijak 05b1b0f32f Fix the incorrect layout of Rating and Price in Classic Template and Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7932)
* Fix the incorrect layout of Rating and Price in Classic Template

There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block
2022-12-14 08:17:19 +01:00
kmanijak 6aa8a72f8e Add dropdown version of Filter by Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7831)
* Extend Filter by Stock Editor options with dropdown and single/multiple choice

* Add dropdown implementation for Filter by Stock Status

* Adjust font-sizes to the rest of the filters

* Add tests to Filter by Stock: dropdown and list variants

* Change test file extension from .js to .tsx, so it handles types as well

* Add E2E test to Filter by Stock checking if display style can be toggled

* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions

* Change the name of the filter blocks in the test files

* Remove unnecessary waiting step in E2E test for Filter by Stock

toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed

* Improve the STOCK_STATUS_OPTIONS type handling

* Extract onDropdownChange function instead of inline arrow function

* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single
2022-12-14 08:16:37 +01:00
Niels Lange 6c40524dfe Make mini cart buttons editable (https://github.com/woocommerce/woocommerce-blocks/pull/7817)
* Make Cart and Checkout buttons editable

* Make shopping button editable

* Remove obsolete dot from the “Empty Mini Cart view” title

* Ensure to keep the existing styles

* Improve name of start shopping button label

* Prevent potential TS error
2022-12-14 13:51:16 +07:00
Mike Jolley 7e16edcf65 Revert "Bump @wordpress/notices from 3.12.0 to 3.22.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7704)"
This reverts commit 8e374deec4.
2022-12-13 15:25:23 +00:00
Alex Florisca 3954e48a75 Edit Proceed to Checkout button (https://github.com/woocommerce/woocommerce-blocks/pull/7733)
* Edit Proceed to Checkout button

* Don't allow empty button and remove console log

* extract default button label into a variable

* Feedback from Nadir & Niels

Co-authored-by: Niels Lange <info@nielslange.de>
2022-12-13 14:54:27 +00:00
Daniel Dudzic 179287f0be Product Query: Add patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7857)
* Product Query: First attempt at adding patterns

* Product Query: Update patterns and the default block template

* Product Query: And new and update existing patterns

* Product Query: Adjust layout of the Minimal Product Row pattern

* Product Query: Update pattern names

* Product Query: Polish spaces between blocks inside the patterns

* Product Query patterns: Link product titles and improve spacing between product elements

* Product Query patterns: Button font-size update

* Product Query patterns: Center the pagination

* Product Query patterns: Center the pagination for the default pattern

* Product Query patterns: Remove an empty column

* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern
2022-12-13 14:53:26 +01:00
dependabot[bot] 8e374deec4 Bump @wordpress/notices from 3.12.0 to 3.22.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7704)
Bumps [@wordpress/notices](https://github.com/WordPress/gutenberg/tree/HEAD/packages/notices) from 3.12.0 to 3.22.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/notices/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/notices@3.22.0/packages/notices)

---
updated-dependencies:
- dependency-name: "@wordpress/notices"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 13:51:12 +00:00
dependabot[bot] 5e4b1e1060 Bump @wordpress/element from 4.0.4 to 4.20.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7702)
Bumps [@wordpress/element](https://github.com/WordPress/gutenberg/tree/HEAD/packages/element) from 4.0.4 to 4.20.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/element/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/element@4.20.0/packages/element)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 13:09:43 +00:00
dependabot[bot] 35b848f2c6 Bump act10ns/slack from 1 to 2 (https://github.com/woocommerce/woocommerce-blocks/pull/7805)
Bumps [act10ns/slack](https://github.com/act10ns/slack) from 1 to 2.
- [Release notes](https://github.com/act10ns/slack/releases)
- [Changelog](https://github.com/act10ns/slack/blob/master/RELEASE.md)
- [Commits](https://github.com/act10ns/slack/compare/v1...v2)

---
updated-dependencies:
- dependency-name: act10ns/slack
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 11:22:13 +00:00
dependabot[bot] 61744e6d21 bump @storybook/client-api from 6.5.12 to 6.5.14 (https://github.com/woocommerce/woocommerce-blocks/pull/7922)
---
updated-dependencies:
- dependency-name: "@storybook/client-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-13 10:32:19 +00:00
kmanijak 6d2ea8ef3a Add dropdown version of Filter by Rating (https://github.com/woocommerce/woocommerce-blocks/pull/7771)
* Rename the setting section to match Filter by Attribute

* Add Display Style toggle to the block settings

* Set list as a default value of displayStyle for Filter by Rating

* Add dropdown variant of Filter by Rating

* Extend the Editor settings with selectType: single or multiple

* Adjust the styles of a FormTokenField to other dropdown

* Align Editor settings order and wording between Filter by Attribute and Rating

* Fix the issue with cut off corners of dropdown borders

* Provide translated screen reader messages and placeholder

* Revert the label property, which is necessary to display checkbox list

* Make classname for Rating component optional and remove styling in Filter by Rating

* Cover the case when filter with zero products needs string methods for comparison

* Handle Typescript errors and add ts-ignore annotations when necessary

* Remove explicit key prop assignment in Rating component

* Remove leftover property in type definition

* Refactor JSX element extension with custom properties to more robust way with object copy

* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)

* Filter by Rating tests:
  - List single
  - List multiple
  - Dropdown single
  - Dropdown multiple

* Adjust the font-size of Filter by Rating dropdown to the rest of the filters

* Fix E2E tests after the Editor settings label has been changed

* Improve sorting in Filter by Rating dropdown

With this change the order of options is always descending: in the chips, suggestions, active filters and URL

* Change the name of the filter blocks in the test files

* Prevent single dropdown input to overflow the wrapper

The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css

* Remove the unused styles of active options in Filter by Rating

Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then

* Change the approach of shared styles to fix the dropdown issue in filters

Instead of using direct classes, rewrite it to mixin and include in the filters

* Fix the Filter by Rating with Products block

The problem was with the Products block, that there was incorrect initial value of product ratings query

* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-12-13 09:12:03 +01:00
Patricia Hillebrandt dbae55536e Filter by Rating Block > Display a notice in the editor if the store has no products with ratings (https://github.com/woocommerce/woocommerce-blocks/pull/7763)
* A notice is now displayed in the editor whenever the Filter by Rating block is used in a store that has no products with ratings. Additionally, users can now preview/update the content, settings, and color for the filter even when the store doesn't have any ratings yet.
2022-12-12 22:52:58 +01:00
dependabot[bot] 54455a656e Bump @wordpress/api-fetch from 6.11.0 to 6.19.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7703)
Bumps [@wordpress/api-fetch](https://github.com/WordPress/gutenberg/tree/HEAD/packages/api-fetch) from 6.11.0 to 6.19.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/api-fetch/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/api-fetch@6.19.0/packages/api-fetch)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-12 16:59:06 +00:00
dependabot[bot] a2510f478b Bump @types/react-dom from 17.0.17 to 18.0.9 (https://github.com/woocommerce/woocommerce-blocks/pull/7724)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 17.0.17 to 18.0.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

---
updated-dependencies:
- dependency-name: "@types/react-dom"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 16:53:13 +00:00
dependabot[bot] 7162d8d493 Bump mshick/add-pr-comment from 1 to 2 (https://github.com/woocommerce/woocommerce-blocks/pull/7806)
Bumps [mshick/add-pr-comment](https://github.com/mshick/add-pr-comment) from 1 to 2.
- [Release notes](https://github.com/mshick/add-pr-comment/releases)
- [Commits](https://github.com/mshick/add-pr-comment/compare/v1...v2)

---
updated-dependencies:
- dependency-name: mshick/add-pr-comment
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-12 16:50:01 +00:00
dependabot[bot] 26a5116fbf Bump WebFreak001/deploy-nightly from 1.2.0 to 2.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7808)
Bumps [WebFreak001/deploy-nightly](https://github.com/WebFreak001/deploy-nightly) from 1.2.0 to 2.0.0.
- [Release notes](https://github.com/WebFreak001/deploy-nightly/releases)
- [Commits](https://github.com/WebFreak001/deploy-nightly/compare/v1.2.0...v2.0.0)

---
updated-dependencies:
- dependency-name: WebFreak001/deploy-nightly
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 16:40:39 +00:00
dependabot[bot] 1cc9ab8021 Bump @storybook/react from 6.5.10 to 6.5.13 (https://github.com/woocommerce/woocommerce-blocks/pull/7765)
Bumps [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/app/react) from 6.5.10 to 6.5.13.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.13/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.13/app/react)

---
updated-dependencies:
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-12 16:39:01 +00:00
dependabot[bot] 533d7cb33d Bump yoast/phpunit-polyfills from 1.0.3 to 1.0.4 (https://github.com/woocommerce/woocommerce-blocks/pull/7766)
Bumps [yoast/phpunit-polyfills](https://github.com/Yoast/PHPUnit-Polyfills) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/Yoast/PHPUnit-Polyfills/releases)
- [Changelog](https://github.com/Yoast/PHPUnit-Polyfills/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/Yoast/PHPUnit-Polyfills/compare/1.0.3...1.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-12 16:30:39 +00:00
dependabot[bot] c7329cc98b Bump automattic/jetpack-autoloader from 2.11.11 to 2.11.12 (https://github.com/woocommerce/woocommerce-blocks/pull/7768)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.11 to 2.11.12.
- [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.11...v2.11.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-12 16:17:53 +00:00
dependabot[bot] 9f3992af54 Bump wp-phpunit/wp-phpunit from 6.1.0 to 6.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7767)
Bumps [wp-phpunit/wp-phpunit](https://github.com/wp-phpunit/wp-phpunit) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/wp-phpunit/wp-phpunit/releases)
- [Commits](https://github.com/wp-phpunit/wp-phpunit/compare/6.1.0...6.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 15:37:50 +00:00
dependabot[bot] 8acd0bfff6 Bump richardsimko/github-tag-action from 1.0.5 to 1.0.7 (https://github.com/woocommerce/woocommerce-blocks/pull/7807)
Bumps [richardsimko/github-tag-action](https://github.com/richardsimko/github-tag-action) from 1.0.5 to 1.0.7.
- [Release notes](https://github.com/richardsimko/github-tag-action/releases)
- [Commits](https://github.com/richardsimko/github-tag-action/compare/v1.0.5...v1.0.7)

---
updated-dependencies:
- dependency-name: richardsimko/github-tag-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 15:37:18 +00:00
dependabot[bot] d63c9ff429 Bump simple-git from 3.7.1 to 3.15.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7877)
Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.7.1 to 3.15.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.15.1/simple-git)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-12 15:18:26 +00:00
Luigi Teschio 306ce007d0 Product Query - Enable "Inherit Query from template" option (https://github.com/woocommerce/woocommerce-blocks/pull/7641)
* Add Inherit Query from template option

* Update label
2022-12-12 16:06:25 +01:00
Daniel Dudzic 0249011551 Product Elements: Fix block settings (https://github.com/woocommerce/woocommerce-blocks/pull/7914)
* Product Elements: Fix block settings

* Rating: Fix inactive star color

* Product Rating: Fix color inheritance
2022-12-12 15:53:42 +01:00
Tarun Vijwani c3ed875906 Document the selectors for the wc/store/cart data store (https://github.com/woocommerce/woocommerce-blocks/pull/7708)
* Add selectors doc for Cart store

* update readme file to include cart and payment documentation

* Add more description to the objects.
2022-12-12 17:07:55 +04:00
Daniel Dudzic bdbee5cbf8 StyleAttributesUtils: Fix PHP notices and invalid CSS output (https://github.com/woocommerce/woocommerce-blocks/pull/7909)
* StyleAttributesUtils: Fix PHP notices and invalid CSS output. Closes woocommerce/woocommerce-blocks#7899.

* StyleAttributesUtils: Fix border radius and width support

* StyleAttributesUtils: Fix border radius and border color support

* StyleAttributesUtils: Include additional checks to deal with PHP warnings

* StyleAttributesUtils: Improve the custom border array check
2022-12-12 12:43:41 +01:00
Alex Florisca 62bda845d9 Update GH token to fine grained token (https://github.com/woocommerce/woocommerce-blocks/pull/7887) 2022-12-12 11:06:31 +00:00
Tung Du e306334911 Fix: encode and decode term slug to support non-ASCII terms (https://github.com/woocommerce/woocommerce-blocks/pull/7906) 2022-12-12 17:46:20 +07:00
Luigi Teschio 8bbb14f23b Add more clarity about the responsibility of reviewing/merging the PR on WC Core during the release process (https://github.com/woocommerce/woocommerce-blocks/pull/7913)
* add more clarity about the responsibility of reviewing/merging the PR on WC Core during the release process

* Update .github/release-initial-checklist.md

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

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-12-12 10:37:05 +01:00
Luigi Teschio 1f96800326 Fix Markdown lint errors (https://github.com/woocommerce/woocommerce-blocks/pull/7912) 2022-12-12 10:20:47 +01:00
Luke O'Regan cd82fa28a5 Update MiniCart.php to fix price total amount on page load prices are including tax (https://github.com/woocommerce/woocommerce-blocks/pull/7832)
* Update MiniCart.php

Added an update to the '$cart_contents_total' variable on the 'get_cart_price_markup' function if $cart->display_prices_including_tax is active. Currently displaying wrong amount total on page load if items are already in the basket.

* Update MiniCart.php

Removed white spaces?

* Update MiniCart.php

Fixed IF statement

* Remove whitespace at end of line

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-12-09 17:36:28 +01:00
Mike Jolley 4616d4e1d9 Clarify that the extend class in Store API is for schema (https://github.com/woocommerce/woocommerce-blocks/pull/7858) 2022-12-09 13:32:12 +00:00
Daniel W. Robert 83ff85e008 Fix Global Styles Block Icon Color for Mini Cart (https://github.com/woocommerce/woocommerce-blocks/pull/7762)
* Update hex color val to currentColor.

* Remove fill attributes on SVG

Having the fill attributes explicitly defined on the SVG was setting the
icon to purple in unexpected cases.

This also reverts the quick attempt to adjust CSS selector for a fix, as
it was the incorrect approach.
2022-12-08 09:55:25 -05:00
Mike Jolley bc17c19262 ValidatedTextInput fields should validate on mount (https://github.com/woocommerce/woocommerce-blocks/pull/7888)
* Validate on mount

* Update e2e text for email validation check

* Markdown linting
2022-12-08 12:14:14 +00:00
Raluca Stan bd7cd91061 Update payment-method-integration.md 2022-12-08 10:40:38 +00:00
Tung Du e878431068 Product Query unit tests (https://github.com/woocommerce/woocommerce-blocks/pull/7747) 2022-12-08 08:48:42 +07:00
Raluca Stan c2f640352f Update payment-method-integration.md 2022-12-07 18:48:08 +00:00
github-actions[bot] dbde4876fc Release: 9.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7854)
* Empty commit for release pull request

* add changelog

* add testing notes

* rename stuff

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2022-12-07 14:06:20 +01:00
Luigi Teschio 9436488da4 Product Query: implement compatibility with Filter by Rating block (https://github.com/woocommerce/woocommerce-blocks/pull/7792)
* Product Query: implement compatibility with Filter by Rating block woocommerce/woocommerce-blocks#7631

Product Query: implement compatibility with Filter by Rating block

* address feedback

* address feedback

* add comment
2022-12-07 12:32:31 +01:00
Tarun Vijwani 47aa2ae27b Fix payment store performance by getting a focused selector (https://github.com/woocommerce/woocommerce-blocks/pull/7811)
* Fix payment store performance by getting a focused selector

* Replace getState selector with focused selectors in saved payment methods options
2022-12-07 13:12:55 +04:00
Tarun Vijwani a7f3e22453 Convert radio-control-accordion component to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7849) 2022-12-06 21:23:46 +04:00
Mike Jolley 6c438acb5c Fixes validated text input tests (https://github.com/woocommerce/woocommerce-blocks/pull/7859) 2022-12-06 16:22:34 +00:00
Nadir Seghir 79a3d397c2 Bumping version strings to new version. 2022-12-06 15:41:29 +01:00
Luigi Teschio 58f3217690 Remove workarounds for site-editing-templates tests woocommerce/woocommerce-blocks#7151 (https://github.com/woocommerce/woocommerce-blocks/pull/7568)
* Remove workaround for site-editing-templates tests woocommerce/woocommerce-blocks#7151

remove workaround for site-editing-templates tests

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-06 15:40:05 +01:00
Nadir Seghir 1ad5418cfe rename stuff 2022-12-06 15:30:26 +01:00
Mike Jolley 7758ee05fe Improve inline validation to avoid invalid server pushes (https://github.com/woocommerce/woocommerce-blocks/pull/7755)
* Allows custom validation rules to be applied to fields - in this case, email address

* Add local state to only push valid changes

* Do not need required

* unused isString

* Move to push level

* Update packages/checkout/components/text-input/validated-text-input.tsx

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

* Update packages/checkout/components/text-input/validated-text-input.tsx

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

* Update packages/checkout/components/text-input/validated-text-input.tsx

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

* Update packages/checkout/components/text-input/validated-text-input.tsx

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

* Validate when the data store changes

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-12-06 13:13:21 +00:00
Nadir Seghir ec9196d0cb add testing notes 2022-12-06 13:38:47 +01:00
Nadir Seghir 8e73d879d9 add changelog 2022-12-06 12:55:20 +01:00
Luigi Teschio e58e468685 Fix Query Loop crash when an icon of a variation is registered with src attribute (https://github.com/woocommerce/woocommerce-blocks/pull/7852)
* Fix Query Loop crash when an icon of a variation is registered with src attribute

* change scope variation
2022-12-06 12:13:04 +01:00
dependabot[bot] 8de944dee7 Bump decode-uri-component from 0.2.0 to 0.2.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7821)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-06 14:07:22 +07:00
Lucio Giannotta dc63c2dc46 Product Query: create variation of `core/post-excerpt` as a Product Query inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7837)
* Creates a new block variation based on the core “Post Excerpt” called “Product Summary”.
* Brands it as our old “Product Summary” atomic element.
* Creates a utility function to allow easy creation of such variations.
2022-12-05 17:25:13 +01:00
Lucio Giannotta 7dc5643dff Product Query: create variation of `core/post-title` as a Product Query inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7836)
As much as we can, we should use core blocks when the functionality is mostly overlapping. In the case of the Post Title block, we don't need to add and maintain our own block most likely, so we should just brand the Post Title block instead.

This PR does the following:

* Creates a new block variation based on the core “Post Title” called “Product Title”.
* Brands it as our old “Product Title” atomic element.
* Use this variation as the default within the Product Query template.
* Also removes some old code used for variations before the namespace attribute was available on the core Query Loop and repurposes it to create this variation.
2022-12-05 16:56:53 +01:00
Darren Ethier c6c6122dd7 Add "Just Arrived Full Hero" commerce adjacent pattern (https://github.com/woocommerce/woocommerce-blocks/pull/7812)
* Add just arrived full hero commerce adjacent pattern.

* Remove group block as wrapper.

* use more responsive font-size and add i18n
2022-12-05 08:24:58 -05:00
Darren Ethier 9f495fb937 add i18n to pattern strings (https://github.com/woocommerce/woocommerce-blocks/pull/7841) 2022-12-05 08:24:13 -05:00
Darren Ethier e70cb68480 Add "Product Hero 2 Column 2 Row" commerce adjacent pattern. (https://github.com/woocommerce/woocommerce-blocks/pull/7814)
* Add commerce adjacent block pattern

Product Hero 2 Column 2 Row.

* Wrap strings in i18n
2022-12-05 08:23:57 -05:00
Lucio Giannotta 99ba060720 Product Query: Polishing touches for the feature plugin debut (https://github.com/woocommerce/woocommerce-blocks/pull/7815)
* Product Query: add Feedback Prompt in inspector

The prompt doesn't appear at the very bottom as there isn't
currently any straightforward way to do this in the block variation.

More investigation is required.

* Product Query: Change icon, description and name

* Product Query: switch to Feature plugin flag

* Add all currently available atomic blocks to the default Product Query template

* Update feature flags doc

* Change SKU and Stock Indicator feature flags

* Change feature flags docs

* Add title prop to the `FeedbackPrompt` and add a title to the Product Query one

* Hacky solution to display the feedback block at the bottom

The order of the inspector controls is set in Gutenberg.
We can hack our way down by hooking to the “color” group and
display our feedback there.

Other panels would be displayed below that if added, such as borders
and margin.

* Reduce Product Query default template

* Fix e2e tests after Product Query block name change (https://github.com/woocommerce/woocommerce-blocks/pull/7840)

* Product Query: Add a better default pattern (https://github.com/woocommerce/woocommerce-blocks/pull/7833)

* Product Query: Add a better default pattern

* Product Price: Add bottom margin

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2022-12-05 13:46:50 +01:00
Darren Ethier 6ed137e1e8 Add "Store Info Alternating Image and Text" commerce adjacent pattern (https://github.com/woocommerce/woocommerce-blocks/pull/7827)
* Add new commerce-adjacent pattern

This pattern is an alternating image and text layout that provides store info for the shopper.

* fix pattern title
2022-12-05 06:57:51 -05:00
Tung Du f35bbd7b0e Fix: Product Query editor preview with Stock Status setting (https://github.com/woocommerce/woocommerce-blocks/pull/7682)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-05 09:14:17 +07:00
Daniel Dudzic e1a0866e4a Product Price: Hide alignment setting for the All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7825) 2022-12-02 18:05:53 +01:00
Daniel Dudzic 3d64bfe69c Rating: Add support for alignment setting (https://github.com/woocommerce/woocommerce-blocks/pull/7790)
* Rating: Add support for alignment setting

* Rating: Fix PHP warning

* Rating: Fix linting error

* Rating: Update StyleAtributesUtils.php

* Product Rating: Escape alignment class

* Product Rating: Hide alignment setting for the All Products block
2022-12-02 17:11:26 +01:00
Daniel Dudzic b6303c8493 Add to Cart: Add support for the alignment setting (https://github.com/woocommerce/woocommerce-blocks/pull/7816)
* Add to Cart: Add support for the alignment setting

* Add to Cart button: Hide alignment setting for the All Products block
2022-12-02 15:17:22 +01:00
Manish Menaria dd40d2bfce Revert "Add product query support for Product Summary block (https://github.com/woocommerce/woocommerce-blocks/pull/7774)" (https://github.com/woocommerce/woocommerce-blocks/pull/7818)
This reverts commit 3b131f6d35.
2022-12-02 17:11:57 +05:30
Manish Menaria 830ea38a82 Revert "Adds product query support for Category list block (https://github.com/woocommerce/woocommerce-blocks/pull/7675)" (https://github.com/woocommerce/woocommerce-blocks/pull/7819)
This reverts commit c263ba83d4.
2022-12-02 17:11:44 +05:30
Niels Lange 86e381b7fd Respect tax label in cart and checkout (https://github.com/woocommerce/woocommerce-blocks/pull/7785)
* Respect Settings Tax Name in Cart & Checkout

* Update storybook

* Fix TS error

* Fix TS errors
2022-12-02 18:40:56 +07:00
Tarun Vijwani 24468ba212 Hide the shipping address form from Checkout Block in Editor and rename the Billing Address label when "Force shipping to the customer billing address" is enabled. (https://github.com/woocommerce/woocommerce-blocks/pull/7800)
* Rename billing address labels and hide shipping address from the editor when Force shipping to the customer billing address is enabled
2022-12-02 15:34:27 +04:00
Luigi e7d097be71 Merge branch 'release/8.7.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-12-01 19:13:29 +01:00
github-actions[bot] f06c43ab4c Release: 8.7.6 (https://github.com/woocommerce/woocommerce-blocks/pull/7804)
* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)

* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor

* Updated readme.txt

* Reverted stable tag change on readme.txt

* Testing instructions

* Cleaned out testing instructions

* Bumping version strings to new version.

* Empty commit for release pull request

* Testing instructions

* package-lock.json version bump

* Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)

This reverts commit 25e24708b5.

* Testing zip

* Bumping version strings to new version.

* add testing instructions

* upload a new zip file

* Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506)

* Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)

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

* Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)

* Fixed Price Slider Issue

Located where the price slider was hard coded and replaced it.

* fix CSS lint

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* remove background-color

Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>

* Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525)

* Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)

* fix inconsistent button styling with TT3

* use wc_wp_theme_get_element_class_name

* add check to be sure that wc_wp_theme_get_element_class_name function exists

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379

Fix Mini Cart Block global styles

* add font_size

* upload a new build

* Bumping version strings to new version.

* update changelog

* Empty commit for release pull request

* add testing instructions

* update zip file link

* Prevent Mini Cart loading the same script twice (https://github.com/woocommerce/woocommerce-blocks/pull/7794)

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
2022-12-01 19:10:33 +01:00
Luigi a2b5ae09ac Merge branch 'release/8.9.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-12-01 19:04:28 +01:00
github-actions[bot] 7c5f4ca627 Release: 8.9.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7803)
* Empty commit for release pull request

* Display correct block template when filtering by attribute (https://github.com/woocommerce/woocommerce-blocks/pull/7640)

* Fix error when trying to access the queried object when it's null (https://github.com/woocommerce/woocommerce-blocks/pull/7664)

* Fix error when trying to access the queried object when it's null.

* Check if the `slug` exists

* Use the taxonomy name instead of the slug, otherwise it returns false

* Update readme changelog

* Add testing notes

* Improve testing notes format

* Bumping version strings to new version.

* Prevent Mini Cart loading the same script twice (https://github.com/woocommerce/woocommerce-blocks/pull/7794)

* Empty commit for release pull request

* update changelog

* add testing instructions

* update zip file link

* Mini Cart: load wc-blocks-registry package at the load of the page instead of lazy load it (https://github.com/woocommerce/woocommerce-blocks/pull/7813)

* update changelog

* update testing instructions

* update zip file link

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Luigi <gigitux@gmail.com>
2022-12-01 19:02:50 +01:00
Luigi Teschio 34140b197f Mini Cart: load wc-blocks-registry package at the load of the page instead of lazy load it (https://github.com/woocommerce/woocommerce-blocks/pull/7813) 2022-12-01 18:31:24 +01:00
Lucio Giannotta 4e340ee3ed Product Query: make sure request params are set when enhancing REST query (https://github.com/woocommerce/woocommerce-blocks/pull/7796)
This fixes a bug in which in certain cases Products wouldn't load in the editor because the Product Query
block was doing some REST API request with some invalid parameters.
2022-12-01 16:42:25 +01:00
Daniel Dudzic 936979dc33 Product Price: Fix alignment setting on the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/7795)
* Product Price: Fix alignment setting on the frontend

* Product Price: Remove the Feature plugin flag from the alignment setting

* Product Price: Code clean-up

* Product Price: Fix PHP warning
2022-12-01 14:51:44 +01:00
Manish Menaria 70619b5cdb Escape values just before rendering (https://github.com/woocommerce/woocommerce-blocks/pull/7797)
* Escape all values in output of Product category list

* Escape all values in output of Product Sale Badge

* Escape values before rendering

Whenever you’re rendering data, make sure to properly escape it. Escaping output prevents XSS (Cross-site scripting) attacks.

* Remove unnecessary space

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

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-12-01 17:51:01 +05:30
Manish Menaria 3b131f6d35 Add product query support for Product Summary block (https://github.com/woocommerce/woocommerce-blocks/pull/7774)
* Add product query support for Product Summary block

On the client side, when the Product Summary block is used within the product query block, the markup will be rendered on the server side - No javascript related to Product Summary block will be rendered.

* Update variable names for clarity & readability

* Escape all values in output string

* Fix custom style not working

More info: https://github.com/woocommerce/woocommerce-blocks/pull/7774#discussion_r1035909243
2022-12-01 17:37:41 +05:30
Manish Menaria 0d851fdb29 Add product query support for Stock indicator block (https://github.com/woocommerce/woocommerce-blocks/pull/7734)
* Add product query support for Stock indicator block

On the client side, when the Stock indicator block is used within the product query block, the markup will be rendered on the server side - No javascript related to Stock indicator block will be rendered.

* Escape all values in output string

Whenever we are rendering data, we should escape it. Escaping output prevents XSS (Cross-site scripting) attacks.

* Change $is_on_backorder type & escape just before printing

For more info:
https://github.com/woocommerce/woocommerce-blocks/pull/7734#discussion_r1035971939
https://github.com/woocommerce/woocommerce-blocks/pull/7734#discussion_r1035975712
2022-12-01 17:14:05 +05:30
Albert Juhé Lluveras 9f3d61e1ea Prevent Mini Cart loading the same script twice (https://github.com/woocommerce/woocommerce-blocks/pull/7794) 2022-12-01 11:54:28 +01:00
kmanijak 796e952b92 Align text sizing in filter blocks: chips, checkboxes, buttons, dropdown (https://github.com/woocommerce/woocommerce-blocks/pull/7707)
* Align the font-size of checkbox-control component to the price slider amount

* Align the font-size of Price Slider Button to the price slider amount

* Align the font-size of Filter Reset Button to the price slider amount

* Align the font-size of Clear All Button to the price slider amount

* Align the font-size of Apply button in Editor to the price slider amount

* Align the font-size of Apply button in Frontend to the price slider amount

* Align the font-size of Price Slider Amount to the standard size

* Align the font-size of Active Filter chips to the price slider amount

* Align the font-size of Filter by Price (text) to the price slider amount

* Align the font-size of Filter by Attribute (dropdown) to the price slider amount

* Align the font-size of placeholder of Filter by Attribute (dropdown) to the price slider amount

* Change font-size for text in filters from font-size(smaller) to font-size(smaller)

As a result of discussion in PR it was agreed to check the styles with bigger font size hence the change

* Align the font-size of input text of Filter by Attribute (dropdown) to the price slider amount

* Change margin-right of checkbox-control to relative value so it better adapts to the fonts
2022-11-29 16:42:24 +01:00
Lucio Giannotta 181838bfdf Product Query: Add support for filtering by attributes within the block (https://github.com/woocommerce/woocommerce-blocks/pull/7743) 2022-11-29 14:44:52 +01:00
Luigi Teschio 0517c06495 disable translations test for the Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/7776) 2022-11-29 12:16:30 +01:00
Tung Du 653e838d79 Refactor `ProductQuery::merge_queries` to accept multiple queries (https://github.com/woocommerce/woocommerce-blocks/pull/7697) 2022-11-29 10:13:57 +07:00
Luigi Teschio 58423a2025 Product Query - add support for the global query (https://github.com/woocommerce/woocommerce-blocks/pull/7382)
* Product Query: Fix pagination issue

* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Price Block

* fix query relation

* fix on sale query

* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Attributes block

* fix bugged pagination and on-sale filter after refactor

* address feedback

* Product Query - Add support for the Filter By Stock Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Stock Block

* Fix filter blocks: the data (e.g: max price or stock-status) match the variation woocommerce/woocommerce-blocks#7245

fix filter blocks: the data (e.g: max price or stock-status) match the variation

* rename allowControls to allowedControls

* add support to the global query

* fix eslint error

* bot: update checkstyle.xml

* Update src/BlockTypes/ProductQuery.php

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

* fix global query generation

* bot: update checkstyle.xml

* try: refactor merge_queries

* remove debug code

* fix: unpack assoc array php 7.4

* try: refactor merge_queries to take any form of input without unpacking
and preparing the input arrays

* add missing query vars

* add feature flag

* updates comment

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-11-28 15:31:31 +01:00
Albert Juhé Lluveras c7bfa1d89c CSS cleanup from /assets/css/ (https://github.com/woocommerce/woocommerce-blocks/pull/7751)
* Remove unused SCSS variables

* Unify mixins style

* Remove legacy editor styles

* Move SearchListControl styles into its component

* Remove unused styles
2022-11-28 15:09:31 +01:00
kmanijak 13ff157278 Register footer and header patterns as template parts, so they are available in contextual chooser (https://github.com/woocommerce/woocommerce-blocks/pull/7699) 2022-11-28 12:11:08 +01:00
Manish Menaria c263ba83d4 Adds product query support for Category list block (https://github.com/woocommerce/woocommerce-blocks/pull/7675)
* Adds product query support for Category list block

On the client side, when the Category list block is used within the
product query bloc, the markup will be rendered on the server side -
No javascript related to Category list block will be rendered.

* bot: update checkstyle.xml

* Fix extra space after the category link

I used the solution from following link: https://css-tricks.com/fighting-the-space-between-inline-block-elements/#aa-remove-the-spaces

Here is the content from the above link:

The reason you get the spaces is because, well, you have spaces between the elements (a line break and a few tabs counts as a space, just to be clear). Minimized HTML will solve this problem, or one of these tricks:

```CSS
<ul>
  <li>
   one</li><li>
   two</li><li>
   three</li>
</ul>
```

or

```CSS
<ul>
  <li>one</li
  ><li>two</li
  ><li>three</li>
</ul>
```

or with comments…

```CSS
<ul>
  <li>one</li><!--
  --><li>two</li><!--
  --><li>three</li>
</ul>
```

They’re all pretty funky, but it does the trick.

* Fix custom style doesn't work on the frontend side

For more info, check this comment on the PR:
https://github.com/woocommerce/woocommerce-blocks/pull/7675#pullrequestreview-1179267957

In summary, user can set the custom styles like text color, link color, font size, font weight, line height using the editor sidebar.
These styles weren't showing on the frontend side.

* Add support for additional CSS class(es)

* Fix "custom style -> link color" not working

To understand the issue in more details please check following comment:
https://github.com/woocommerce/woocommerce-blocks/pull/7675#issuecomment-1319822535

* Fix classname undefined issue

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-28 11:47:27 +05:30
Albert Juhé Lluveras 91ff195c07 Rename Active Product Filters block to Active Filters (https://github.com/woocommerce/woocommerce-blocks/pull/7753)
* Rename Active Product Filters block to Active Filters

* Rename wc-block-active-product-filters__placeholder to wc-block-active-filters__placeholder

* Rename active filters fixture
2022-11-25 17:17:45 +01:00
dependabot[bot] 4f18a71899 Bump loader-utils from 1.4.0 to 1.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7688)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

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>
2022-11-25 11:08:43 -03:00
Alba Rincón 304f2c3c23 Make `Products by category/tag/attribute` fallback to the `Product catalog` template (https://github.com/woocommerce/woocommerce-blocks/pull/7712)
* Add archive-product to the hierarchy

* Fallback to archive-product and get titles from blocks if the templates from theme don't have one

* Rename function

* Fix comment

* Add fallbacks to the db and blocks versions

* Add missing product attribute blockified template

* Update docs

* Add comment and fix comment type on wp_template

* Replate template name if we know the template in blocks

* Add comment and fix linting error

* Fix archive-product template

* Clone the fallback template from db to show them in the template lsit

* Return the fallback template when querying for a single template

* Remove unneeded condition

* Use wp function instead of gutenberg one

* Fix tests

* Fix tests on Product Catalog templates

It was checking a single product for the customization, but it should check the /shop page

* Disable tests related with deleteAllTemplates function
2022-11-24 16:45:39 +01:00
Alex Florisca c9109183b8 Remove CustomerDataContext (https://github.com/woocommerce/woocommerce-blocks/pull/7686)
* Remove CustomerDataContext

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-24 14:20:44 +00:00
Alex Florisca ff414acd63 Add checkout selectors (https://github.com/woocommerce/woocommerce-blocks/pull/7713)
* Add checkout selectors

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-24 14:19:59 +00:00
Luigi Teschio 1b55c5633b Product Query - Add E2E tests for the Filter by Attribute block (https://github.com/woocommerce/woocommerce-blocks/pull/7405)
* Product Query: Fix pagination issue

* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Price Block

* fix query relation

* fix on sale query

* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Attributes block

* fix bugged pagination and on-sale filter after refactor

* address feedback

* Product Query - Add e2e tests for the Filter By Price block

* Product Query - Add e2e tests for the Filter By Attribute block

* fix comment

* fix comment

* remove not used import

* remove not used import

* address feedback

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-11-24 14:42:58 +01:00
Lucio Giannotta 55face4338 Product Query: Add order by “Top rated” as a preset (https://github.com/woocommerce/woocommerce-blocks/pull/7715)
* Add safety guard to `extend_rest_query_allowed_params`
2022-11-23 20:28:17 +01:00
Daniel Dudzic 81d0994213 Post 9.0.0 release version bump (https://github.com/woocommerce/woocommerce-blocks/pull/7737) 2022-11-23 18:01:04 +01:00
Manish Menaria 983ecc03d7 Add product query support for Sale badge block (https://github.com/woocommerce/woocommerce-blocks/pull/7709)
* Add product query support for Sale badge block

On the client side, when the Sale badge block is used within the product query block, the markup will be rendered on the server side - No javascript related to Sale badge block will be rendered.

* Add support for additional CSS class(es)

ADDITIONAL CSS CLASS(ES)(available in advanced toggle in sidebar) should be added to the container div

* Convert preset to css variable for padding

We are getting padding value in preset format like this:
"var:preset|spacing|50"
Therefore I added a function to convert it to CSS variable like this:
"var(--wp--preset--spacing--50)"

i.e. "var:preset|spacing|50" -> "var(--wp--preset--spacing--50)"

* Add reference for preset to css variable conversion logic
2022-11-23 17:12:55 +05:30
github-actions[bot] ed192ab48e Release: 9.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7725)
* Empty commit for release pull request

* Update compatibility sections and add release 9.0.0 changelog

* Add testing instructions for the 9.0.0 release

* Update testing instructions for the 9.0.0 release

* Remove testing instructions for an unmerged PR

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2022-11-23 12:37:31 +01:00
Tung Du 418d33e22e E2E: Change label of product filters from `Product filters` to `Advanced Filters` (https://github.com/woocommerce/woocommerce-blocks/pull/7726)
* E2E: Change label of product filters from `Product filters` to `Advanced
Filters` to match with the updates from woocommerce/woocommerce-blocks#7687

* rename test file and test title to advanced filters

* E2E: Fix flaky test related to `waitForAllProductsBlockLoaded` (https://github.com/woocommerce/woocommerce-blocks/pull/7727)

* explain the reason for try/catch
2022-11-22 15:28:27 +01:00
Lucio Giannotta 04c689b0ff Product Query: Add order by “best selling” as a preset (https://github.com/woocommerce/woocommerce-blocks/pull/7687)
* Add support for “Popular Presets” for PQ block

This commits achieves the following:

* Adds a section in the inspector control called “Popular Presets”,
which contains a dropdown with popular presets.
* Adds support for the first preset: “Best selling products”.
By selecting this, users can sort products by total sales.
* Switches the order of the custom inspector controls and the default
Query Loop inspector controls: our controls will be now on top
as per the latest design spec (see pdnLyh-2By-p2).
* Restricts the allowed Query parameters to the sort orders we want to
allow according to the latest design spec (disabling title and date).
* Removes the core “Order By” dropdown.
* Refactor `setCustomQueryAttribute` to `setQueryAttribute` because
since a few iterations, our custom query attributes are not deeply nested
anymore, and this function can be used for the normal query too.
* Add back-end support for sorting by Best Selling via the Product Query block
* Adds the `popularity` value as an allowed value for `orderby` on
`product` REST API calls.
* Handles the query differently if the `orderby` value is one among the
custom ones.
2022-11-21 19:21:58 +01:00
Tarun Vijwani 482d3e3224 Change action type name for use shipping as billing option (https://github.com/woocommerce/woocommerce-blocks/pull/7695) 2022-11-21 18:04:53 +04:00
Thomas Roberts 7f8be00f74 Add tests to ensure argument passed to `canMakePayment` is correct (https://github.com/woocommerce/woocommerce-blocks/pull/7478)
* Add tests to ensure argument passed to canMakePayment is correct

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Fix import and type after rebase

* bot: update checkstyle.xml

* Trigger Build

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-21 04:13:24 -08:00
Tung Du 8108f42c30 Refactor TypeScripts error monitoring workflow to avoid tracking checkstyle.xml (https://github.com/woocommerce/woocommerce-blocks/pull/7717) 2022-11-21 19:07:23 +07:00
Tung Du 65afb95e35 Product Query E2E tests: Sale and Stock status filters tests (https://github.com/woocommerce/woocommerce-blocks/pull/7684)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-21 08:08:12 +07:00
Luigi Teschio 21beb29442 Product Query - Add e2e tests for the filter by price block (https://github.com/woocommerce/woocommerce-blocks/pull/7351)
* Product Query - Add e2e tests for the Filter By Price block

* fix comment

* remove not used import

* update description

* update functions after merge

* improve check
2022-11-18 16:44:39 +01:00
Niels Lange 11815133d5 Fix various GitHub Actions warnings (https://github.com/woocommerce/woocommerce-blocks/pull/7573)
* Remove git checkout HEAD^2

* Add assertion to Cross-Sells e2e test

* Replace deprecated set-output calls

* bot: update checkstyle.xml

* Remove obsolete eslint-disable comment

* Change “actions/cache@v2” to “actions/cache@v3”

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-18 07:41:30 -08:00
Alex Florisca a73d6af443 Move paymentResult to the payment store (https://github.com/woocommerce/woocommerce-blocks/pull/7692)
* Move paymentResult to the payment store

* bot: update checkstyle.xml

* Update docs

* Fix typerror

* bot: update checkstyle.xml

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
2022-11-18 12:13:00 +00:00
Raluca Stan 98480c4dc2 Update cart.md (https://github.com/woocommerce/woocommerce-blocks/pull/7700)
* Update cart.md

Add information on how to add extra data to the /add-item request

* Update src/StoreApi/docs/cart.md

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

* Update src/StoreApi/docs/cart.md

Co-authored-by: Niels Lange <info@nielslange.de>
2022-11-18 12:16:26 +01:00
Niels Lange 21e30a2956 Convert product-elements/image to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7572)
* 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

* Convert product-elements/image to TypeScript

* bot: update checkstyle.xml

* Refactor edit.tsx

* bot: update checkstyle.xml

* Add interface to attributes.ts

* Convert product-elements/image to TypeScript

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Refactor edit.tsx

* Add interface to attributes.ts

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Solve TS error

* Solve TS error

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Document types

* Adjust TS interface

* Correct merge mistakes

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Fix broken JS unit test

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-18 13:52:37 +07:00
Thomas Roberts 9bc245f006 Add `clearValidationErrors` action to validation data store (https://github.com/woocommerce/woocommerce-blocks/pull/7601)
* Add clearValidationErrors to validation data store actions

* Add reducer case for CLEAR_VALIDATION_ERRORS

* Add tests for CLEAR_VALIDATION_ERRORS

* Add documentation for clearValidationErrors

* Deprecate clearAllValidationErrors in actions.ts

* Remove CLEAR_VALIDATION_ERRORS action and reducer case

* Update reducer test for clearAllValidationErrors

* Make error message in test describe the test better

* Update reducer to handle CLEAR_VALIDATION_ERRORS with no error passed

* Update documentation for validation data store

* Remove unnecessary linebreaks in documentation
2022-11-17 09:19:44 -08:00
Albert Juhé Lluveras f2748f84ee Update Filter by Stock block name in readme.txt (https://github.com/woocommerce/woocommerce-blocks/pull/7599) 2022-11-17 16:08:48 +01:00
Saad Tarhi a5970697ea Fix missing translations in inspector — Cross-Sells Block (https://github.com/woocommerce/woocommerce-blocks/pull/7616)
* Fix CartCrossSellsBlock inspector's translation

* Fix CartCrossSellsProductsBlock inspector's translation

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-11-17 14:41:15 +01:00
Thomas Roberts 8087adc49d Move `StoreNoticesContainer` to `@woocommerce/blocks-checkout` package and add tests (https://github.com/woocommerce/woocommerce-blocks/pull/7558)
* Move StoreNoticesContainer to checkout package & convert to TS

* Update @types/wordpres__notices version

* Export StoreNoticesContainer from checkout package

* Remove PropTypes from StoreNoticesContainer

* Remove store-notices/index file

* Update import of StoreNoticesContainer

* Remove store notices export

* Add docblock to StoreNoticesContainer component

* Add tests for StoreNoticesContainer

* bot: update checkstyle.xml

* Fix typo and incorrect component name

* Update import for StoreNoticesContainer

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-17 05:33:58 -08:00
Alba Rincón 87510929b5 Create the `Products by Attribute` template (https://github.com/woocommerce/woocommerce-blocks/pull/7660)
* Create the `Products by Attribute` template

* bot: update checkstyle.xml

* Fix typo

* Rename template to `taxonomy-product_attribute`

* Rename test template file

* bot: update checkstyle.xml

* Fix test enabling archives for shade attribute

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-16 14:37:41 +01:00
Alex Florisca ddd0cc2300 Move payment utils and delete orderPaymentMethods (https://github.com/woocommerce/woocommerce-blocks/pull/7679)
* Moved all payment utils functions in a utils folder

* Delete  as it's not being used

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Fix TS error

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-16 09:38:48 +00:00
kmanijak 5e1896d98a Fix: skewed placeholder of product image - issuewoocommerce/woocommerce-blocks#7553 (https://github.com/woocommerce/woocommerce-blocks/pull/7651)
* Fix typo in HTML markup of ProductImage block placeholder

Typo caused rendering of incorrect HTML attributes: width and height of Product Image placeholder that were anyway ignored by the browser

* Remove inline styles (width and height) from ImagePlaceholder in ProductElements > Image block

Inline height took precedence over the inherited styles which made the placeholder image skewed (in loading and loaded state). Removal of those styles allows the ImagePlaceholder to adapt the height to the available space keeping the ratio or inherit the styles from the parent

* Remove inline styles (width and height) from placeholder image in ProductImage.php block

Inline styles applied to the placeholder image of ProductImage block were overriden by other styles with higher specificity, which made them redundant. Additionally, corresponding styles were removed from the placeholder image from Editor code as they caused UI glitches. Additional proof that it's safe to remove them is in the first commit in this branch, the purpose of which was to fix those styles as there was a typo which corrupted them and eventually inline width and height were ignored by the browser and not applied to the element

* Add test to check placeholder image renders without width and height inline attributes

This is to prevent adding inline width and height attributes so the sizing of the placeholder image is controlled by the inherited styles or element styles, in the same way as a regular product image

* Fix TypeScript errors in the block test file of Product Image

* Add generic alt text to placeholder image

Alt text added in this commit is a generic text, not description of the actual image. That's because the image itself is set externally through the settings and may change over time

* Revert adding placeholder image alt text and add comments to make the empty alt explicit

After a Github discussion: https://github.com/woocommerce/woocommerce-blocks/pull/7651\#discussion_r1019560494 it was decided the placeholder should NOT have alt text as it serves the purpose of decorative image. According to the guidelines decorative images should not have alt text: https://www.w3.org/WAI/tutorials/images/decorative/. Comments were added also to other places where it happens

* bot: update checkstyle.xml

Co-authored-by: Karol Manijak <karolm@Karols-MacBook-Pro.local>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-16 10:25:40 +01:00
Tung Du e59c931a9b E2E: Fixing failed tests with Gutenberg (https://github.com/woocommerce/woocommerce-blocks/pull/7554)
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2022-11-16 08:52:51 +07:00
Alexandre Lara da594b87a4 Make loading placeholder colors match the current font color (https://github.com/woocommerce/woocommerce-blocks/pull/7658)
* Make loading placeholder colors match the current font color

Currently, the loading placeholder effect has a default gray color. However, since users can modify their themes with the Site Editor and choose a different set of colors for their websites, it would be interesting to make those placeholders match the color palette.

In this commit, the idea was to modify the `placeholder` mixin to replace the transparent font color with the current color and also modify the background-color and the linear-gradient to match the current font color. Furthermore, transparency was added to the middle color of the linear-gradient so we can keep the loading animation close to what it currently is.

* Add opacity to placeholder mixin

Before our changes, when the font color was dark, we had a lighter placeholder background color. After the changes the color is currently darker than before so the idea for this commit is to change the opacity of the placeholder in a way that the current color blends with the background color set for the theme.

* Change placeholder mixin opacity

After testing different combinations of colors, we decided to change the opacity to 0.15 so when the font color is darker the placeholder will have a lighter background color.

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-15 18:08:44 -03:00
Alex Florisca bf8d56ec72 Refactor the payment status (https://github.com/woocommerce/woocommerce-blocks/pull/7666)
* Add actions and selectors for new paymemt status

* Remove set_complete from reducer

* Replace all usages of getCurrentStatus with specific sepectors

* Replace all `setCurrentStatus` with individual actions

* Update docs

* Removed currentStatus

* bot: update checkstyle.xml

* Update docs/third-party-developers/extensibility/data-store/payment.md

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

* Address Thomas feedback

* Add link to deprecated message

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-11-15 12:27:39 +00:00
Niels Lange 6d60ce501f Convert product-elements/stock-indicator to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7567)
* Convert product-elements/stock-indicator to TypeScript

* bot: update checkstyle.xml

* Add interface for blockAttributes

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-15 06:16:02 +07:00
Niels Lange 94734a968b Bump version number of @types/wordpress__blocks (https://github.com/woocommerce/woocommerce-blocks/pull/7674)
* Bump version number of @types/wordpress__blocks

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-14 18:58:01 +07:00
Alba Rincón 5aae9940cb Merge branch 'release/8.9.0' of github.com:woocommerce/woocommerce-blocks into trunk 2022-11-14 10:22:21 +01:00
github-actions[bot] 8270730298 Release: 8.9.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7670)
* Empty commit for release pull request

* Display correct block template when filtering by attribute (https://github.com/woocommerce/woocommerce-blocks/pull/7640)

* Fix error when trying to access the queried object when it's null (https://github.com/woocommerce/woocommerce-blocks/pull/7664)

* Fix error when trying to access the queried object when it's null.

* Check if the `slug` exists

* Use the taxonomy name instead of the slug, otherwise it returns false

* Update readme changelog

* Add testing notes

* Improve testing notes format

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2022-11-14 10:08:53 +01:00
Alex Florisca fc44b9fc4d Remove the experimental flag that's used to include thunks in wp.data (https://github.com/woocommerce/woocommerce-blocks/pull/7617)
* Remove the experimental flag that's used to include thunks in wp.data

* bot: update checkstyle.xml

* Fix ts error from previous PR

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-14 09:07:49 +00:00
dependabot[bot] 9a7f1e17e1 Bump @woocommerce/eslint-plugin from 2.0.0 to 2.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6837)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-12 02:14:18 +07:00
Alba Rincón 54c65287ed Fix error when trying to access the queried object when it's null (https://github.com/woocommerce/woocommerce-blocks/pull/7664)
* Fix error when trying to access the queried object when it's null.

* Check if the `slug` exists

* Use the taxonomy name instead of the slug, otherwise it returns false
2022-11-11 17:16:40 +01:00
Albert Juhé Lluveras 4c06377e47 Display correct block template when filtering by attribute (https://github.com/woocommerce/woocommerce-blocks/pull/7640) 2022-11-11 11:32:40 +01:00
Daniel W. Robert 37a6b2ef63 Add Product Query Support for Atomic SKU Block (https://github.com/woocommerce/woocommerce-blocks/pull/7385)
* Add attributes, settings, and editor PQ settings.

- Adds isDescendentOfQueryLoop attribute and sets up usage in editor.
- Connects Context (via useContext) in editor.
- Sets up necessary hierarchy in block index file settings.

* Update parent inner blocks config.

Reassign parent array to ancestor array which allows for blocks to be
included with more flexibility - i.e., added within groups that are
children of the ancestor block.

* Add dynamic render function for PQ support.

* Update to use correct classnames on PHP side.

SSR markup was accidentally using rating classname instead of sku so it
was not applying the proper text transform seen in the editor.

* Rename BlockAttributes type to Attributes

This keeps things consistent with the type naming on the other blocks.

* Remove redundant spread of sharedConfig object.

We don't need to spread the `sharedConfig` object into the `blockConfig`
object when defining `blockConfig` since we spread/merge these two
objects when registering the block via `registerExperimentalBlockType`.

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* Empty commit to trigger checks.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-10 13:32:07 -05:00
Alex Florisca 9fa34effce Remove paymentStatuses, isDoingExpressPayment and isExpressPaymentMethodActive from the payment store state (https://github.com/woocommerce/woocommerce-blocks/pull/7643)
* Remove isExpressPaymentMethodActive and paymentStatus.isDoingExpressPayment from the payment store

* Remove uneccessary paymentStatuses key from the payments store
2022-11-10 16:15:31 +00:00
Alex Florisca c52dc91f67 Update from deprecated registerStore to register for data stores (https://github.com/woocommerce/woocommerce-blocks/pull/7310)
* Update from deprecated registerStore to register for data stores

* Rollback cart changes

* bot: update checkstyle.xml

* Explain keeping the deprecated "registerStore"

Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-11-10 15:37:01 +00:00
Mike Jolley 25b4e18df2 Remove UPDATE_LEGACY_CART_FRAGMENTS (https://github.com/woocommerce/woocommerce-blocks/pull/7644)
* Remove UPDATE_LEGACY_CART_FRAGMENTS

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-10 11:41:00 +00:00
Paulo Arromba 7eeabeea69 Updated rate-limiting example snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7650) 2022-11-10 11:39:46 +00:00
Thomas Roberts 32c402413a Update ValidatedTextInput TypeScript & move to `@woocommerce/blocks-checkout` (https://github.com/woocommerce/woocommerce-blocks/pull/7583)
* Move ValidatedTextInput and ValidationInputError to checkout package

* Include checkout package in tsconfig file

* Remove unnecessary index file

We export these components from packages/checkout/index.js instead

* Import ValidatedTextInput & ValidationInput error from checkout package

* Only add validationError.message when validationError is an object

* Explicitly add undefined to optional props

* Import isObject to test validationError

* Extend the HTML Input element attributes

* Use more performant useDispatch instead of dispatch

* Export component without withInstanceId hoc for testing

* Add tests for ValidatedTextInput

* bot: update checkstyle.xml

* Rename export of unwrapped component to have __

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-10 02:05:41 -08:00
Tarun Vijwani 4f75d12188 Add woocommerce_blocks_loaded hook information to actions doc (https://github.com/woocommerce/woocommerce-blocks/pull/7600)
* Add woocommerce_blocks_loaded hook information to actions doc

* add docs to woocommerce_blocks_loaded hook inline

* fix docs

* Switch to updated wp-hooks/generator package

* Prevent syntax error in doc script from storeapi.php

* Remove footer from internal docs and examples

* Doc footer script should ignore examples and internal developer docs

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-11-10 09:52:04 +01:00
Paulo Arromba f857afae0f Add PHP8 Unit Testing (https://github.com/woocommerce/woocommerce-blocks/pull/7528)
* fixed method sig

* Updated to @wordpress/env@5.5.0 and set default PHP 7.4 for wp-env.

* updated Coding Standards flow to use PHP 8.0

* Added comment to E2E flows explaining what PHP version is used

* Revert "Updated to @wordpress/env@5.5.0 and set default PHP 7.4 for wp-env."

This reverts commit 696cd7f42edc9d9726b777cf4f83a501a6d63936.

* Added comment to Unit test flows explaining what PHP version is used.
Specified PHP version on .wp-env.json

* Fixed composer-lock.json version.

* Updated tests to run on PHP Unit 9.2.6

* Updated tests to run on PHP 8

* Reverted test, mismatched results between local and pipeline

* Removed Todo

* Updated platform overrides

* Update Migrationb tests with Mockery for PHP8 compat

* try at PHP unit flow matrix

* Fix blocks.ini invalid config

* Temp disable E2E

* Downgraded woocommerce/woocommerce-sniffs as it introduced new sniffs we should be handling on a different PR

* re-enable E2E tests

* blocks.ini fix

* revert blocks.ini fix

* Update @wordpress/env

* remove .htaccess mapping

* Fix permissions for tests

* Debug permissions

* Attempt at perm fix

* Attempt at perm fix

* Downgraded @wordpress/env

* Another attempt at upgrade @wordpress/env

* Attempt at cleaning wp-env before run

* Attempt at destroying wp-env before run. Disabled E2E.

* Attempt at destroying wp-env before run.

* debug wp-env data

* attempt at deleting wp-env data (destroy won't work due to prompt)

* re-enable E2E

* Fix deprecation warnings

* Cleaned wp-env data for E2E

* Fix perms for E2E

* Updated RateLimitsTests

* debug

* Force 7.4 for wp-env

* Run sh outside of npm

* Reverted E2E flow

* reverted wp-env-config.sh debug test

* reverted .wp-env.json phpVersion force

* Update tests/php/StoreApi/Utilities/ProductQueryFilters.php

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

* Update tests/php/StoreApi/Routes/CartExtensions.php

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

* Update tests/php/StoreApi/Routes/CartItems.php

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

* Update tests/php/StoreApi/Routes/Products.php

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

* Update tests/php/StoreApi/Routes/ProductCollectionData.php

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

* Update tests/php/StoreApi/Routes/Batch.php

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

* Update tests/php/StoreApi/Routes/Checkout.php

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

* Update tests/php/StoreApi/Routes/CartCoupons.php

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

* Update tests/php/StoreApi/Routes/ProductAttributes.php

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

* Update tests/php/StoreApi/Routes/Cart.php

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

* downgraded @wordpress/env to v4

* Reverted back to reflection class for pivate attribs manipulation on tests

* reverted JS unit testing job name

* Update tests/php/StoreApi/Formatters/TestMoneyFormatter.php

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

* Typo fix

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-11-09 15:28:08 +00:00
Luigi Teschio 4947193eec TS monitor: Update comment instead of create a new one (https://github.com/woocommerce/woocommerce-blocks/pull/7593)
* Monitor TS: Update comment instead of create a new one

* Monitor TS: Update comment instead of create a new one
2022-11-09 15:42:04 +01:00
Alba Rincón 8df15079d0 Revert "Add milestone only when the PR is merged (https://github.com/woocommerce/woocommerce-blocks/pull/7544)" (https://github.com/woocommerce/woocommerce-blocks/pull/7636)
This reverts commit 2109f34275.
2022-11-09 11:59:23 +01:00
Thomas Roberts 6252b951e3 Fix TypeScript errors in `CartLineItemRow` (https://github.com/woocommerce/woocommerce-blocks/pull/7605)
* Import Currency type from correct location

* Add type for productPriceValidation argument

* Default tabIndex to undefined

null is not an acceptable value for the tabIndex prop, but undefined is, so we should use that.

* Explicitly set type of CartLineItemRow to ForwardRefExoticComponent

* bot: update checkstyle.xml

* Change CartLineItemRow to extend React.RefAttributes

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-09 02:26:28 -08:00
Alba Rincón 9ae1f91440 Update to next dev version 2022-11-09 10:38:57 +01:00
Alba Rincón 2109f34275 Add milestone only when the PR is merged (https://github.com/woocommerce/woocommerce-blocks/pull/7544) 2022-11-09 09:59:56 +01:00
Tung Du fc4ce6dac6 E2E: Product Query: Testing atomic blocks (https://github.com/woocommerce/woocommerce-blocks/pull/7482)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-09 08:53:26 +07:00
Kathy ddf8e56cc9 Add the option of providing a custom class for the product details on the Cart Block
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-11-08 16:57:52 +00:00
Albert Juhé Lluveras f65b0f64e4 Add a link to check WC core minimum WP supported version in the release checklist (https://github.com/woocommerce/woocommerce-blocks/pull/7598)
* Add a link to check WC core minimum WP supported version in the release checklist

* Rephrase
2022-11-08 14:35:13 +01:00
Alba Rincón 013ce2b9af Update to next dev version 2022-11-08 13:36:59 +01:00
github-actions[bot] 371f5980bb Release: 8.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7596)
* Empty commit for release pull request

* Update readme changelog

* Bump versions

* Bump versions

* Fix the minimum_supported_wp_version

* Update readme.txt

* Add testing instructions

* Change Filter Wrapper to Filter Block

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

* Remove Light from test instructions

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

* Fix version

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

* Remove experimental section

* Improve formatting of instructions

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-11-08 13:30:03 +01:00
Alba Rincón b8e0283d5b Bumping version strings to new version. 2022-11-08 12:08:01 +01:00
Luigi Teschio 190ab45d26 fix markdown linter (https://github.com/woocommerce/woocommerce-blocks/pull/7597) 2022-11-08 10:26:47 +01:00
Alba Rincón bf8ad6e592 Improve formatting of instructions 2022-11-08 09:54:27 +01:00
Tung Du 7467be8605 Fix: use correct type specifier for rating HTML (https://github.com/woocommerce/woocommerce-blocks/pull/7592) 2022-11-08 15:34:08 +07:00
dependabot[bot] 9a2a4f5c9f Bump wp-phpunit/wp-phpunit from 6.0.3 to 6.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7602)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-08 15:23:14 +07:00
Alba Rincón 0e5cb3efdd Remove experimental section 2022-11-08 08:42:09 +01:00
Alba Rincón 2770520bb2 Fix version
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-11-08 08:41:32 +01:00
Alba Rincón 9941a26aa0 Remove Light from test instructions
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-11-08 08:41:15 +01:00
Alba Rincón d6d3793c6d Change Filter Wrapper to Filter Block
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-11-08 08:40:56 +01:00
Alba Rincón b3abf6bcd0 Add testing instructions 2022-11-07 16:42:46 +01:00
Alba Rincón 478cddb1ec Update readme.txt 2022-11-07 16:40:31 +01:00
Alba Rincón 97bc2844e9 Fix the minimum_supported_wp_version 2022-11-07 15:59:05 +01:00
Alba Rincón a466981a39 Bump versions 2022-11-07 15:39:27 +01:00
Alba Rincón 12ae36f187 Bump versions 2022-11-07 15:19:32 +01:00
Alba Rincón 5c8419a79f Update readme changelog 2022-11-07 15:04:49 +01:00
Daniel W. Robert 00c3396184 Fix Price Block Inserter Visibility (https://github.com/woocommerce/woocommerce-blocks/pull/7559)
* Remove `parent` from block config.

By removing the `parent` property from the block config, we can have
more flexibility to where we can use the pricing block - i.e., it does
not need to be a direct descendent of a `core/group` block.

* Remove unused save function/file.

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2022-11-07 14:09:26 +01:00
Thomas Roberts f0405c9ffc Update notices documentation (https://github.com/woocommerce/woocommerce-blocks/pull/7539)
* Update notices docs

* Remove reference to Notices Context

* Remove manual linebreaks
2022-11-07 02:49:15 -08:00
Thomas Roberts 3e6aaf47b3 Fix E2E errors with debounced `updatePaymentMethods` function (https://github.com/woocommerce/woocommerce-blocks/pull/7507)
* Add non-debounced versions of updatePaymentMethods

* Call undebounced function until store is ready then call debounced

* Reset debounce timer to 1 second

* Add better comments

* Try setting the trail setting of the debounce function

* Revert "Try setting the trail setting of the debounce function"

This reverts commit 040fb63cb612c19ac396396d1949b6429f402616.

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-11-07 02:48:27 -08:00
Mike Jolley 3c6a365697 Store API: Add missing documentation for reviews, categories, and tags (https://github.com/woocommerce/woocommerce-blocks/pull/7519)
* Update index

* Add missing docs
2022-11-07 10:37:00 +00:00
Niels Lange 7b84be1156 Convert product-elements/summary to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7566)
* Convert product-elements/summary to TypeScript

* bot: update checkstyle.xml

* Update assets/js/atomic/blocks/product-elements/summary/index.ts

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

* Resolve introduced TS error

* bot: update checkstyle.xml

* Remove default subproperties

* Add TODO to refactor this part in the future

* Make attribute type more strict

* Add more context to the todo regarding removing the HOC

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-11-07 16:50:15 +07:00
dependabot[bot] 2a3a39bdcd Bump automattic/jetpack-autoloader from 2.11.10 to 2.11.11 (https://github.com/woocommerce/woocommerce-blocks/pull/7549)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 09:19:36 +07:00
dependabot[bot] 173738b885 Bump WebFreak001/deploy-nightly from 1.1.0 to 1.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7557)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 08:43:25 +07:00
Alexandre Lara ab55341361 Prevent padding from placeholder instructions to be overriden (https://github.com/woocommerce/woocommerce-blocks/pull/7552)
* Prevent padding from placeholder instructions to be overriden

Inside the AttributeFilter component we are using a component Placeholder from the @wordpress/components library. This component has its own styles applied to itself including the part related to the instructions that are displayed.

Currently there is no way to override the styles specifically for the instructions part so the only possible way is to force the style to be applied over the inner styles set by the Placeholder component.

* Add a wrapper to the instructions content and apply the styles to it

The initial idea was to force the style to be applied by using `!important` on the padding-bottom property. However, after discussing more about it, it was decided that a better alternative is to add the instructions content to the body of the Placeholder content instead of relying on the `instructions` prop of the component.

This way, instead of forcing the style to be applied which could cause some side effects in the future, we are wrapping the instructions content in an HTML element that we control and, thus, can modify the styles independently of the external library it's being used (@wordpress/components).
2022-11-04 15:22:40 -03:00
Mike Jolley 07a612f575 Experiment: Add Rate Limits to Store API (https://github.com/woocommerce/woocommerce-blocks/pull/5962)
* Add rate limiting to cart endpoints based on session

* Handle nonce and rate checks in permission_callback

* Rate limit checkout only

* Debug

* Unused AbstractRoute

* Code standards

* Modify core rate limit table

* Add rate limit at rest api level, not route level

* Rate limit helper

* Remove rate limit from routes

* Usused dep

* Remove custom error logic no longer needed

* Remove dependency

* Remove custom permission_callback

* Hash IP and handle null

* Remove error response handler

* revert error_to_response changes

* Remove add_response_headers

* Remove IDENTIFIER

* Remove white space

* Increase limit

* Missing class comment

* Move rate limiting code within store api codebase

* white space

* Fix return type

* Check rate limit expiry greater than now

* Remove x- prefix

* reorder functions

* remove table

* pass request to add_nonce_headers

* return early and avoid elseif on AbstractCartRoute:get_response()

* Refactor get_ip_address() before implementing options for functionality

* Change rate limit to 5 requests

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

* Change rate limit window to 60 seconds

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

* Disable rate limiting by default

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

* Updated limits comment

* Example for Forwarded header

* Updated "woocommerce_store_api_enable_rate_limit_check" filter doc

* Added filter for the Store API rate limit check proxy support

* Add an action here that carries over the IP address being blocked.

* Added logic around setting the action_id, and returns an error when ip cannot be determined for users not logged in.

* Renamed action for limit exceeded.

* Common rate limiting header naming prefix, and fixed comment typos.

* Doc for Rate Limiting (wip)

* Example for Rate Limiting docs

* Remove private IP range block for rate limiting

* Refactored get_response() to add nonce headers to response instead of request

* Disable batching for Checkout calls to prevent bypassing Rate Limiting.

* Removed redundant arg.

* package-lock.json update

* Removed repeated func calls.

* Fix failing tests.

* Tests wip.

* Request limit and timeframe are now constants for RateLimits utility class.

* Tests for Rate Limit headers.

* Reverted PHPUnit config to enable all tests again.

* Update src/StoreApi/Authentication.php comment wording

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

* Removed possibly unnecessary get_ip_address() call.

* Changed wording on comment for get_ip_address() method.

* Simplified validate_ip() method.

* Fixed wrong header entry for "Forwarded" check.

* Unit testing for Authentication::get_ip_address()

* Comment explaining the reason to use ReflectionClass for testing get_ip_address().

* Support for error output outside batch request.

* MD linting.

* Refactor to implement options through a single filter.

* fixed md lint error and config file

* reverted accidental default func arg value removal

* re-enabled batch support for checkout

* action for limit exceed now also triggered in case we can't resolve the IP.

* Doc tweak.

* Return unresolved IP address when REMOTE_ADDR isn't set with proxy support disabled.

* Group unresolved ips for rate limiting

* Fixed bug where current limit wasn't properly initialized.

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-11-04 15:53:00 +00:00
Alba Rincón 1884040a6a Fix menus on 'large', 'simple' and 'with 2 menus' footers (https://github.com/woocommerce/woocommerce-blocks/pull/7579)
* Fix menus on simple and with 2 menus footers

* Fix large menu
2022-11-04 16:14:44 +01:00
Daniel Dudzic ca1e65cbef Filter by Rating: Remove the Feature Plugin flag (https://github.com/woocommerce/woocommerce-blocks/pull/7580)
* Filter by Rating: Remove the Feature Plugin flag
2022-11-04 15:53:16 +01:00
Daniel Dudzic da0a5157bf Active Filters: Fix active filter grouping for Ratings and Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7577)
* Active Filters: Fix active filter grouping for Ratings and Stock Status

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-04 13:30:33 +01:00
Alba Rincón 8e7718a36a Set a the color as white for the dark header/footer patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7524)
* Set a the color as white for the dark header/footer patterns

That way we make sure they will be visible no matter which theme is active.

* Adapt light patterns to inherit colors from theme

* Remove light from pattern names and color from social icons

* Make links inherit color

* Remove background

* Remove wp:page-list

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

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-11-04 11:59:20 +01:00
Raluca Stan 86a3997463 Update release checklists to include checks for WC PR (https://github.com/woocommerce/woocommerce-blocks/pull/7442)
* Update release-initial-checklist.md

* Revert "Update release-initial-checklist.md"

This reverts commit 757c96b9b4950afc0439b1ea3acdd7fee563d954.

* Fix lint errors

* Update with user facing documentation

* Apply suggestions from code review

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

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-11-04 11:05:02 +01:00
Daniel Dudzic 2e7b0acce2 Filter by Rating: Add E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/7575)
* Filter by Rating: Add E2E tests
* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-04 10:41:53 +01:00
Albert Juhé Lluveras 36e41cce03 Improvements to the 'Update user-facing documentation as needed' step in the release checklist (https://github.com/woocommerce/woocommerce-blocks/pull/7520)
* Remove 'update documentation' step from patch release checklist

* Make 'update documentation' a parent step in the release checklist

* Update .github/release-initial-checklist.md

Co-authored-by: Raluca Stan <ralucastn@gmail.com>

Co-authored-by: Raluca Stan <ralucastn@gmail.com>
2022-11-03 12:16:51 +01:00
Niels Lange 5300530428 Update ProductSchema description for attributes (https://github.com/woocommerce/woocommerce-blocks/pull/7495) 2022-11-03 11:16:01 +07:00
Alba Rincón 6ca9f90c44 Fix ESLint errors (https://github.com/woocommerce/woocommerce-blocks/pull/7556)
* Add type to imports that need it

* Add type to imports that need it

* Fix the sanitize lint error

* Include missing dep

* Remove check from deps

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-02 17:46:14 +01:00
Luigi Teschio a79bfba32c Run Monitor TypeScript job on trunk branch (https://github.com/woocommerce/woocommerce-blocks/pull/7571)
* run job on trunk branch

* bot: update checkstyle.xml

* try now

* try now

* remove logging

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-02 12:43:14 +01:00
Luigi Teschio fa1e644b81 Run Monitor TypeScript job on trunk branch (https://github.com/woocommerce/woocommerce-blocks/pull/7570)
* run job on trunk branch

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-02 12:10:33 +01:00
Luigi Teschio 5dc48d70b7 run job on trunk branch (https://github.com/woocommerce/woocommerce-blocks/pull/7569) 2022-11-02 11:58:03 +01:00
Luigi Teschio 6bbf96d06a Add CI for monitoring TypeScript errors (https://github.com/woocommerce/woocommerce-blocks/pull/6106)
* Add a action that monitors TypeScript errors woocommerce/woocommerce-blocks#6068

Add a action that monitors TypeScript errors

* address feedback

* bot: update checkstyle.xml

* add @bartekbp/typescript-checkstyle as devDeps

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* bot: update checkstyle.xml

* fix

* add checkstyle to .distignore

* add missing import

* address feedback

* fix error

* remove import

* fix name variable

* fix sort function

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-11-02 11:41:10 +01:00
Thomas Roberts 6f85ab593f Use backslashes to fix webpack build on windows (https://github.com/woocommerce/woocommerce-blocks/pull/6798)
* Use backslashes to fix webpack build on windows

* Update regex to use square brackets, and update copywebpack path for Windows

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-11-02 03:24:19 -07:00
Luigi Teschio 27f9c746ea [Product Query] Fix filter block data counter (https://github.com/woocommerce/woocommerce-blocks/pull/7257)
* Product Query: Fix pagination issue

* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Price Block

* fix query relation

* fix on sale query

* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Attributes block

* fix bugged pagination and on-sale filter after refactor

* address feedback

* Product Query - Add support for the Filter By Stock Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Stock Block

* Fix filter blocks: the data (e.g: max price or stock-status) match the variation woocommerce/woocommerce-blocks#7245

fix filter blocks: the data (e.g: max price or stock-status) match the variation

* disable phcs rules on top of the file

* replace parameter name

* fix eslint error
2022-11-02 10:03:23 +01:00
Luigi Teschio bec05d1062 [Product Query] Add support for the Filter Products By Stock block (https://github.com/woocommerce/woocommerce-blocks/pull/7251)
* Product Query: Fix pagination issue

* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Price Block

* fix query relation

* fix on sale query

* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Attributes block

* fix bugged pagination and on-sale filter after refactor

* address feedback

* Product Query - Add support for the Filter By Stock Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Stock Block

* address feedback
2022-11-02 09:49:48 +01:00
Tung Du 74d5bde275 Fix: add missing export for Product Sale Badge (https://github.com/woocommerce/woocommerce-blocks/pull/7564) 2022-11-02 15:48:54 +07:00
Niels Lange c0ee82c2dd Convert product-elements/tag-list to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7538) 2022-11-02 14:47:34 +07:00
Niels Lange 50ff8bde79 Convert product-elements/sku to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7533)
* Convert product-element/sku to TypeScript

* Change “import” to “import type”

* Remove obsolete JSDocs

* Improve interface naming

* Correct interface reference
2022-11-02 13:48:27 +07:00
Niels Lange 14a35c6722 Convert product-elements/sale-badge to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7543) 2022-11-02 13:30:58 +07:00
Daniel W. Robert fdc07e5a96 Add Product Query Support for Atomic Rating Block (https://github.com/woocommerce/woocommerce-blocks/pull/7352)
* Add PQ support for client-side.

Set up the block for PQ support and add necessary adjustments for the
editor. Will address dynamic save functionality in a following commit.

* Add dynamic render function for PQ support.

* Add dynamic render callback for SSR.

* Remove client-side Save function.

* Add PQ Context interface to shared type defs.

* Convert all block JS files to TS.

* Remove commented import from block file.

* Add typecasting to block function params.

As a workaround, added a general Record type but left a TODO to revisit
the proper object, as there is a mismatch in the shape of the default
object property types and the actual types.

* Update inserter behavior.

Allows for the ability to add the rating block from in the inserter
(as long as it's an inner block of the listed parents in the config).
Also disables the placeholder product selector from being rendered
unnecessarily (i.e., when the context ID is present).

* Update parent inner blocks config.

Reassign parent array to ancestor array which allows for blocks to be
included with more flexibility - i.e., added within groups that are
children of the ancestor block.

* Add productID to rating Attributes interface.

* TS type casting and import adustments.

Some adjustments to utilize types that we already have available, along
with some syntax adjustments and more sensible import tweaks.

* Update type-casting to use ProductResponseItem

Instead of using the generic Record, we can utilize the
ProductResponseItem interface and set an omission for the average_rating
property until that is corrected to properly reflect the API response.

* Add alias to blocks dir for imports.

Allows us to use exports from the blocks dir as "external" imports. This
way we do not need to write long, relative import paths (which can be
fragile in the long run).
2022-10-31 14:56:17 -04:00
Albert Juhé Lluveras a5f1229a6a Fix typo in 8.8.2 changelog (https://github.com/woocommerce/woocommerce-blocks/pull/7545) 2022-10-31 16:43:02 +01:00
Luigi c01b00dd8f Merge branch 'release/8.8.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-10-31 16:15:07 +01:00
Luigi 36cdd426d8 Merge branch 'release/8.5.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-10-31 16:13:20 +01:00
github-actions[bot] 1d71da7162 Release: 8.5.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7535)
* use full link for WordPress resources (https://github.com/woocommerce/woocommerce-blocks/pull/7211)

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

* Empty commit for release pull request

* update readme

* add testing instructions

* add zip file link

* update testing instructions and changelog entry

* Bumping version strings to new version.

* Empty commit for release pull request

* Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506)

* Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)

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

* Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)

* Fixed Price Slider Issue

Located where the price slider was hard coded and replaced it.

* fix CSS lint

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* remove background-color

Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>

* Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525)

* Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)

* fix inconsistent button styling with TT3

* use wc_wp_theme_get_element_class_name

* add check to be sure that wc_wp_theme_get_element_class_name function exists

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379

Fix Mini Cart Block global styles

* add font_size

* Empty commit for release pull request

* add changelog and testing instructions

* add zip link for testing

* Bumping version strings to new version.

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
2022-10-31 16:10:27 +01:00
github-actions[bot] 7be0994ed6 Release: 8.8.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7542)
* Empty commit for release pull request

* Calculate cart totals after running extensions (https://github.com/woocommerce/woocommerce-blocks/pull/7490)

* calculate cart totals afer running extensions

* update totlas call in CartUpdateCustomer

* test that cart is recalcing

* Update changelog in readme

* Add release testing notes

* Update release date in readme

* Bumping version strings to new version.

* update readme

* Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506)

* Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)

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

* Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)

* Fixed Price Slider Issue

Located where the price slider was hard coded and replaced it.

* fix CSS lint

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* remove background-color

Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>

* Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525)

* Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)

* fix inconsistent button styling with TT3

* use wc_wp_theme_get_element_class_name

* add check to be sure that wc_wp_theme_get_element_class_name function exists

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379

Fix Mini Cart Block global styles

* add font_size

* upload a new build

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-31 16:07:17 +01:00
Luigi c922c99538 Merge branch 'release/8.7.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-10-31 15:59:14 +01:00
github-actions[bot] 5d3bd76eb3 Release: 8.7.5 (https://github.com/woocommerce/woocommerce-blocks/pull/7541)
* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)

* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor

* Updated readme.txt

* Reverted stable tag change on readme.txt

* Testing instructions

* Cleaned out testing instructions

* Bumping version strings to new version.

* Empty commit for release pull request

* Testing instructions

* package-lock.json version bump

* Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)

This reverts commit 25e24708b5.

* Testing zip

* Bumping version strings to new version.

* add testing instructions

* upload a new zip file

* Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506)

* Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)

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

* Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)

* Fixed Price Slider Issue

Located where the price slider was hard coded and replaced it.

* fix CSS lint

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* remove background-color

Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>

* Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525)

* Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)

* fix inconsistent button styling with TT3

* use wc_wp_theme_get_element_class_name

* add check to be sure that wc_wp_theme_get_element_class_name function exists

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379

Fix Mini Cart Block global styles

* add font_size

* upload a new build

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
2022-10-31 15:55:28 +01:00
Manish Menaria ec7573790f Fix storybook build failing issues (https://github.com/woocommerce/woocommerce-blocks/pull/7514)
* Fix storybook build failing issues

Storybook build was failing because of 2 issues:
1. Can't import the named export 'Fragment' from non EcmaScript module (only default export is available)
I used solution provided in following comment:
https://github.com/storybookjs/storybook/issues/16690#issuecomment-971579785

This issue comes from the framer-motion library.

2. SassError: Can't find stylesheet to import.
To fixe this issue I have updated the path in import statements.
**Before**
```
@import "@wordpress/base-styles/breakpoints";
@import "@wordpress/base-styles/mixins";
@import "wordpress-components/src/popover/style";
@import "wordpress-components/src/tooltip/style";
```
**After**
```
@import "node_modules/@wordpress/base-styles/breakpoints";
@import "node_modules/@wordpress/base-styles/mixins";
@import "node_modules/wordpress-components/src/popover/style";
@import "node_modules/wordpress-components/src/tooltip/style";
```

* Add a comment to explain why webpackFinal block was added
2022-10-31 16:53:22 +05:30
Luigi Teschio 87d527cf2c Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)
* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379

Fix Mini Cart Block global styles

* add font_size
2022-10-31 11:47:01 +01:00
Daniel Dudzic aaa408e8dd Product button: Fix 'In cart' button localization. (https://github.com/woocommerce/woocommerce-blocks/pull/7504)
Fixes woocommerce/woocommerce-blocks#7494.

Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-29 01:42:07 +02:00
Luigi Teschio 030ebf8142 Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)
* fix inconsistent button styling with TT3

* use wc_wp_theme_get_element_class_name

* add check to be sure that wc_wp_theme_get_element_class_name function exists
2022-10-28 19:07:56 +02:00
Albert Juhé Lluveras 7dd32d73c4 Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525) 2022-10-28 18:39:06 +02:00
Alex Florisca f23f500388 Add a workflow for building nightly releases of the repo (https://github.com/woocommerce/woocommerce-blocks/pull/7480)
* Add a workflow for building nightly releases of the repo

* Added comment explaining where the release id comes from

* Update comment about id with the right id - doh

* Only deploy to wordpress.org for releases not pre-releases
2022-10-28 17:20:18 +01:00
Luigi Teschio 01c4b774f5 Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)
* Fixed Price Slider Issue

Located where the price slider was hard coded and replaced it.

* fix CSS lint

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* remove background-color

Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-28 17:53:25 +02:00
Tung Du 6c42a30674 Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-10-28 22:30:51 +07:00
Mike Jolley dd053d618d Fix/flakey checkout tests (https://github.com/woocommerce/woocommerce-blocks/pull/7508)
* Update installed to setup crosssells for all matching products in case of duplicates

* Improve shopper utils to wait for page elements to render

* Taxes should wait for totals wrapper

* Use shopper.block.goToShop()

* Inline docs

* Wait for errors

* partial match please fill error
2022-10-28 13:41:28 +01:00
dependabot[bot] 1b54bf8a13 Bump wp-phpunit/wp-phpunit from 6.0.2 to 6.0.3 (https://github.com/woocommerce/woocommerce-blocks/pull/7471)
Bumps [wp-phpunit/wp-phpunit](https://github.com/wp-phpunit/wp-phpunit) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/wp-phpunit/wp-phpunit/releases)
- [Commits](https://github.com/wp-phpunit/wp-phpunit/compare/6.0.2...6.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2022-10-28 13:34:35 +02:00
Thomas Roberts 3a6b91b5e6 Merge branch 'release/8.8.0' into trunk 2022-10-28 12:16:45 +01:00
Thomas Roberts 0e75ab9edf Bumping version strings to new version. 2022-10-28 11:51:13 +01:00
Thomas Roberts 6c66c0d545 Update release date in readme 2022-10-28 11:50:04 +01:00
Manish Menaria 71e77e38e0 Disable apply button when there is no change to selected filters (https://github.com/woocommerce/woocommerce-blocks/pull/7373)
* Disable apply button when there is no change to selected options

More info: https://github.com/woocommerce/woocommerce-blocks/issues/7116

* Add tests to the Filter Attribute block

Since we are making changes to the Filter Attributes block to fix issue woocommerce/woocommerce-blocks#7373, we are also adding tests to make sure the changes are providing the expected behavior

The setup-globals file was changed to add 'attributes' and 'has_filterable_products' properties to it, so it can be used in the tests.

* Merge test utils methods with attribute filter block

Removing test utils file and merging the methods with the Attribute Filter block to prevent tests from failing due to Jest configuration that only allow test files to exists inside a 'test' folder

* Remove checked.length === 0 condition

**Why was this condition needed before?**
Because when the user initially load the page, no filter is selected therefore we needed this condition to keep the Apply disabled in this case.

**Why we don't need it anymore?**
Because now in this PR we add following code:
```jsx
const activeFilters = getActiveFilters( attributeObject );
if ( activeFilters.length === checked.length ) {
	return checked.every( ( value ) =>
		activeFilters.includes( value )
	);
}
```
This will return `true` when the user initially loads the page & Apply button will become disabled. Therefore, I believe it's safe to remove `checked.length === 0` condition.

More info: https://github.com/woocommerce/woocommerce-blocks/pull/7373#discussion_r994737313

* Add filterSize param to test setup

With this configuration, it is now possible to modify the current filter size in order to improve tests

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2022-10-28 12:08:21 +05:30
Lucio Giannotta af557b0281 Add Stock Status setting to Product Query Block (https://github.com/woocommerce/woocommerce-blocks/pull/7397)
* Add Stock Status to Product Query block filters

Creates a new Tools Panel called “Product filters” where we can neatly
organize our product specific settings. Eventually, this panel could be
merged with the core “Filters” panel; however, at the time of this
commit, this is impossible (see WordPress/gutenbergwoocommerce/woocommerce-blocks#43684 for a PoC).

Also moved the “On Sale” setting under this newly created panel.

* Add `resetAll` callback for the new Tools Panel

Tools Panels come with a “Reset All” functionality, that's supposed to
return all the settings to their original state.

In our case, things are a bit more complicated, as the original state
is dependant on the current variation, so it can't be hard-coded like it
is on the core block.
2022-10-27 19:40:10 +02:00
Albert Juhé Lluveras 0b6d76ce2d Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506) 2022-10-27 17:09:02 +02:00
Thomas Roberts 14f5c597f6 Add release testing notes 2022-10-27 16:08:49 +01:00
Thomas Roberts 6ae7df7e4a Update changelog in readme 2022-10-27 15:48:28 +01:00
Seghir Nadir 2cb9a9e4bd Calculate cart totals after running extensions (https://github.com/woocommerce/woocommerce-blocks/pull/7490)
* calculate cart totals afer running extensions

* update totlas call in CartUpdateCustomer

* test that cart is recalcing
2022-10-27 15:40:27 +01:00
Seghir Nadir 030b6f05a8 Calculate cart totals after running extensions (https://github.com/woocommerce/woocommerce-blocks/pull/7490)
* calculate cart totals afer running extensions

* update totlas call in CartUpdateCustomer

* test that cart is recalcing
2022-10-27 15:29:27 +01:00
Raluca Stan 77e62c0edf Update README.md 2022-10-27 15:21:29 +02:00
Niels Lange 76d2616ff5 Remove “status: ready to merge” label after merge (https://github.com/woocommerce/woocommerce-blocks/pull/7456)
* Remove “status: ready to merge” label after merge

* Add GitHub Token

* Add helper file to test woocommerce/woocommerce-blocks#7456 (https://github.com/woocommerce/woocommerce-blocks/pull/7457)

* Adjust trigger

* Adjust trigger

* Update merged-with-labels.yml

* Remove helper file to test woocommerce/woocommerce-blocks#7456 (https://github.com/woocommerce/woocommerce-blocks/pull/7458)

* Add a test commit (https://github.com/woocommerce/woocommerce-blocks/pull/7493)

* Remove the test commit

* Test update (https://github.com/woocommerce/woocommerce-blocks/pull/7497)

* Revert "Test update (https://github.com/woocommerce/woocommerce-blocks/pull/7497)" (https://github.com/woocommerce/woocommerce-blocks/pull/7498)

This reverts commit 51c8638e71d00ac7ac5fc93cd2e36f884a3e4bc8.

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-10-27 17:29:12 +07:00
Tung Du 53e6a013a7 Restore block transform for filter blocks (https://github.com/woocommerce/woocommerce-blocks/pull/7401)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-10-27 15:41:35 +07:00
Luigi Teschio 1a9e5cfe13 [Product Query] Add support for the Filter Products By Attributes block (https://github.com/woocommerce/woocommerce-blocks/pull/7186)
* Product Query: Fix pagination issue

* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Price Block

* fix query relation

* fix on sale query

* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Attributes block

* fix bugged pagination and on-sale filter after refactor

* address feedback

* address feedback
2022-10-26 16:53:01 +02:00
Tung Du 6d636181c7 Performance: preload store pages (https://github.com/woocommerce/woocommerce-blocks/pull/6898) 2022-10-26 10:28:28 +07:00
Alex Florisca fd0ab2331b Improve the performance of checking payment methods (https://github.com/woocommerce/woocommerce-blocks/pull/7413)
* Improve the performance of checking payment methods

* Use the default names of imports from @wordpress/data

* Fix circular dependency

* Fix __internalUpdateAvailablePaymentMethods

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2022-10-25 14:21:11 +01:00
Thomas Roberts 9408e7a42e Update version numbers following release 2022-10-25 13:28:59 +01:00
Thomas Roberts 12df446ced Merge branch 'release/8.8.0' into trunk 2022-10-25 13:26:07 +01:00
Thomas Roberts c7ad51cf34 Bumping version strings to new version. 2022-10-25 12:45:41 +01:00
Thomas Roberts 3269f662a9 Update testing zip for release 2022-10-25 12:38:38 +01:00
Mike Jolley 3863202c70 Update Express Payment Block text (https://github.com/woocommerce/woocommerce-blocks/pull/7465)
* remove "in a hurry" text

* Improve button spacing
2022-10-25 12:12:27 +01:00
Tung Du b2b8705aa4 Fix failed E2E tests related to attribute filter block (https://github.com/woocommerce/woocommerce-blocks/pull/7472) 2022-10-25 10:15:17 +01:00
Tung Du 5e008ad058 Fix failed E2E tests related to attribute filter block (https://github.com/woocommerce/woocommerce-blocks/pull/7472) 2022-10-25 16:12:04 +07:00
Thomas Roberts d645de0b34 Add testing instructions for release 2022-10-24 13:10:46 +01:00
Thomas Roberts ef87417354 Remove closed unmerged PR from changelog 2022-10-24 12:54:22 +01:00
Thomas Roberts a221e0adff Remove closed unmerged PR from changelog 2022-10-24 12:50:45 +01:00
Thomas Roberts ef08a1dcdd Update readme changelog 2022-10-24 12:12:33 +01:00
Paulo Arromba f3a31a07b3 8.7.4 Testing instructions and changelog (https://github.com/woocommerce/woocommerce-blocks/pull/7450)
* Empty commit for release pull request

* Updated changelog.

* Minor lint fix.

* 8.7.0 Testing instructions

* Updated and tidy docs/internal-developers/testing/releases/README.md

* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)

* Set default style to link-button mixin

It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component

* Add new mixin for links in filter blocks

* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page

* Add filter-link-button mixin that can be used in filter blocks

* Remove link-button styles that were moved to filter-link-button mixin

By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.

The styles for link button in filter blocks should reside in filter-link-button mixin.

* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions

* Re-added woocommerce/woocommerce-blocks#7273 to changelog

* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)

* Correct block name and description

* remove duplicated description for controls blocks

* remove duplicated title and desc

* Revert "remove duplicated description for controls blocks"

This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.

* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog

* Updated testing zip package.

* Minor formatting fix on the release instructions

* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)

* Updated zip.

* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)

* remove problematic actions as deps

* add inline docs

* add todo comment

* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)

* Updated testing zip.

* Bumping version strings to new version.

* Empty commit for release pull request

* Release: 8.7.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7371)

* Empty commit for release pull request

* Updated changelog.

* Minor lint fix.

* 8.7.0 Testing instructions

* Updated and tidy docs/internal-developers/testing/releases/README.md

* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)

* Set default style to link-button mixin

It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component

* Add new mixin for links in filter blocks

* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page

* Add filter-link-button mixin that can be used in filter blocks

* Remove link-button styles that were moved to filter-link-button mixin

By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.

The styles for link button in filter blocks should reside in filter-link-button mixin.

* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions

* Re-added woocommerce/woocommerce-blocks#7273 to changelog

* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)

* Correct block name and description

* remove duplicated description for controls blocks

* remove duplicated title and desc

* Revert "remove duplicated description for controls blocks"

This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.

* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog

* Updated testing zip package.

* Minor formatting fix on the release instructions

* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)

* Updated zip.

* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)

* remove problematic actions as deps

* add inline docs

* add todo comment

* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)

* Updated testing zip.

* Bumping version strings to new version.

* Empty commit for release pull request

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>

* Release: 8.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7396)

* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>

* Release: 8.7.3 (https://github.com/woocommerce/woocommerce-blocks/pull/7439)

* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)

* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor

* Updated readme.txt

* Reverted stable tag change on readme.txt

* Testing instructions

* Cleaned out testing instructions

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Release: 8.7.4 (https://github.com/woocommerce/woocommerce-blocks/pull/7449)

* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)

* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor

* Updated readme.txt

* Reverted stable tag change on readme.txt

* Testing instructions

* Cleaned out testing instructions

* Bumping version strings to new version.

* Empty commit for release pull request

* Testing instructions

* package-lock.json version bump

* Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)

This reverts commit 25e24708b5.

* Testing zip

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-10-21 17:14:37 +01:00
github-actions[bot] 88b3fca9b5 Release: 8.7.4 (https://github.com/woocommerce/woocommerce-blocks/pull/7449)
* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)

* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor

* Updated readme.txt

* Reverted stable tag change on readme.txt

* Testing instructions

* Cleaned out testing instructions

* Bumping version strings to new version.

* Empty commit for release pull request

* Testing instructions

* package-lock.json version bump

* Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)

This reverts commit 25e24708b5.

* Testing zip

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-10-21 17:06:48 +01:00
Thomas Roberts 45542bb86a Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)
This reverts commit 25e24708b5.
2022-10-21 16:03:14 +01:00
Mike Jolley 350571a705 Replace wc()->api->get_endpoint_data with item response from the cart schema class. (https://github.com/woocommerce/woocommerce-blocks/pull/7361)
`wc()->api->get_endpoint_data` works, however, because it encodes and decodes from JSON, objects are lost and converted into arrays.

For the API is this not a problem, because they are output to JSON in the same way. For consumers however, they may be expecting object type.

We can fix this by getting the response data from the Cart Schema class directly.
2022-10-21 15:20:29 +01:00
Paulo Arromba 229c7a5f4a Release: 8.7.3 (https://github.com/woocommerce/woocommerce-blocks/pull/7439) (https://github.com/woocommerce/woocommerce-blocks/pull/7443)
* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)

* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor

* Updated readme.txt

* Reverted stable tag change on readme.txt

* Testing instructions

* Cleaned out testing instructions

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-10-21 12:02:21 +01:00
github-actions[bot] d779ccaf31 Release: 8.7.3 (https://github.com/woocommerce/woocommerce-blocks/pull/7439)
* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)

* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor

* Updated readme.txt

* Reverted stable tag change on readme.txt

* Testing instructions

* Cleaned out testing instructions

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-10-21 10:59:32 +01:00
Saad Tarhi 5129341ee5 Show sidebar notices only when a WooCommerce block is selected (https://github.com/woocommerce/woocommerce-blocks/pull/7435)
We where running the "withSidebarNotices" HOC each time the
"editor.BlockEdit" hook is fired. The problem is that this hook is
fired on page editor scroll, when hovering over the blocks, when a
block preview is loading, etc.

So, we only want the "withSidebarNotices" HOC to be executed when a Woo
Block in selected!
2022-10-20 20:17:26 +01:00
Thomas Roberts 1eda6f8f3d Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)
* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor
2022-10-20 08:02:43 -07:00
Alex Florisca 48c450c469 Remove duplicate shouldSavePaymentMethod selector (https://github.com/woocommerce/woocommerce-blocks/pull/7381) 2022-10-19 04:48:04 -07:00
Tung Du 8b17d35bb8 fix deep array sort (https://github.com/woocommerce/woocommerce-blocks/pull/7403) 2022-10-14 15:22:16 +01:00
Paulo Arromba 53aabe91dd Update/8.7.0-2 changelog and testing instructions (https://github.com/woocommerce/woocommerce-blocks/pull/7406)
* Empty commit for release pull request

* Updated changelog.

* Minor lint fix.

* 8.7.0 Testing instructions

* Updated and tidy docs/internal-developers/testing/releases/README.md

* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)

* Set default style to link-button mixin

It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component

* Add new mixin for links in filter blocks

* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page

* Add filter-link-button mixin that can be used in filter blocks

* Remove link-button styles that were moved to filter-link-button mixin

By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.

The styles for link button in filter blocks should reside in filter-link-button mixin.

* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions

* Re-added woocommerce/woocommerce-blocks#7273 to changelog

* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)

* Correct block name and description

* remove duplicated description for controls blocks

* remove duplicated title and desc

* Revert "remove duplicated description for controls blocks"

This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.

* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog

* Updated testing zip package.

* Minor formatting fix on the release instructions

* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)

* Updated zip.

* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)

* remove problematic actions as deps

* add inline docs

* add todo comment

* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)

* Updated testing zip.

* Bumping version strings to new version.

* Empty commit for release pull request

* Release: 8.7.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7371)

* Empty commit for release pull request

* Updated changelog.

* Minor lint fix.

* 8.7.0 Testing instructions

* Updated and tidy docs/internal-developers/testing/releases/README.md

* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)

* Set default style to link-button mixin

It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component

* Add new mixin for links in filter blocks

* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page

* Add filter-link-button mixin that can be used in filter blocks

* Remove link-button styles that were moved to filter-link-button mixin

By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.

The styles for link button in filter blocks should reside in filter-link-button mixin.

* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions

* Re-added woocommerce/woocommerce-blocks#7273 to changelog

* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)

* Correct block name and description

* remove duplicated description for controls blocks

* remove duplicated title and desc

* Revert "remove duplicated description for controls blocks"

This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.

* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog

* Updated testing zip package.

* Minor formatting fix on the release instructions

* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)

* Updated zip.

* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)

* remove problematic actions as deps

* add inline docs

* add todo comment

* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)

* Updated testing zip.

* Bumping version strings to new version.

* Empty commit for release pull request

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>

* Release: 8.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7396)

* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>

* README.md formatting

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-14 15:17:54 +01:00
github-actions[bot] f6b025e894 Release: 8.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7396)
* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

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

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-14 13:32:51 +01:00
Mike Jolley 0588cfbeba Introduce woocommerce_store_api_add_to_cart_data (https://github.com/woocommerce/woocommerce-blocks/pull/7252) 2022-10-14 13:30:23 +01:00
Mike Jolley 51c94eada5 Prevent resource hinting when cart/checkout blocks are not in use (https://github.com/woocommerce/woocommerce-blocks/pull/7364)
* Skip resource hinting on admin requests woocommerce/woocommerce-blocks#7215

* Output resource hinting only when using cart/checkout blocks on cart/checkout pages woocommerce/woocommerce-blocks#7216
2022-10-14 13:13:22 +01:00
Tarun Vijwani 9167a04e20 Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-14 11:29:06 +01:00
Tung Du aa8622d985 E2E tests for Product Query Block (https://github.com/woocommerce/woocommerce-blocks/pull/7386) 2022-10-14 10:25:02 +07:00
Daniel Dudzic d6fecf28a3 Products by Rating: Add Filter by Rating to the Feature Plugin (https://github.com/woocommerce/woocommerce-blocks/pull/7384)
* Products by Rating: Move the Filter by Ratings block to the feature plugin build

* Products by Rating: Update the internal doc

* Products by Rating: Include a Feature Plugin check before loading the Rating filter variation
2022-10-13 17:27:26 +02:00
Alex Florisca e24e70adc6 Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395) 2022-10-13 15:49:02 +01:00
Luigi Teschio 952aafe4f6 Product Query - Add To Cart block is visible in the inserter (https://github.com/woocommerce/woocommerce-blocks/pull/7389)
* Product Query - add to cart block is visible in the inserter

* rename ancestors to ancestor
2022-10-13 16:47:51 +02:00
Daniel Dudzic f3037f2007 Products by Rating: Improve Rating filter accessibility (https://github.com/woocommerce/woocommerce-blocks/pull/7370)
* Products by Rating: Improve accessibility by announcing rating filter changes

* Products by Rating: Revert dependency bug

* Products by Rating: Update accessibility messages

* Products by Rating: Fix dependency array bug

* Products by Rating: Remove incorrect dependency array
2022-10-13 15:57:16 +02:00
Manish Menaria c4eea891c9 Fix mini cart aligment issue in Editor view (https://github.com/woocommerce/woocommerce-blocks/pull/7387)
More info: https://github.com/woocommerce/woocommerce-blocks/issues/7195
2022-10-13 17:00:07 +05:30
dependabot[bot] 5b2795a601 Bump html-react-parser from 0.14.3 to 3.0.4 (https://github.com/woocommerce/woocommerce-blocks/pull/7064)
Bumps [html-react-parser](https://github.com/remarkablemark/html-react-parser) from 0.14.3 to 3.0.4.
- [Release notes](https://github.com/remarkablemark/html-react-parser/releases)
- [Changelog](https://github.com/remarkablemark/html-react-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/remarkablemark/html-react-parser/compare/v0.14.3...v3.0.4)

---
updated-dependencies:
- dependency-name: html-react-parser
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2022-10-13 13:27:54 +02:00
dependabot[bot] 5a8fc1a821 Bump actions/stale from 5 to 6 (https://github.com/woocommerce/woocommerce-blocks/pull/7271)
Bumps [actions/stale](https://github.com/actions/stale) from 5 to 6.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

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>
2022-10-13 13:18:08 +02:00
Albert Juhé Lluveras cb5aab54a0 Remove Single Product block from readme list (https://github.com/woocommerce/woocommerce-blocks/pull/7380)
Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-13 11:48:33 +02:00
dependabot[bot] 9229f441a1 Bump automattic/jetpack-autoloader from 2.11.9 to 2.11.10 (https://github.com/woocommerce/woocommerce-blocks/pull/7358)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.9 to 2.11.10.
- [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.9...v2.11.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2022-10-13 11:01:36 +02:00
Thomas Roberts 1d25169932 Add payment data store selectors documentation (https://github.com/woocommerce/woocommerce-blocks/pull/7353)
* Add overview to payment data store docs

* Add documentation for isExpressPaymentMethodActive

* Add documentation for getActiveSavedToken

* Remove _ from Example heading

* Add documentation for getActivePaymentMethod

* Add documentation for getAvailablePaymentMethods

* Add documentation for getAvailableExpressPaymentMethods

* Add documentation for getPaymentMethodData

* Add documentation for getSavedPaymentMethods

* Add documentation for getActiveSavedPaymentMethods

* Add documentation for shouldSavePaymentMethod

* Add documentation for getCurrentStatus

* Change docs for shouldSavePaymentMethod to getShouldSavePaymentMethod

* Add documentation for normal/express paymentMethodsInitialized

* Add table of contents for payment method documentation
2022-10-12 09:04:31 -07:00
Daniel Dudzic c44ecf02b6 Products by Rating: Add inner block support (https://github.com/woocommerce/woocommerce-blocks/pull/7362)
* Products by Rating: Add InnerBlock support for Ratings

* Product by Ratings: Register Ratings filter as an InnerBlock

* Product by Rating: Fix active rating filters bug

* Products by Rating: Remove all heading references

* Products by Rating: Minor code fixes

* Products by Rating: Fix ESlint errors

* Products by Rating: Fix dependency placement
2022-10-12 17:47:21 +02:00
github-actions[bot] de6157cbfc Release: 8.7.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7371)
* Empty commit for release pull request

* Updated changelog.

* Minor lint fix.

* 8.7.0 Testing instructions

* Updated and tidy docs/internal-developers/testing/releases/README.md

* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)

* Set default style to link-button mixin

It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component

* Add new mixin for links in filter blocks

* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page

* Add filter-link-button mixin that can be used in filter blocks

* Remove link-button styles that were moved to filter-link-button mixin

By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.

The styles for link button in filter blocks should reside in filter-link-button mixin.

* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions

* Re-added woocommerce/woocommerce-blocks#7273 to changelog

* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)

* Correct block name and description

* remove duplicated description for controls blocks

* remove duplicated title and desc

* Revert "remove duplicated description for controls blocks"

This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.

* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog

* Updated testing zip package.

* Minor formatting fix on the release instructions

* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)

* Updated zip.

* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)

* remove problematic actions as deps

* add inline docs

* add todo comment

* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)

* Updated testing zip.

* Bumping version strings to new version.

* Empty commit for release pull request

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-10-12 16:35:25 +01:00
Thomas Roberts 0aa65908d7 Check that the callback for filtering payment methods is available and is a function before trying to run it (https://github.com/woocommerce/woocommerce-blocks/pull/7377)
* Check callback for payment method is available before trying to run it

* Check if callback is a function before trying to run it

* Update tests to ensure callbacks only run if they are registered
2022-10-12 07:29:04 -07:00
dependabot[bot] f1236254f4 Bump @wordpress/e2e-test-utils from 7.8.0 to 8.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7318)
Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 7.8.0 to 8.3.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@8.3.0/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

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>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-10-12 14:29:28 +02:00
Luigi Teschio 34d9ba22a3 Update Feature Flags and Experimental Interfaces doc adding the Product Query block and its variations and Filter By Rating block (https://github.com/woocommerce/woocommerce-blocks/pull/7375) 2022-10-12 12:50:43 +02:00
Paulo Arromba 9cc3004f69 Updated version to 8.8.0-dev (https://github.com/woocommerce/woocommerce-blocks/pull/7372) 2022-10-12 11:31:28 +01:00
Tung Du bdac9355fe Fix: Product Query: Update the Editor preview when custom attributes are changed (https://github.com/woocommerce/woocommerce-blocks/pull/7366) 2022-10-12 17:27:31 +07:00
github-actions[bot] c5fcc339d1 Release: 8.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7355)
* Empty commit for release pull request

* Updated changelog.

* Minor lint fix.

* 8.7.0 Testing instructions

* Updated and tidy docs/internal-developers/testing/releases/README.md

* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)

* Set default style to link-button mixin

It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component

* Add new mixin for links in filter blocks

* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page

* Add filter-link-button mixin that can be used in filter blocks

* Remove link-button styles that were moved to filter-link-button mixin

By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.

The styles for link button in filter blocks should reside in filter-link-button mixin.

* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions

* Re-added woocommerce/woocommerce-blocks#7273 to changelog

* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)

* Correct block name and description

* remove duplicated description for controls blocks

* remove duplicated title and desc

* Revert "remove duplicated description for controls blocks"

This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.

* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog

* Updated testing zip package.

* Minor formatting fix on the release instructions

* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)

* Updated zip.

* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)

* remove problematic actions as deps

* add inline docs

* add todo comment

* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)

* Updated testing zip.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-10-12 11:03:38 +01:00
Paulo Arromba 9f47f3b4b5 Bumping version strings to new version. 2022-10-11 18:22:56 +01:00
Paulo Arromba 1c6f83e881 Updated testing zip. 2022-10-11 18:11:56 +01:00
Paulo Arromba 93305c1bf8 Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367) 2022-10-11 18:09:45 +01:00
Seghir Nadir 0c8d4cd089 Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)
* remove problematic actions as deps

* add inline docs

* add todo comment
2022-10-11 18:05:57 +01:00
Seghir Nadir 6b00017b12 Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)
* remove problematic actions as deps

* add inline docs

* add todo comment
2022-10-11 18:04:55 +01:00
Paulo Arromba 81e642ae49 Updated zip. 2022-10-11 17:10:57 +01:00
Alex Florisca a7d91e9d96 change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369) 2022-10-11 17:08:46 +01:00
Alex Florisca e9f38ee5af change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369) 2022-10-11 17:07:23 +01:00
Paulo Arromba 936d5eb470 Minor formatting fix on the release instructions 2022-10-11 15:59:27 +01:00
Darren Ethier b6e178fade Fix error with usage of Cart::deep_sort_with_accents (https://github.com/woocommerce/woocommerce-blocks/pull/6896)
* implement fix and tests

* fix linting issue

* fix tests

* doh add missing semi-colon

* fix tests

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2022-10-11 15:36:54 +01:00
Luigi Teschio 007eb99004 rename allowControls to allowedControls (https://github.com/woocommerce/woocommerce-blocks/pull/7365) 2022-10-11 16:04:54 +02:00
Paulo Arromba da74586a13 Updated testing zip package. 2022-10-11 13:57:06 +01:00
Daniel Dudzic a6987cc252 Products by Rating: Add display options (https://github.com/woocommerce/woocommerce-blocks/pull/7311)
* Products by Rating: Add display options

* Products by Rating: Add support for the Apply button display option

* Products by Rating: Reset button display fix

* Products by Rating: Reset button dependency fix

* Products by Rating: Fix Active filters rating removal and Rating Reset button

* Products by Rating: Tweak preview checklist options

* Products by Rating: Remove stock status mentions

* Products by Rating: Remove redundant color option and fix loading check logic

* Products by Rating: Fix Reset button styling

* Products by Rating: Code cleanup and standardization
2022-10-11 13:00:06 +02:00
Paulo Arromba 67abfd011a removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog 2022-10-11 11:42:49 +01:00
Tung Du 2b30e6ef95 Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)
* Correct block name and description

* remove duplicated description for controls blocks

* remove duplicated title and desc

* Revert "remove duplicated description for controls blocks"

This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
2022-10-11 11:38:09 +01:00
Tung Du b1c7f3e63b Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)
* Correct block name and description

* remove duplicated description for controls blocks

* remove duplicated title and desc

* Revert "remove duplicated description for controls blocks"

This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
2022-10-11 15:39:34 +07:00
Paulo Arromba bfb55c7da3 Re-added woocommerce/woocommerce-blocks#7273 to changelog 2022-10-10 18:51:59 +01:00
Paulo Arromba 1d999e908f Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions 2022-10-10 18:38:13 +01:00
Alexandre Lara e8c7654e29 Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)
* Set default style to link-button mixin

It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component

* Add new mixin for links in filter blocks

* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page

* Add filter-link-button mixin that can be used in filter blocks

* Remove link-button styles that were moved to filter-link-button mixin

By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.

The styles for link button in filter blocks should reside in filter-link-button mixin.
2022-10-10 18:34:24 +01:00
Alexandre Lara 9245934eb8 Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)
* Set default style to link-button mixin

It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component

* Add new mixin for links in filter blocks

* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page

* Add filter-link-button mixin that can be used in filter blocks

* Remove link-button styles that were moved to filter-link-button mixin

By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.

The styles for link button in filter blocks should reside in filter-link-button mixin.
2022-10-10 14:26:15 -03:00
Paulo Arromba 4f30d53d99 Updated and tidy docs/internal-developers/testing/releases/README.md 2022-10-10 18:09:52 +01:00
Paulo Arromba c21a39c2ad 8.7.0 Testing instructions 2022-10-10 18:06:01 +01:00
Paulo Arromba e18cb1278f Minor lint fix. 2022-10-10 16:47:32 +01:00
Paulo Arromba 069990ba96 Updated changelog. 2022-10-10 16:26:13 +01:00
Alexandre Lara 0e5b912dcf Set default style to link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7340)
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.

Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).

* Change link-button mixin to make it attend the expected default style for links

* Replace text-button with link-button mixin in FilterResetButton component
2022-10-10 15:39:32 +01:00
Alex Florisca 306165a100 Add compatibility with HPOS (custom order tables) for WooCommerce (https://github.com/woocommerce/woocommerce-blocks/pull/7347) 2022-10-10 13:21:07 +01:00
Tung Du cc050e3cd6 Fix: Active Filters not working on for site templates (https://github.com/woocommerce/woocommerce-blocks/pull/7346)
* fix infinite rerendering issue for active filter block when use with PHP template or site editor

* group useQueryStateByKey calls

* update deps array
2022-10-10 18:42:28 +07:00
Luigi Teschio 8c37c9411c Fix E2E test (https://github.com/woocommerce/woocommerce-blocks/pull/7206)
* WIP fix E2E test

* test now

* another attempt

* try now

* check now

* Update cart.fixture.json

* Update product-search-legacy.fixture.json

* Update product-search.fixture.json

* Update newest-products.fixture.json

* Update product-categories-list.fixture.json

* Update hand-picked-products.fixture.json

* Update featured-category.fixture.json

* Update best-selling-products.fixture.json

* Update top-rated-products.fixture.json

* Go to Mini Cart block page before executing its i18n tests

* Fix broken Mini Cart e2e tests

* Wait for selector to prevent flakiness

* try now

* try now

* try now

* add variable

* fix E2E tests

* fix js linting error

* use SHOP_CHECKOUT_BLOCK_PAGE variable

* update variable

Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-10 12:42:59 +02:00
Thomas Roberts 169869bd04 Use correct number of days and remove wording relating to closing the PR (https://github.com/woocommerce/woocommerce-blocks/pull/7155) 2022-10-10 11:11:34 +01:00
Daniel Dudzic 2252557ac1 Products by Rating: Add block transform for the legacy rating widget (https://github.com/woocommerce/woocommerce-blocks/pull/7338)
* Products by Rating: Add legacy rating widget deprecation
* Products by Rating: Hide legacy Product Ratings widget
2022-10-10 11:48:45 +02:00
Thomas Roberts c798378edf Prevent resetting default payment method if available payment method is still available (https://github.com/woocommerce/woocommerce-blocks/pull/7276)
* Refresh the default payment method only if the active one is unavailable

* Add new type for serializable data store payment method

* Update uses of PaymentMethods/ExpressPaymentMethods to the plain version

* Add tests for setAvailablePaymentMethods action

* Update data store key  in tests
2022-10-07 10:32:17 -07:00
Thomas Roberts 02f42ded18 Prevent infinite loop when initialising the payments data store in the editor. (https://github.com/woocommerce/woocommerce-blocks/pull/7256)
* Unsubscribe the editor from changes when store is initialised

* Use correct action to initialize payment store
2022-10-07 09:41:44 -07:00
Daniel W. Robert 4b6f3cae7e Add Product Query Support for Atomic Price Block (https://github.com/woocommerce/woocommerce-blocks/pull/7199)
* Add attributes, settings, and editor PQ settings.

- Adds isDescendentOfQueryLoop attribute and sets up usage in editor.
- Connects Context (via useContext) in editor.
- Sets up necessary hierarchy in block index file settings.

* Add server-side rendered product price.

Adds the SSR output for the atomic Price block for PQ support.

* Remove Save attribute from JS index.

To allow for the block to be SSR, we need to remove the Save
attrubite/function on the JS side and allow for the PHP class to handle
it on the backend.

* Update PHP asset register method for added clarity

* Adjust block attr/context spreading for clarity.
2022-10-07 12:08:33 -04:00
Tom Cafferkey 872788e13c Convert filter blocks to inner blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6978)
* register filter wrapper block

* register block variation

* rename the active filters wrapper

* prevent 404 error

* Revert "prevent 404 error"

This reverts commit 8b6cb7c6658b2a5a99b890b67f1dce8c1c51cdbf.

* render parent wrapper block

* support price filter block

* hide the active filter block from inserter

* swap the title of wrapper and inner filter block for active filters

* hide the legacy heading for the price filter

* update block title and description for active filters and price filter

* remove heading control for price filter

* remove heading control for active filters

* update pattern

* try: upgrade button

* limit the number of inner block to 2

* prevent removing the inner filter block

* Revert "prevent removing the inner filter block"

This reverts commit 83b7feed78a7a7f50fd5799d1706faa9f2fc9050.

* convert stock filter to inner block

* refactor block upgrade button to share between filter blocks

* update default heading

* update pattern

* update icon and title

* Fix stock filter error by importing translations package

* Upgrade Active Filters name to Active Filter Controls

* Add upgrade support to price filter

* Convert attribute filter to inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7101)

* wip: convert attribute filter to inner block

* fix: render inner attribute filter block on the front end

* refactor: inner block wrapper, extract the attribute parsing logic into a utility

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

* Set correct attribute on the new filter blocks when they are upgraded

* Use the Warning component to display the upgrade message so it is consistent with Gutenberg

* address code review

* better detect legacy block to show the upgrade notice

* rename UpgradeToolbarButton to UpgradeNotice

* add upgrade notice to the stock filter block

* rename InnerBlockWrapper to BlockWrapper

* attribute-filter: control wrapper visibility

* passing block attributes down to inner active filters control block

* fix styling of inner attribute filter control block

* passing attribute to inner price filter control block

* passing down the attribute to inner stock filter control block

* remove unneccessary parsing

* use default scope for variations

* fix default attribute values

* use default block appender

* fix: lock control blocks

* remove dynamic title code from attribute filter block

* register active filters as variation and set it to the default that overrides the base block

* fix isActive for default variation

* fix: isActive logic for the active filters block

* register side effect

* fix ts error

* e2e: fix active filters block backend test

* e2e: fix frontend active filters test

* e2e: fix attribute filter test

* e2e: fix price filter test

* e2e: fix stock filter test

* e2e: update fixture

* e2e: fix attribute filter test

* remove invalid test

* e2e: update heading selector for price filter in backend test

* e2e: fixe backend price filter heading test

* fix: patterns i18n

* fix: heading level when upgrading the block

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-10-07 16:00:19 +01:00
Thomas Roberts 25e24708b5 Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)
* Track most recent inner blocks in useForcedLayout

* Force useSelect to re-select when we know innerBlocks has changed

* Rename mapSelect back to select

* Add forcedBlocksInserted to callback deps
2022-10-07 06:15:53 -07:00
Niels Lange 2732d354ed Document the selectors for the wc/store/validation data store (https://github.com/woocommerce/woocommerce-blocks/pull/7086)
* Add documentation for validation data store

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

* Use correct file path for validation data store docs

* Fix typo in hasValidationErrors documentation

* Add parameters and example of getValidationError

* Improve description of getValidationErrorId

* Fix typo in hasValidationErrors

* Document clearValidationErrors

* Add documentation and example for setValidationErrors

* Add documentation for clearAllValidationErrors

* Add documentation for hideValidationError

* Add documentation for showValidationError

* Add overview section

* Update hideValidationError documentation

* Add showValidationErrors documentation

* Update table of contents

* Fix typo in action name and add example

* Fix typo in hasValidationErrors

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2022-10-07 04:24:54 -07:00
Tarun Vijwani 75d6e84552 Hide the shipping address form from the Checkout when the "Force shipping to the customer billing address" is enabled (https://github.com/woocommerce/woocommerce-blocks/pull/7268)
* Hide shipping address form from the Checkout when forced billing address is enabled.

* Update shipping address when billing address is changed

* Display shipping options

* Fixed needs shipping condition

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-10-07 08:50:26 +01:00
Daniel W. Robert 27ad42cd20 Add updated deps from fresh install. (https://github.com/woocommerce/woocommerce-blocks/pull/7296) 2022-10-06 13:46:48 -04:00
Niels Lange 5fe9de69f6 Render HTML in description of active payment integrations (https://github.com/woocommerce/woocommerce-blocks/pull/7313) 2022-10-06 23:52:42 +07:00
Alex Florisca aefcf65dd8 Consolidate Address types (https://github.com/woocommerce/woocommerce-blocks/pull/7272)
* Consolidate Address types

* Revert "Consolidate Address types"

This reverts commit cb708a3d714621717414ec17f5e1071be5ca5e96.

* Rename EnteredAddress to CustomerAddress

* Delete unused Address type

* Thomas suggestions

* Fix duplicate ShippingAddress symbol
2022-10-06 15:48:52 +01:00
Alba Rincón f3295f1780 Register new header patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7292)
* Register new header patterns

* Fix name

* Capitalize the header word

* Remove ref from the navigation menu
2022-10-06 14:16:32 +01:00
Alex Florisca 7bf79f33d9 Rename payment-method-data-context to payment-events-context and PAYMENT_METHOD_DATA_STORE_KEY to PAYMENT_STORE_KEY (https://github.com/woocommerce/woocommerce-blocks/pull/7304)
* Rename payment-method-data-context to payment-event-context and tidy up types and things

* Rename uses of PAYMENT_METHOD_DATA_STORE_KEY to PAYMENT_STORE_KEY

* Rename __internalInitializePaymentMethodDataStore and unsubscribeInitializePaymentMethodDataStore

* Rename unsubscribeInitializePaymentMethodDataStore
2022-10-06 13:46:46 +01:00
Manish Menaria 918c9515d7 Register new footer patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7306)
* Register new footer patterns

* Capitalize the footer word

* Fix large footer pattern content cut-off issue

For more info:
https://github.com/woocommerce/woocommerce-blocks/pull/7306#issuecomment-1268491571
https://github.com/woocommerce/woocommerce-blocks/pull/7306#issuecomment-1269717251

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2022-10-06 17:57:09 +05:30
Niels Lange 40204ce740 Update readme.txt (https://github.com/woocommerce/woocommerce-blocks/pull/7280)
* Update readme.txt

* Add missing blocks
2022-10-06 13:07:36 +07:00
Luigi Teschio f7cee9e54a Import useEffect from @wordpress/element package (https://github.com/woocommerce/woocommerce-blocks/pull/7298)
Import useEffect from @wordpress/element package
2022-10-05 15:20:34 +02:00
Thomas Roberts df3b785244 Rename `wc/store/payment-methods` to `wc/store/payment` (https://github.com/woocommerce/woocommerce-blocks/pull/7267)
* Rename wc/store/payment-methods to wc/store/payment

* Rename folder to payment

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-10-05 13:01:56 +01:00
Alex Florisca eace72a31f Prefix all actions in the checkout and payment-method stores with `__internal` (https://github.com/woocommerce/woocommerce-blocks/pull/7266)
* Rename setProcessingResponse to setPaymentResult and remove setOrderId from the checkout data store actions

* Fix accidentally changing data exposed to the observers

* Rename all checkout actions with the __internal prefix

* Prefix all payment method data store actions with __internal

* Pedantic spacing

* Fix ts error
2022-10-05 11:04:16 +01:00
Hsing-yu Flowers cad30afc79 Fix use of sanitizeHTML (https://github.com/woocommerce/woocommerce-blocks/pull/7231)
* Remove object from sanitizeHTML return value

* Import sanitizeHTML from utils

* Fix dangerously set inner HTML format

* Update package-lock

* Update package-lock

* Update package-lock

* Update @types/dompurify version

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-10-05 02:59:38 -07:00
Alex Florisca ce68c6ef40 Return 424 instead of 400 when checkout payment fails (https://github.com/woocommerce/woocommerce-blocks/pull/7273)
* Return 424 instead of 400 when checkout payment fails

* Change status for 424 to 402
2022-10-05 10:50:05 +01:00
Thomas Roberts 2e13856173 Add `showRemoveItemLink` filter to `CartLineItemRow` (https://github.com/woocommerce/woocommerce-blocks/pull/7242)
* Add showRemoveItemLink filter

This is a filter that will allow developers to set whether the link to remove a cartItem is visible

* Add test for showRemoveItemLink filter

* Remove unnecessary quantity override

* Move definition of cart to avoid hardcoding id value in filter

* Updated documentation for `showRemoveItemLink` filter

* available-filters.md tweak

* available-filters.md tweak

* Add example to filters for showRemoveItemLink

* Remove whitespace

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-04 13:51:07 +01:00
Niels Lange dcde8dee05 Adjust Cart inner block titles (https://github.com/woocommerce/woocommerce-blocks/pull/7232) 2022-10-04 09:22:32 +07:00
Daniel W. Robert 3cfc4ec44c Minor Refactor to Prod Image Backend Render Functions (https://github.com/woocommerce/woocommerce-blocks/pull/7247)
* Refactor Product Image anchor render function.

Move closing tag for the anchor into the render function and pass badge
and image output into anchor children as args.

Also removes duplicate border radius logic from anchor render function,
as it is already present on the class render method.

* Clean up sprintf args.

* Replace deprecated placeholder function.

The `woocommerce_placeholder_img_src` function has been depricated since
v3.0. This replaces that function with the `wc_placeholder_img_src`
function.
2022-10-03 19:48:51 -04:00
Mike Jolley 6f93c5cf1b Store API - Cart JWT tokens/session handling (https://github.com/woocommerce/woocommerce-blocks/pull/5953)
* Re-apply token support

* Updated nonce headers

* Updated package-lock.json

* test commit to debug failing git hooks

* Revert "test commit to debug failing git hooks"

This reverts commit e64086b0a7aede154705be09c7b3433b08bc1e34.

* JsonWebToken utility class for generating and validating HS256 JWT tokens. Removed third-party JWT library.

* Add ext-hash to composer (required by hash_hmac())

* Removed unnecessary method param.

* Tests for retrieving cart contents via Cart-Token

* Removed token tests ( we can't properly test cart token functionality until we refactor the way it intercepts calls to replace the session object )

* Abstracted payload from JsonWebToken class. We can now use it to encode custom payloads and reuse them wherever we want.

* Fixed missing check for token expiration in the payload.

* MD lint error and config fix

* Update composer.lock

* Fixed bug using the wrong nonce header.

* Refactor to properly save session data based on cart token.

* Refactored DB queries to properly use prepared statement

* Removed underscore prefix for class attributes

* Fixed spaces instead of tabs indenting composer.json. Cleaned up .editorconfig

* Cleaned up borked .md comments.

* Comment for WP_SETUP_CONFIG check.

* Reverted SQL prepared statement for including table names.

* Used hash_equals() for signature comparison. Renamed some wrongly named properties.

* Updated composer.lock

* Reverted some accidentally removed lines on some documentation files.

* Reverted accidentally removed line on docs/internal-developers/testing/releases/404.md

* Changed param type from mixed to

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-10-03 11:49:32 +01:00
Alex Florisca 33910f316f Document the actions in the checkout and payment-method stores (https://github.com/woocommerce/woocommerce-blocks/pull/7255)
* Remove setPristine as it's not used

* Comment checkout actions

* Rename setProcessingResponse to setPaymentResult and remove setOrderId from the checkout data store actions

* Add comments to payment actions

* Update documentation with data stores

* Fix accidentally changing data exposed to the observers

* Document missing parameters for actions
2022-09-30 15:34:14 +01:00
Mik 6d5f4dbe7a Support a GT tracking ID (https://github.com/woocommerce/woocommerce-blocks/pull/7213) 2022-09-30 06:54:20 +01:00
Alex Florisca 4a82b73baf Fix failing filter test (https://github.com/woocommerce/woocommerce-blocks/pull/7253) 2022-09-30 08:38:34 +07:00
Niels Lange c360c5654a Add filter for place order button label (https://github.com/woocommerce/woocommerce-blocks/pull/7154)
* WIP add filter for place order button label

* Solve TS issue

* Add display priority

* Refactor display priority

* WIP Implement useMemo()

* Try using a global cache

* Add docs for placeOrderLabel filter

* Update docs/third-party-developers/extensibility/checkout-block/available-filters.md

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

* Adjust docs

* Rename “placeOrderLabel” to “placeOrderButtonLabel”

* Update assets/js/types/type-defs/payments.ts

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2022-09-29 15:46:10 +07:00
Daniel Dudzic 8ae19b5a42 Add a Products by Rating filter block (https://github.com/woocommerce/woocommerce-blocks/pull/7048)
* Add interactivity to the Product by Rating filter block

* Fix block with the latest repo changes

* Product by Rating: Code tidying up

* Add an experimental build gate and update block title and description

* Remove redundant title and description

* Add support for the CheckboxList component in the Products by Rating block

* Products by Rating: Minor code clean-up

* Active Filters: Fix the Clear All button for Ratings. Closes #woocommerce/woocommerce-blocks#7172

* Products by Rating: Add misc TS fixes
2022-09-28 23:12:14 +02:00
Luigi Teschio 790dbd3765 Remove qm/debug action (https://github.com/woocommerce/woocommerce-blocks/pull/7240)
Remove qm/debug action
2022-09-28 15:58:07 +02:00
Luigi Teschio 222407cb93 [Product Query] Add support for the Filter By Price Block (https://github.com/woocommerce/woocommerce-blocks/pull/7162)
* Product Query: Fix pagination issue

* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Price Block

* fix query relation

* fix on sale query

* fix bugged pagination and on-sale filter after refactor

* fix reload page when the Filter By Price block is used with All Products block

* use array_intersect instead of array_merge
2022-09-28 15:44:20 +02:00
Alex Florisca a97cd87ba1 Rebuild package-lock 2022-09-28 13:45:42 +01:00
Niels Lange 0e1eb2d597 Document the selectors for the wc/store/checkout data store (https://github.com/woocommerce/woocommerce-blocks/pull/7085) 2022-09-28 13:45:42 +01:00
Alex Florisca 9e2d7963ce Tests for the Checkout data store (https://github.com/woocommerce/woocommerce-blocks/pull/7044) 2022-09-28 13:45:42 +01:00
Thomas Roberts 65c0bfc0df Refactor `getValidationError` and `getValidationErrorId` selectors in `wc/store/validation` data store (https://github.com/woocommerce/woocommerce-blocks/pull/7146)
* Convert checkout context to data store - part 1 (https://github.com/woocommerce/woocommerce-blocks/pull/6232)

* Add checkout data store

* wip on checkout data store

* CheckoutContext now uses the checkout store

* Investigated and removed setting the redirectUrl on the default state

* update extension and address hooks to use checkout data store

* use checkout data store in checkout-processor and use-checkout-button

* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity

* Remove useCheckoutContext from shipping provider

* Remove isCalculating from state

* Removed useCheckoutContext from lots of places

* Remove useCheckoutContext from checkout-payment-block

* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block

* add isCart selector and action and update the checkoutstate context

* Fixed redirectUrl bug by using thunks

* Remove dispatchActions from checkout-state

* Change SET_HAS_ERROR action to be neater

* Thomas' feedback

* Tidy up

* Oops, deleted things I shouldn't have

* Typescript

* Fix types

* Fix tests

* Remove isCart

* Update docs and remove unecessary getRedirectUrl() selector

* set correct type for preloadedCheckoutData

* Remove duplicate Address type

* Fix missing addresses from type-defs index

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Revert feedback changes

* REvert feedback formatting

* Update docs formatting

* Delete empty types.ts file

* remove merge conflict from docs

* Correct linting in docs

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

* Move checkout state code into thunks and rename `CheckoutState` context to `CheckoutEvents` (https://github.com/woocommerce/woocommerce-blocks/pull/6455)

* Add checkout data store

* wip on checkout data store

* CheckoutContext now uses the checkout store

* Investigated and removed setting the redirectUrl on the default state

* update extension and address hooks to use checkout data store

* use checkout data store in checkout-processor and use-checkout-button

* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity

* Remove useCheckoutContext from shipping provider

* Remove isCalculating from state

* Removed useCheckoutContext from lots of places

* Remove useCheckoutContext from checkout-payment-block

* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block

* add isCart selector and action and update the checkoutstate context

* Fixed redirectUrl bug by using thunks

* Remove dispatchActions from checkout-state

* Change SET_HAS_ERROR action to be neater

* Thomas' feedback

* Tidy up

* Oops, deleted things I shouldn't have

* Typescript

* Fix types

* Fix tests

* Remove isCart

* Update docs and remove unecessary getRedirectUrl() selector

* validate event emitter button

* Added thunks in a separate file

* Call thunks from checkout-state

* Checkout logic tested and working

* Remove dependency injection as much as poss, tidy up and fix some TS errors

* Fix types in thunks.ts

* Fixed some ts errors

* WIP

* Fixed bug

* Shift side effects from checkout-state to checkout-processor

* Revert "Shift side effects from checkout-state to checkout-processor"

This reverts commit 059533da4eb34f9982f66cd4adacc7b2c24f939f.

* Rename CheckoutState to CheckoutEvents

* Move status check outside the thunk

* remove duplicate EVENTS constant

* remove temp buttons

* Remove console logs

* Augment @wordpress/data package with our new store types

* Add correct type for CheckoutAction

* Remove createErrorNotice arg from runCheckoutAfterProcessingWithErrorObservers

* Remove createErrorNotice from emit event types

* Use type keyword when importing types

* Add correct types for dispatch and select in thunks

* Update wordpress/data types

* Replace store creation with new preferred method

* Set correct action type on reducer

* Remove unnecessary async from thunk

* add CHECKOUT_ prefix to checkout events again

* export EVENTS with eveything else in checkout0-events/event-emit

* Remove duplicate SelectFromMap and TailParameters

* Updated type for paymentStatus

* TODO remove wp/data experimental thunks

* Remove `setCustomerId` from events and `processCheckoutResponseHeaders` (https://github.com/woocommerce/woocommerce-blocks/pull/6586)

* Prevent passing dispatch, instead get actions direct from store

* Get setCustomerId from the store instead of passing it to processCheckoutResponseHeaders

* Revert "Prevent passing dispatch, instead get actions direct from store"

This reverts commit 4479a2ef5599d9c8d99c3629616b3d662210fc08.

* Auto stash before revert of "Prevent passing dispatch, instead get actions direct from store"

* Remove duplicate dispatch

* Fix unit tests

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

* Refactor selectors to not return functions anymore

This is a poor DevEx and naming did not reflect what the selector was returning.

* Update combobox to be more explicit when selecting validation error

* Update useValidation to use the new getValidationError selector

* Include @woocommerce/base-hooks in tsconfig

* Update ValidationInputError to use new selector

* Update ValidatedTextInput to use new selectors

* Prevent reference errors when getting validation errors in ComboBox

* Defend against case where message prop of error object is undefined

* Fix totals/coupon to use new validation selector

* Use validation data store in CheckoutTerms block

* Update AddressForm to use new validation selector

* Update AttributeSelectControl to use new validation selector

* Fix syntax error in ValidatedTextInput

* Fix multiple import error from rebase

* Fix lint issue in useStoreCartItemQantity

* Fix tests to reflect new selector API

* Remove unused validation prop from CheckoutTermsBlock

* Change CheckoutTermsBlock unit tests to use validation data store

* Fix JSDOC syntax

* fix merge conflict in checkout-api.md

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-09-28 13:45:42 +01:00
Thomas Roberts 512aa911f3 Fix failing express payment method unit test (https://github.com/woocommerce/woocommerce-blocks/pull/7165) 2022-09-28 13:45:42 +01:00
Alex Florisca 37d6802252 Remove unused properties from store select 2022-09-28 13:45:42 +01:00
Alex Florisca 080cdbeac2 Fix bug where active payment methods were checked too early 2022-09-28 13:45:42 +01:00
Alex Florisca dfe5151f7f Fix payment status being set to pristine not working correctly 2022-09-28 13:45:42 +01:00
Thomas Roberts dcffe242dd Fix docs linting errors 2022-09-28 13:45:42 +01:00
Alex Florisca 4ac0806990 Update assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-card.js
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-09-28 13:45:42 +01:00
Thomas Roberts 53650ff6ba Only allow payment methods to show that are in availablePaymentMethods 2022-09-28 13:45:42 +01:00
Thomas Roberts 3a49e0bd57 Revert "Include @wordpress/redux-routine in transformIgnorePatterns jest config"
This reverts commit 6b132358327ce9a36289e9f27defe7e28caee94a.
2022-09-28 13:45:42 +01:00
Alex Florisca ef1dc66068 Remove all traces of Notification Context 2022-09-28 13:45:42 +01:00
Thomas Roberts 1d78f097cb Remove missing import 2022-09-28 13:45:42 +01:00
Alex Florisca b927fcfe80 Remove Notices context 2022-09-28 13:45:42 +01:00
Thomas Roberts 28659ee653 Refactor registration of payment methods and update unit tests for payment data store (https://github.com/woocommerce/woocommerce-blocks/pull/6669)
* Mock getCartTotals

* Change test to use data store instead of context

* Move payment method context test to data store selectors

* Change description of test suite

* Bump commit to trigger tests

* Fix path in test

* update package lock

* Set correct state payment method reducer tests/use correct actions

* Get saved payment methods from store not context

* Mock stores and update tests to allow switching payment methods

* Update tests to get onSubmit from checkoutEventsContext

* Remove cartTotalsLoaded check from payment method initialize check

* Make PaymentMethods test wait until payments initialized

* initialize payment method data store when cart is loaded

* Remove unneeded actions and add initializePaymentMethodDataStore

* Remove check for cart totals loaded in checkPaymentMethods

* Remove updateAvilablePaymentMethods from registry

* Remove unneeded mock

* Remove unused import

* Rename imports to fix eslint errors

* Remove unused imports

* Remove return false from checkPaymentMethods

* Remove unnecessary setPaymentMethodsInitialized call

* Add todo comment to track refactoring opportunity

* Remove savedpayment methods from payment method context and rename it

* Rename payment method data context to payment method events context

* Add tests for setDefaultPaymentMethods

* Optimize the availablePaymentMethods state data

Store only the "name" attribute for now.

* Get list of payment methods from the registry instead of the store

We are using this hook to get some React elements in the payment method
object. So, we are getting the raw data directly from the registry instead
of the store.

* Fix payment state not loading on the Checkout edit page

* Handle checkout edit page case

* Fix infinite loop error on C&C Blocks

* Include @wordpress/redux-routine in transformIgnorePatterns jest config

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-09-28 13:45:42 +01:00
Thomas Roberts aa9fd66e8e Fix lint errors 2022-09-28 13:45:42 +01:00
Alex Florisca d13d5b3fdd Feature: Data Store Migration - Payments (https://github.com/woocommerce/woocommerce-blocks/pull/6619)
* Move paymentMethodDataProvider into a data store (https://github.com/woocommerce/woocommerce-blocks/pull/6208)

* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type

* Add default state for PaymentMethod data store

* Add preliminary action types

* Add preliminary action dispatchers

* Create payment method data store

* Add preliminary reducers for payment method data store

* Add preliminary selectors for payment method data store

* Add reducers/actions for registering payment methods

* Export payment method data store key

* Add test for payment method data reducers

* Add shouldSavePaymentMethod selector

* Add store key as constant

* Add more action types for registering and initializing payment methods

* Get active payment method from data store instead of from context

* Add registered methods to default state of payment method data store

* Dispatch name of registered payment method to payment method data store

* Remove setShouldSavePayment from payment method dispatcher and types

* Get payment methods from registry instead of payment context

* Add available payment methods to store

* Add function to check whether payment methods are allowed to be used

* Add selector to check if payments are initialised

* Remove resolvers and add controls to payment method data store

* Change type of payment requirements to string[]

* Turn addRegistered and addRegisteredExpress into generators

This is so we can check each payment method's validity before adding it to the list of available payment methods

* Add action type for setting express payments as initialized

* Only select from available methods in payment method options

* Remove argument from addRegisteredPaymentMethod in payment method registry

* Rename folder and store name to not contain the word data

* Add selectors for express payment methods and their initialisation

* Delete controls again in favour of thunks

* Rename payment-method-data to payment-methdods

* Create new setDefaultPaymentMethod function

This will set the payment method when the cart loads.

* Add CustomerPaymentMethodConfiguration type

* Make getAvailableExpressPaymentMethods return correct data

* Check express methods and normal methods when cart changes

* Add action for setting active express payment methods

* Handle express methods in checkPaymentMethodCanPay

* Hide express payments area if none are available

* Add selector for paymentMethodData

* Add customer data to default state and add selector for it

* Add setPaymentStatus action and reducer case

* Set the default payment method when one isn't selected

* Correct types on getCustomerPaymentMethods

* Set status in data store alongside context status

* Comment out active gateway selection - remove later

* Set status in express payment methods in data store

* Use correct key in payment method data context

* Directly check payment methods from the list in blocks-registry

* Add semicolon to import statement

* Fix payment method data state call

* Get paymentMethodData from store not context

* Fix linting issues

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>

* Rebase on the update/checkout-data-store branch & Fix failed payments (https://github.com/woocommerce/woocommerce-blocks/pull/6587)

* Add checkout data store

* wip on checkout data store

* CheckoutContext now uses the checkout store

* Investigated and removed setting the redirectUrl on the default state

* update extension and address hooks to use checkout data store

* use checkout data store in checkout-processor and use-checkout-button

* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity

* Remove useCheckoutContext from shipping provider

* Remove isCalculating from state

* Removed useCheckoutContext from lots of places

* Remove useCheckoutContext from checkout-payment-block

* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block

* add isCart selector and action and update the checkoutstate context

* Fixed redirectUrl bug by using thunks

* Remove dispatchActions from checkout-state

* Change SET_HAS_ERROR action to be neater

* Thomas' feedback

* Tidy up

* Oops, deleted things I shouldn't have

* Typescript

* Fix types

* Fix tests

* Remove isCart

* Update docs and remove unecessary getRedirectUrl() selector

* set correct type for preloadedCheckoutData

* Remove duplicate Address type

* Fix missing addresses from type-defs index

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Revert feedback changes

* REvert feedback formatting

* Update docs formatting

* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type

* Add default state for PaymentMethod data store

* Add preliminary action types

* Add preliminary action dispatchers

* Create payment method data store

* Add preliminary reducers for payment method data store

* Add preliminary selectors for payment method data store

* Add reducers/actions for registering payment methods

* Export payment method data store key

* Add test for payment method data reducers

* Add shouldSavePaymentMethod selector

* Add store key as constant

* Add more action types for registering and initializing payment methods

* Get active payment method from data store instead of from context

* Add registered methods to default state of payment method data store

* Dispatch name of registered payment method to payment method data store

* Remove setShouldSavePayment from payment method dispatcher and types

* Get payment methods from registry instead of payment context

* Add available payment methods to store

* Add function to check whether payment methods are allowed to be used

* Add selector to check if payments are initialised

* Remove resolvers and add controls to payment method data store

* Change type of payment requirements to string[]

* Turn addRegistered and addRegisteredExpress into generators

This is so we can check each payment method's validity before adding it to the list of available payment methods

* Add action type for setting express payments as initialized

* Only select from available methods in payment method options

* Remove argument from addRegisteredPaymentMethod in payment method registry

* Rename folder and store name to not contain the word data

* Add selectors for express payment methods and their initialisation

* Delete controls again in favour of thunks

* Rename payment-method-data to payment-methdods

* Create new setDefaultPaymentMethod function

This will set the payment method when the cart loads.

* Add CustomerPaymentMethodConfiguration type

* Make getAvailableExpressPaymentMethods return correct data

* Check express methods and normal methods when cart changes

* Add action for setting active express payment methods

* Handle express methods in checkPaymentMethodCanPay

* Hide express payments area if none are available

* Add selector for paymentMethodData

* Add customer data to default state and add selector for it

* Add setPaymentStatus action and reducer case

* Set the default payment method when one isn't selected

* Correct types on getCustomerPaymentMethods

* Set status in data store alongside context status

* Comment out active gateway selection - remove later

* Set status in express payment methods in data store

* Directly check payment methods from the list in blocks-registry

* Add semicolon to import statement

* Fix payment method data state call

* Get paymentMethodData from store not context

* Add addPaymentMethodData action/reducer case

* Update payment method on payment success

* Add 'getCurrentStatus' selector

* Remove the temporary solution

For getting payment method data into the data store

* Prevent the 'success' context action from being dispatched

* Update the "setPaymentStatus" data store action

Accept status as an object instead of string

* Fix the "currentStatus" reducer state update value

* Get payment data into data store

* Set the correct payment status to data store

* Get the success status of payment from data store

* Use store data in the payment dispatchers

Replace the React useReducers action in the payment dispatchers file with
the payment method data store

* Get payment status from data store

* Use data store for the payment error status

* Use payment data store failed status

* Use payment data store for the isFinished status

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>

* Fix merge conflict error

* Set & get the provider's state from our data store instead of React's useReducer (https://github.com/woocommerce/woocommerce-blocks/pull/6588)

* Add checkout data store

* wip on checkout data store

* CheckoutContext now uses the checkout store

* Investigated and removed setting the redirectUrl on the default state

* update extension and address hooks to use checkout data store

* use checkout data store in checkout-processor and use-checkout-button

* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity

* Remove useCheckoutContext from shipping provider

* Remove isCalculating from state

* Removed useCheckoutContext from lots of places

* Remove useCheckoutContext from checkout-payment-block

* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block

* add isCart selector and action and update the checkoutstate context

* Fixed redirectUrl bug by using thunks

* Remove dispatchActions from checkout-state

* Change SET_HAS_ERROR action to be neater

* Thomas' feedback

* Tidy up

* Oops, deleted things I shouldn't have

* Typescript

* Fix types

* Fix tests

* Remove isCart

* Update docs and remove unecessary getRedirectUrl() selector

* set correct type for preloadedCheckoutData

* Remove duplicate Address type

* Fix missing addresses from type-defs index

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Revert feedback changes

* REvert feedback formatting

* Update docs formatting

* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type

* Add default state for PaymentMethod data store

* Add preliminary action types

* Add preliminary action dispatchers

* Create payment method data store

* Add preliminary reducers for payment method data store

* Add preliminary selectors for payment method data store

* Add reducers/actions for registering payment methods

* Export payment method data store key

* Add test for payment method data reducers

* Add shouldSavePaymentMethod selector

* Add store key as constant

* Add more action types for registering and initializing payment methods

* Get active payment method from data store instead of from context

* Add registered methods to default state of payment method data store

* Dispatch name of registered payment method to payment method data store

* Remove setShouldSavePayment from payment method dispatcher and types

* Get payment methods from registry instead of payment context

* Add available payment methods to store

* Add function to check whether payment methods are allowed to be used

* Add selector to check if payments are initialised

* Remove resolvers and add controls to payment method data store

* Change type of payment requirements to string[]

* Turn addRegistered and addRegisteredExpress into generators

This is so we can check each payment method's validity before adding it to the list of available payment methods

* Add action type for setting express payments as initialized

* Only select from available methods in payment method options

* Remove argument from addRegisteredPaymentMethod in payment method registry

* Rename folder and store name to not contain the word data

* Add selectors for express payment methods and their initialisation

* Delete controls again in favour of thunks

* Rename payment-method-data to payment-methdods

* Create new setDefaultPaymentMethod function

This will set the payment method when the cart loads.

* Add CustomerPaymentMethodConfiguration type

* Make getAvailableExpressPaymentMethods return correct data

* Check express methods and normal methods when cart changes

* Add action for setting active express payment methods

* Handle express methods in checkPaymentMethodCanPay

* Hide express payments area if none are available

* Add selector for paymentMethodData

* Add customer data to default state and add selector for it

* Add setPaymentStatus action and reducer case

* Set the default payment method when one isn't selected

* Correct types on getCustomerPaymentMethods

* Set status in data store alongside context status

* Comment out active gateway selection - remove later

* Set status in express payment methods in data store

* Directly check payment methods from the list in blocks-registry

* Add semicolon to import statement

* Fix payment method data state call

* Get paymentMethodData from store not context

* Add addPaymentMethodData action/reducer case

* Update payment method on payment success

* Add 'getCurrentStatus' selector

* Remove the temporary solution

For getting payment method data into the data store

* Prevent the 'success' context action from being dispatched

* Update the "setPaymentStatus" data store action

Accept status as an object instead of string

* Fix the "currentStatus" reducer state update value

* Get payment data into data store

* Set the correct payment status to data store

* Get the success status of payment from data store

* Use store data in the payment dispatchers

Replace the React useReducers action in the payment dispatchers file with
the payment method data store

* Get payment status from data store

* Use data store for the payment error status

* Use payment data store failed status

* Use payment data store for the isFinished status

* Update the setPaymentStatus argument

* Set up setRegisteredPaymentMethods in data store

* Use the data store version of the registeredPaymentMethods

* Fix the default state type of the registeredPaymentMethods

* Set up setRegisteredExpressPaymentMethod in data store

* Use the data version of the registred express payment methods

* Set the correct action type for removing payment methods

* Fix default state express payment methods type

* Use the store data version of activePaymentMethod

* Use setActivePaymentMethod in the dispatchers file

And refactor code

* Update payment status arguments for express payment methods

* Use paymentMethodData from the data store

* Use payment method's errorMessage from data store

* Update paymentMethods list in data store reducer

* Replace remaining payment context data with data store

* Clean up payment method context file

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>

* Get payment method data directly from the data store instead of the usePaymentMethodDataContext hook (https://github.com/woocommerce/woocommerce-blocks/pull/6589)

* Add checkout data store

* wip on checkout data store

* CheckoutContext now uses the checkout store

* Investigated and removed setting the redirectUrl on the default state

* update extension and address hooks to use checkout data store

* use checkout data store in checkout-processor and use-checkout-button

* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity

* Remove useCheckoutContext from shipping provider

* Remove isCalculating from state

* Removed useCheckoutContext from lots of places

* Remove useCheckoutContext from checkout-payment-block

* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block

* add isCart selector and action and update the checkoutstate context

* Fixed redirectUrl bug by using thunks

* Remove dispatchActions from checkout-state

* Change SET_HAS_ERROR action to be neater

* Thomas' feedback

* Tidy up

* Oops, deleted things I shouldn't have

* Typescript

* Fix types

* Fix tests

* Remove isCart

* Update docs and remove unecessary getRedirectUrl() selector

* set correct type for preloadedCheckoutData

* Remove duplicate Address type

* Fix missing addresses from type-defs index

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Revert feedback changes

* REvert feedback formatting

* Update docs formatting

* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type

* Add default state for PaymentMethod data store

* Add preliminary action types

* Add preliminary action dispatchers

* Create payment method data store

* Add preliminary reducers for payment method data store

* Add preliminary selectors for payment method data store

* Add reducers/actions for registering payment methods

* Export payment method data store key

* Add test for payment method data reducers

* Add shouldSavePaymentMethod selector

* Add store key as constant

* Add more action types for registering and initializing payment methods

* Get active payment method from data store instead of from context

* Add registered methods to default state of payment method data store

* Dispatch name of registered payment method to payment method data store

* Remove setShouldSavePayment from payment method dispatcher and types

* Get payment methods from registry instead of payment context

* Add available payment methods to store

* Add function to check whether payment methods are allowed to be used

* Add selector to check if payments are initialised

* Remove resolvers and add controls to payment method data store

* Change type of payment requirements to string[]

* Turn addRegistered and addRegisteredExpress into generators

This is so we can check each payment method's validity before adding it to the list of available payment methods

* Add action type for setting express payments as initialized

* Only select from available methods in payment method options

* Remove argument from addRegisteredPaymentMethod in payment method registry

* Rename folder and store name to not contain the word data

* Add selectors for express payment methods and their initialisation

* Delete controls again in favour of thunks

* Rename payment-method-data to payment-methdods

* Create new setDefaultPaymentMethod function

This will set the payment method when the cart loads.

* Add CustomerPaymentMethodConfiguration type

* Make getAvailableExpressPaymentMethods return correct data

* Check express methods and normal methods when cart changes

* Add action for setting active express payment methods

* Handle express methods in checkPaymentMethodCanPay

* Hide express payments area if none are available

* Add selector for paymentMethodData

* Add customer data to default state and add selector for it

* Add setPaymentStatus action and reducer case

* Set the default payment method when one isn't selected

* Correct types on getCustomerPaymentMethods

* Set status in data store alongside context status

* Comment out active gateway selection - remove later

* Set status in express payment methods in data store

* Directly check payment methods from the list in blocks-registry

* Add semicolon to import statement

* Fix payment method data state call

* Get paymentMethodData from store not context

* Add addPaymentMethodData action/reducer case

* Update payment method on payment success

* Add 'getCurrentStatus' selector

* Remove the temporary solution

For getting payment method data into the data store

* Prevent the 'success' context action from being dispatched

* Update the "setPaymentStatus" data store action

Accept status as an object instead of string

* Fix the "currentStatus" reducer state update value

* Get payment data into data store

* Set the correct payment status to data store

* Get the success status of payment from data store

* Use store data in the payment dispatchers

Replace the React useReducers action in the payment dispatchers file with
the payment method data store

* Get payment status from data store

* Use data store for the payment error status

* Use payment data store failed status

* Use payment data store for the isFinished status

* Update the setPaymentStatus argument

* Set up setRegisteredPaymentMethods in data store

* Use the data store version of the registeredPaymentMethods

* Fix the default state type of the registeredPaymentMethods

* Set up setRegisteredExpressPaymentMethod in data store

* Use the data version of the registred express payment methods

* Set the correct action type for removing payment methods

* Fix default state express payment methods type

* Use the store data version of activePaymentMethod

* Use setActivePaymentMethod in the dispatchers file

And refactor code

* Update payment status arguments for express payment methods

* Use paymentMethodData from the data store

* Use payment method's errorMessage from data store

* Update paymentMethods list in data store reducer

* Replace remaining payment context data with data store

* Clean up payment method context file

* Get payment method state from data store in the checkout submit hook

* Copy types.ts file into the payment data store folder

* Fix isExpressPaymentMethodActive selector

* Move the entire currentStatus into the data store

* Replace the payment context state with the data store

* Fix getActiveSavedToken & clean up the context file

* Use the accutrate name of the "createErrorNotice"

* Update the payment method data store key import

* Diable unused state from the context

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>

* Refactor the payment method data store & context (https://github.com/woocommerce/woocommerce-blocks/pull/6607)

* Add checkout data store

* wip on checkout data store

* CheckoutContext now uses the checkout store

* Investigated and removed setting the redirectUrl on the default state

* update extension and address hooks to use checkout data store

* use checkout data store in checkout-processor and use-checkout-button

* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity

* Remove useCheckoutContext from shipping provider

* Remove isCalculating from state

* Removed useCheckoutContext from lots of places

* Remove useCheckoutContext from checkout-payment-block

* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block

* add isCart selector and action and update the checkoutstate context

* Fixed redirectUrl bug by using thunks

* Remove dispatchActions from checkout-state

* Change SET_HAS_ERROR action to be neater

* Thomas' feedback

* Tidy up

* Oops, deleted things I shouldn't have

* Typescript

* Fix types

* Fix tests

* Remove isCart

* Update docs and remove unecessary getRedirectUrl() selector

* set correct type for preloadedCheckoutData

* Remove duplicate Address type

* Fix missing addresses from type-defs index

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Revert feedback changes

* REvert feedback formatting

* Update docs formatting

* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type

* Add default state for PaymentMethod data store

* Add preliminary action types

* Add preliminary action dispatchers

* Create payment method data store

* Add preliminary reducers for payment method data store

* Add preliminary selectors for payment method data store

* Add reducers/actions for registering payment methods

* Export payment method data store key

* Add test for payment method data reducers

* Add shouldSavePaymentMethod selector

* Add store key as constant

* Add more action types for registering and initializing payment methods

* Get active payment method from data store instead of from context

* Add registered methods to default state of payment method data store

* Dispatch name of registered payment method to payment method data store

* Remove setShouldSavePayment from payment method dispatcher and types

* Get payment methods from registry instead of payment context

* Add available payment methods to store

* Add function to check whether payment methods are allowed to be used

* Add selector to check if payments are initialised

* Remove resolvers and add controls to payment method data store

* Change type of payment requirements to string[]

* Turn addRegistered and addRegisteredExpress into generators

This is so we can check each payment method's validity before adding it to the list of available payment methods

* Add action type for setting express payments as initialized

* Only select from available methods in payment method options

* Remove argument from addRegisteredPaymentMethod in payment method registry

* Rename folder and store name to not contain the word data

* Add selectors for express payment methods and their initialisation

* Delete controls again in favour of thunks

* Rename payment-method-data to payment-methdods

* Create new setDefaultPaymentMethod function

This will set the payment method when the cart loads.

* Add CustomerPaymentMethodConfiguration type

* Make getAvailableExpressPaymentMethods return correct data

* Check express methods and normal methods when cart changes

* Add action for setting active express payment methods

* Handle express methods in checkPaymentMethodCanPay

* Hide express payments area if none are available

* Add selector for paymentMethodData

* Add customer data to default state and add selector for it

* Add setPaymentStatus action and reducer case

* Set the default payment method when one isn't selected

* Correct types on getCustomerPaymentMethods

* Set status in data store alongside context status

* Comment out active gateway selection - remove later

* Set status in express payment methods in data store

* Directly check payment methods from the list in blocks-registry

* Add semicolon to import statement

* Fix payment method data state call

* Get paymentMethodData from store not context

* Add addPaymentMethodData action/reducer case

* Update payment method on payment success

* Add 'getCurrentStatus' selector

* Remove the temporary solution

For getting payment method data into the data store

* Prevent the 'success' context action from being dispatched

* Update the "setPaymentStatus" data store action

Accept status as an object instead of string

* Fix the "currentStatus" reducer state update value

* Get payment data into data store

* Set the correct payment status to data store

* Get the success status of payment from data store

* Use store data in the payment dispatchers

Replace the React useReducers action in the payment dispatchers file with
the payment method data store

* Get payment status from data store

* Use data store for the payment error status

* Use payment data store failed status

* Use payment data store for the isFinished status

* Update the setPaymentStatus argument

* Set up setRegisteredPaymentMethods in data store

* Use the data store version of the registeredPaymentMethods

* Fix the default state type of the registeredPaymentMethods

* Set up setRegisteredExpressPaymentMethod in data store

* Use the data version of the registred express payment methods

* Set the correct action type for removing payment methods

* Fix default state express payment methods type

* Use the store data version of activePaymentMethod

* Use setActivePaymentMethod in the dispatchers file

And refactor code

* Update payment status arguments for express payment methods

* Use paymentMethodData from the data store

* Use payment method's errorMessage from data store

* Update paymentMethods list in data store reducer

* Replace remaining payment context data with data store

* Clean up payment method context file

* Get payment method state from data store in the checkout submit hook

* Copy types.ts file into the payment data store folder

* Fix isExpressPaymentMethodActive selector

* Move the entire currentStatus into the data store

* Replace the payment context state with the data store

* Fix getActiveSavedToken & clean up the context file

* Use the accutrate name of the "createErrorNotice"

* Update the payment method data store key import

* Diable unused state from the context

* Get enabled customer payment methods using data store selector

* Remove remaining useReducer action from the dispatchers file

* Update types and remove unused vars

* Remove the payment method dispatchers hook

* Refactor & clean up (remove unused files)

* Remove commented line from payment methods types

* Move event emitter into thunks

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>

* Remove checkout-state after merge conflicts

* Fix linting errors

* Move types to types.ts

* Move default states into respective store folders

* Fix types and add comment

* Move setExpressPaymentError to payment-methods store

* fix express payment methods not showing up

* Check if payment method is active from the state

* Add comments

* Remove commented out code in payment method data context

* Display an error in the check-payment-methods directly from data store

* Remove use-emit-response hook and move utils in event-emit/utils.ts

* Use correct action property to remove payment methods

* Fix formatting

* Only try to initialize payment methods when cart is done loading

* Add function to order payment methods from server

* Add payment methods in the correct order

* Prevent adding registered payment methods before cart is ready

* Ensure payment methods get removed from state when deregistered

* Reorder setting default payment methods to add customer methods first

* Get customer methods from store not context

* Remove error from payment-method state and associated selectors

* Remove use-payment-method-registration and update the payment method state to remove the duplicated registeredPaymentMethods

* Remove errorMessage from payment-methods store

* Rename customerPaymentMethods -> savedPaymentMethods

* Order payment methods when validating

* Refactor payment-methods.js

* Fix "Payment methods not set in editor" woocommerce/woocommerce-blocks#6655 bug

We never get to load the payment methods object in the editor mode
because there are no cart totals to load.

* Initialize payment methods when available payments are loaded

* Remove duplicate code

* Fix data store state mutation anti-pattern

A Redux rule is to never mutate the state in a reducer to avoid any unexpected results

* Set availablePaymentMethods to the paymentMethods object

Instead of its keys. We can get the keys using "Object.keys".

* Use the available ordered payment methods

The `getPaymentMethods` & `getExpressPaymentMethods` may include unordored
& unavailable payment methods.

* Get the correct value from the emit event response

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2022-09-28 13:45:42 +01:00
Tarun Vijwani 4de3bdb0f1 Convert validation context to data store (https://github.com/woocommerce/woocommerce-blocks/pull/6402)
* Add validation reducers, actions, and action types

* Add selector for getValidationErrors

* Export store key and register store

* Export validation store key

* Move TextInput files to checkout package

* Export ValidatedTextInput from blocks-checkout package

* Update imports of ValidatedTextInput to reflect new location

* Use the validation wp-data store for showing error messages

* Export getValidationError in checkout package

* Move validation store to checkout package

* Move ValidationInputError to blocks-checkout package

* Only export "exposedSelectors" from validation

* Convert validation context to data store

* Fixed linting error

* Fixed linting error

* Change the validation selectors to return a function

* Convert reducer and selectors to TS

* Remove superfluous comments and improve test titles

* Test to ensure visible errors remain visible

* Make test for hasValidationErrors more robust

* Augment the wp-data module to include our selectors and actions

* Removed unused `exposedSelectors` variable

* Remove TS error because of `instanceId` on props

* Remove unnecessary as const

* Use function returned by getValidationError

* Use correct selector/action names now context has been decoupled

* hide validation error when input value changes

* Add correct aria-describedBy now we can get error id from store

* Clear validation error from store when component unmounts

* Clear validation error if input is valid

* convert ValidationInputError to TS and get correct id/error from store

* Ensure checkout block doesn't break when there are no errors

* Get validation data from the store instead of context

* Update country input to remove validation context

* Move validation store out of checkout package

* Move TextInput and ValidationInputError back out of the checkout package

* Remove duplicate internal styles comment

* Remove exports that no longer exist

* Get validation store key from block-data

* Make attribute-select-control use validation data store

* Export FieldValidationStatus type

* Make combobox use validation store not context

* Make Address use validation store not context

* Make Address use validation store not context

* Use hasValidationErrors selector as a function in shipping calculator

* Remove validation context from coupon story

* Import VALIDATION_STORE_KEY from correct location

* Stop coupon story from erroring

* Update useStoreCartCoupons to use validation store not context

* Make TotalsCoupon use validation store instead of context

* Make AddToCartFormContext use validation store not context

* Remove ValidationContext

* Import FieldValidationStatus from correct location

* Import ValidatedTextInput and ValidatedTextInput from correct location

* Remove ValidationContextProvider

* Update components to use validation store not context

* Update useValidation to use the data store

* Replace the validation context in checkout-events file

* Use the re-mapped path for the store key import

* Use "register" instead of the deprecated "registerStore"

* Fix import error of the "FieldValidationStatus" type

* Use TS instead of React's "PropTypes"

* Fix the type of "ValidationInputError" in the "payment-method-interface"

* Fix error not showing on the first place order click bug

We were mutating the state in the reducer, which prevented re-rendering
on state change

* Fix state mutation issue in the Validation reducer

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-09-28 13:45:42 +01:00
Alex Florisca 22f61cf4d9 Fixed missing lint error 2022-09-28 13:45:42 +01:00
Alex Florisca e2c495d7ac Fix lint issues 2022-09-28 13:45:42 +01:00
Alex Florisca 015291ccf3 Move checkout state code into thunks and rename `CheckoutState` context to `CheckoutEvents` (https://github.com/woocommerce/woocommerce-blocks/pull/6455)
* Add checkout data store

* wip on checkout data store

* CheckoutContext now uses the checkout store

* Investigated and removed setting the redirectUrl on the default state

* update extension and address hooks to use checkout data store

* use checkout data store in checkout-processor and use-checkout-button

* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity

* Remove useCheckoutContext from shipping provider

* Remove isCalculating from state

* Removed useCheckoutContext from lots of places

* Remove useCheckoutContext from checkout-payment-block

* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block

* add isCart selector and action and update the checkoutstate context

* Fixed redirectUrl bug by using thunks

* Remove dispatchActions from checkout-state

* Change SET_HAS_ERROR action to be neater

* Thomas' feedback

* Tidy up

* Oops, deleted things I shouldn't have

* Typescript

* Fix types

* Fix tests

* Remove isCart

* Update docs and remove unecessary getRedirectUrl() selector

* validate event emitter button

* Added thunks in a separate file

* Call thunks from checkout-state

* Checkout logic tested and working

* Remove dependency injection as much as poss, tidy up and fix some TS errors

* Fix types in thunks.ts

* Fixed some ts errors

* WIP

* Fixed bug

* Shift side effects from checkout-state to checkout-processor

* Revert "Shift side effects from checkout-state to checkout-processor"

This reverts commit 059533da4eb34f9982f66cd4adacc7b2c24f939f.

* Rename CheckoutState to CheckoutEvents

* Move status check outside the thunk

* remove duplicate EVENTS constant

* remove temp buttons

* Remove console logs

* Augment @wordpress/data package with our new store types

* Add correct type for CheckoutAction

* Remove createErrorNotice arg from runCheckoutAfterProcessingWithErrorObservers

* Remove createErrorNotice from emit event types

* Use type keyword when importing types

* Add correct types for dispatch and select in thunks

* Update wordpress/data types

* Replace store creation with new preferred method

* Set correct action type on reducer

* Remove unnecessary async from thunk

* add CHECKOUT_ prefix to checkout events again

* export EVENTS with eveything else in checkout0-events/event-emit

* Remove duplicate SelectFromMap and TailParameters

* Updated type for paymentStatus

* TODO remove wp/data experimental thunks

* Remove `setCustomerId` from events and `processCheckoutResponseHeaders` (https://github.com/woocommerce/woocommerce-blocks/pull/6586)

* Prevent passing dispatch, instead get actions direct from store

* Get setCustomerId from the store instead of passing it to processCheckoutResponseHeaders

* Revert "Prevent passing dispatch, instead get actions direct from store"

This reverts commit 4479a2ef5599d9c8d99c3629616b3d662210fc08.

* Auto stash before revert of "Prevent passing dispatch, instead get actions direct from store"

* Remove duplicate dispatch

* Fix unit tests

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-09-28 13:45:42 +01:00
Alex Florisca 3630b7b03e Convert checkout context to data store - part 1 (https://github.com/woocommerce/woocommerce-blocks/pull/6232)
* Add checkout data store

* wip on checkout data store

* CheckoutContext now uses the checkout store

* Investigated and removed setting the redirectUrl on the default state

* update extension and address hooks to use checkout data store

* use checkout data store in checkout-processor and use-checkout-button

* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity

* Remove useCheckoutContext from shipping provider

* Remove isCalculating from state

* Removed useCheckoutContext from lots of places

* Remove useCheckoutContext from checkout-payment-block

* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block

* add isCart selector and action and update the checkoutstate context

* Fixed redirectUrl bug by using thunks

* Remove dispatchActions from checkout-state

* Change SET_HAS_ERROR action to be neater

* Thomas' feedback

* Tidy up

* Oops, deleted things I shouldn't have

* Typescript

* Fix types

* Fix tests

* Remove isCart

* Update docs and remove unecessary getRedirectUrl() selector

* set correct type for preloadedCheckoutData

* Remove duplicate Address type

* Fix missing addresses from type-defs index

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Update docs/block-client-apis/checkout/checkout-api.md

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

* Revert feedback changes

* REvert feedback formatting

* Update docs formatting

* Delete empty types.ts file

* remove merge conflict from docs

* Correct linting in docs

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-09-28 13:45:42 +01:00
Luigi Teschio 3732363ba6 Add to the Product Button block the support for the Product Query block (https://github.com/woocommerce/woocommerce-blocks/pull/6948)
* Adds to the Product Image Block the support for the Product Query Block

Adds to the Product Image Block the support for the Product Query Block woocommerce/woocommerce-blocks#6911

* use shared config

* use shared config

* use shared config

* Add to the Product Button Block the support for the Product Query Block

* Add to the Product Image Block the support for the Product Query Block

* fix lint errors

* address feedback

* set grid view and font-size L as default
2022-09-28 10:54:38 +02:00
Lucio Giannotta 7125b08655 Bump version strings 2022-09-27 18:04:07 +02:00
github-actions[bot] 78b02ce741 Release: 8.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7228)
Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-09-27 17:56:29 +02:00
Manish Menaria ac064775f4 Fix not enough margin for Filter blocks woocommerce/woocommerce-blocks#7018 (https://github.com/woocommerce/woocommerce-blocks/pull/7226) 2022-09-27 12:48:06 +05:30
Niels Lange 9678673497 Allow rendering HTML in shipping package names (https://github.com/woocommerce/woocommerce-blocks/pull/7147)
* Allow renderiung HTML in shipping package names

* Sanitize HTML to render

* Create reusable util sanitizeHTML

* Solve TS error

* Remove __experimentalApplyCheckoutFilter
2022-09-26 23:16:44 +07:00
Seghir Nadir 0f57123095 Local pickup rates are always returned regardless of the shipping zone. (https://github.com/woocommerce/woocommerce-blocks/pull/7177)
* local pickup is always returned no matter the zone

* wrap filters in feature flags

* switch to experimental
2022-09-26 15:51:32 +01:00
Saad Tarhi 085242bbe9 Clean the top-level of the /build folder (https://github.com/woocommerce/woocommerce-blocks/pull/7047)
* Generate Inner Blocks' JSON files in a common folder

* Get the correct metadata path for the Inner Blocks

The Inner Blocks' metadata lives now in the `/build/inner-blocks`. But,
the function `get_block_metadata_path` was only looking for metadata
inside the top-level of the `build/` folder
2022-09-26 15:02:36 +01:00
Daniel W. Robert 1feb2202bb Update lockfile changes since DOMPurify addition. (https://github.com/woocommerce/woocommerce-blocks/pull/7225)
Fixes woocommerce/woocommerce-blocks#7224.
2022-09-26 15:13:22 +02:00
Hsing-yu Flowers 04743add72 Check tax display type before returning the tax lines (https://github.com/woocommerce/woocommerce-blocks/pull/7084)
* Check tax display type before returning the tax lines

* Return early if not itemized
2022-09-23 16:33:12 -04:00
Hsing-yu Flowers c2c639dee1 Sanitize store notices html (https://github.com/woocommerce/woocommerce-blocks/pull/7145)
Sanitizing the merchant store link in the error message added in WooPay when in some
cases the customer could run into an issue where we need to tell them an error occurred
and they have to go back to the merchant store and re-initialize WooPay to fix it.

Because previously we were only expecting strings, the text was not sanitized.
2022-09-23 20:48:28 +02:00
Lucio Giannotta d174051787 Refactor Product Query to use the latest Gutenberg APIs (https://github.com/woocommerce/woocommerce-blocks/pull/7169)
* Refactor Product Query to use the latest Gutenberg APIs

As we worked with Gutenberg folks in WordPress/gutenbergwoocommerce/woocommerce-blocks#43590,
WordPress/gutenbergwoocommerce/woocommerce-blocks#43632 and WordPress/gutenbergwoocommerce/woocommerce-blocks#44093 we have
created a standard API that could be used for our use-case. This
PR refactors our WIP experimental work to use that standardized API.
2022-09-23 15:07:44 +02:00
Beau Lebens 6b0407d200 Make sure people understand this it WP version (https://github.com/woocommerce/woocommerce-blocks/pull/7209)
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-09-23 13:48:15 +01:00
Luigi c3e3b29c6b Merge branch 'release/8.5.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-09-23 14:33:05 +02:00
github-actions[bot] 0ea0985a22 Release: 8.5.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7212)
* use full link for WordPress resources (https://github.com/woocommerce/woocommerce-blocks/pull/7211)

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

* Empty commit for release pull request

* update readme

* add testing instructions

* add zip file link

* update testing instructions and changelog entry

* Bumping version strings to new version.

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
2022-09-23 14:29:20 +02:00
Seghir Nadir e0d968b310 use full link for WordPress resources (https://github.com/woocommerce/woocommerce-blocks/pull/7211)
Co-authored-by: Niels Lange <info@nielslange.de>
2022-09-23 18:02:05 +07:00
Seghir Nadir c52825ca7b switch to a permament link in errors (https://github.com/woocommerce/woocommerce-blocks/pull/7205) 2022-09-22 13:17:26 +01:00
Niels Lange 690ccb5191 Remove experimental flag from Cross-Sells block (https://github.com/woocommerce/woocommerce-blocks/pull/7188)
* Remove experimental flag from Cross-Sells block

* Remove experimental flag from Cross-Sells block

* Remove experimental flag from woocommerce/cart-cross-sells-products-block
2022-09-22 12:28:55 +07:00
Alex Florisca 79b1d4a38a Revert "Add static class name for product-details (https://github.com/woocommerce/woocommerce-blocks/pull/6914)" (https://github.com/woocommerce/woocommerce-blocks/pull/7191)
This reverts commit d6d94ae622.
2022-09-21 15:20:00 +01:00
Niels Lange 77a2255978 Create 2e2 tests for Cross-Sells block (https://github.com/woocommerce/woocommerce-blocks/pull/6983)
* Create Cross-Sells product list

* Show “Read more” button for out-of-stock cross-sells products

* Update assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.tsx

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

* Update assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx

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

* Remove obsolete isLoading and placeholderRows

* Fix TS errors

* Rename crossSellsProduct to product

* Fix critical error

* Create 2e2 tests for Cross-Sells block

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-09-21 13:29:16 +07:00
Niels Lange 3d55668983 Create Cross-Sells product list (https://github.com/woocommerce/woocommerce-blocks/pull/6645)
* Create Cross-Sells product list

* Show “Read more” button for out-of-stock cross-sells products

* Update assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.tsx

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

* Update assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx

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

* Remove obsolete isLoading and placeholderRows

* Fix TS errors

* Rename crossSellsProduct to product

* Fix critical error

* Lock “Cart Cross-Sells products” inner block

* Update assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.json

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

* Prevent moving of the Cross-Sells block

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-09-21 13:04:15 +07:00
Paulo Arromba 8a5dd65bc1 fix: Markup is visible in checkout error notices (https://github.com/woocommerce/woocommerce-blocks/pull/6800)
* Enabled __unstableHTML hidden option for HTML rendering within notices.

* Fixed margin-bottom for HTML notice content

* Fixed margin-top for HTML notice content

* Attempt to fix a broken e2e test
2022-09-20 16:54:25 +01:00
Albert Juhé Lluveras def2e0c450 Add step to release checklist to review and merge the WC core PR (https://github.com/woocommerce/woocommerce-blocks/pull/7100) 2022-09-20 07:55:03 -05:00
Niels Lange 7bd48074fb Prevent Express Checkout block from being cut off (https://github.com/woocommerce/woocommerce-blocks/pull/7152)
* Prevent Express Checkout block from being cut off

* Prevent step numbers from being cut off in editor
2022-09-20 17:45:20 +07:00
Raluca Stan 713fcd0b4d Update checkout-flow-and-events.md (https://github.com/woocommerce/woocommerce-blocks/pull/7071) 2022-09-20 11:16:53 +02:00
dependabot[bot] 2f0d6e04ef Bump @storybook/client-api from 6.5.9 to 6.5.12 (https://github.com/woocommerce/woocommerce-blocks/pull/7182)
Bumps [@storybook/client-api](https://github.com/storybookjs/storybook/tree/HEAD/lib/client-api) from 6.5.9 to 6.5.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.12/lib/client-api)

---
updated-dependencies:
- dependency-name: "@storybook/client-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-19 14:12:24 -04:00
dependabot[bot] 12c668d51c Bump mockery/mockery from 1.5.0 to 1.5.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7124)
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.5.0...1.5.1)

---
updated-dependencies:
- dependency-name: mockery/mockery
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-19 13:26:47 -04:00
Thomas Roberts 2e245fdf10 Fix indentation on payment method integration documentation (https://github.com/woocommerce/woocommerce-blocks/pull/7156) 2022-09-16 08:10:24 -07:00
Tarun Vijwani 4d8cc8d751 Fix: Inner blocks control position for Cart Block (https://github.com/woocommerce/woocommerce-blocks/pull/6973) 2022-09-16 11:32:46 +05:30
Luigi Teschio d1e19fc61b Add Dependabot documentation (https://github.com/woocommerce/woocommerce-blocks/pull/7141)
* Add Dependabot documentation

* fix typos

* Update docs/internal-developers/automations/dependabot.md

Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>

Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2022-09-15 15:54:47 +02:00
Luigi Teschio 84432552a8 Product Query: Fix pagination issue (https://github.com/woocommerce/woocommerce-blocks/pull/7109) 2022-09-15 13:53:56 +02:00
Albert Juhé Lluveras 87e1748811 Make chevron clickable in Filter by Product block input (https://github.com/woocommerce/woocommerce-blocks/pull/7139)
* Make chevron clickable in Filter by Product block

* Make sure the chevron is vertically centered
2022-09-15 12:39:34 +02:00
Hsing-yu Flowers fb213b3b1b Use the eslint config at the root of the repo (https://github.com/woocommerce/woocommerce-blocks/pull/7149) 2022-09-14 15:00:20 -07:00
Albert Juhé Lluveras ca1eac7f7e Update automatic reviewer assignment to Woo FSE team name (https://github.com/woocommerce/woocommerce-blocks/pull/7143) 2022-09-14 15:04:46 +02:00
Albert Juhé Lluveras 8d03ad4f4f Remove unused CSS selectors from Filter blocks (https://github.com/woocommerce/woocommerce-blocks/pull/7150) 2022-09-14 09:47:50 +02:00
Niels Lange eee72c822d Fix broken tables in available-filters.md 2022-09-14 14:47:08 +07:00
Luigi Teschio e4cd50a4ef Run test that does snapshot only when Gutenberg is disabled (https://github.com/woocommerce/woocommerce-blocks/pull/7142) 2022-09-14 09:04:15 +02:00
Thomas Roberts 8715fe1ce9 Add stale labels to PRs, exclude additional labels, prevent closing (https://github.com/woocommerce/woocommerce-blocks/pull/7058) 2022-09-13 11:18:31 -07:00
Luigi Teschio de433503c8 Fix e2e test - Filter products by stock block (https://github.com/woocommerce/woocommerce-blocks/pull/7137) 2022-09-13 17:16:59 +02:00
Luigi 1f71891e2d Update version to 8.6.0-dev 2022-09-13 14:32:33 +02:00
github-actions[bot] 4ab8f9c768 Release: 8.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7110)
* Empty commit for release pull request

* add changelog - 8.5.0 version

* Add testing instructions

* add missing screenshot

* Fix pills in the Filter by Attribute block dropdown overlapping with the chevron (second attempt) (https://github.com/woocommerce/woocommerce-blocks/pull/7112)

* Fix invisible Reset filter button in some themes (https://github.com/woocommerce/woocommerce-blocks/pull/7111)

* update link zip file

* 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: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-09-13 14:29:51 +02:00
Luigi 56adbe912a Bumping version strings to new version. 2022-09-13 14:22:22 +02:00
Luigi be9ab04e2f update link zip file 2022-09-13 10:29:25 +02:00
Albert Juhé Lluveras aaa480f0bb Fix invisible Reset filter button in some themes (https://github.com/woocommerce/woocommerce-blocks/pull/7111) 2022-09-13 09:33:08 +02:00
Albert Juhé Lluveras 27e8dcbebb Fix pills in the Filter by Attribute block dropdown overlapping with the chevron (second attempt) (https://github.com/woocommerce/woocommerce-blocks/pull/7112) 2022-09-13 09:32:58 +02:00
Albert Juhé Lluveras 16feccdd74 Fix invisible Reset filter button in some themes (https://github.com/woocommerce/woocommerce-blocks/pull/7111) 2022-09-13 09:32:11 +02:00
Albert Juhé Lluveras 798fdc2107 Fix pills in the Filter by Attribute block dropdown overlapping with the chevron (second attempt) (https://github.com/woocommerce/woocommerce-blocks/pull/7112) 2022-09-13 09:31:51 +02:00
Luigi 763d921d83 add missing screenshot 2022-09-12 16:26:39 +02:00
Luigi a1899fdf53 Add testing instructions 2022-09-12 14:51:39 +02:00
Luigi 189b945691 Merge branch 'release/8.5.0' of https://github.com/woocommerce/woocommerce-blocks into release/8.5.0 2022-09-12 14:35:45 +02:00
Luigi b11d587b12 add changelog - 8.5.0 version 2022-09-12 14:19:42 +02:00
Lucio Giannotta 5dd05d7ab2 Improve public-facing texts and labels (https://github.com/woocommerce/woocommerce-blocks/pull/7045)
We noticed that oftentimes our labels and text tend to be overly
technical or unclear. We decided to do a bulk pass to improve
the readability to non-technical users.
2022-09-12 10:39:26 +02:00
Niels Lange 2f52565c75 Correct broken *.md links (https://github.com/woocommerce/woocommerce-blocks/pull/7108) 2022-09-12 11:29:24 +07:00
Daniel W. Robert 252caccb82 Featured Items: Remove inline style defaults for color options (https://github.com/woocommerce/woocommerce-blocks/pull/7036)
* Remove inline style defaults for color options.

This replaces the inline style with an added editor-specific styling
with slightly more specificity - but not too much to where it overrides
the Site Editor.

* Remove additional styles from editor stylesheet.

These styles are meant to apply to both the frontend and the editor. The
ruleset was originally added to the editor stylesheet to add an
additional layer of specificity but it was decided that this is
unnecessary.
2022-09-09 13:15:19 -04:00
Daniel W. Robert 32bebd381e Update Active Filters "remove filter" icon to use Icon component (https://github.com/woocommerce/woocommerce-blocks/pull/7035)
* Update "remove filter" icon to use Icon component.

To be consistent with the button icon used on the Chips view, this
replaces the native svg element used in the List view with the same
Icon component from core.

* Add proper margin to active filters by price list.

There is currently no top margin when the active filters contain a price
filter in the list view. This is because the filters only contain a
range and do not render a child list.

This update will target that price filter item and add a top margin that
is consistent with the other active filters.
2022-09-09 11:06:42 -04:00
Alba Rincón 05630a0352 Fix formatting (https://github.com/woocommerce/woocommerce-blocks/pull/7105)
Co-authored-by: Niels Lange <info@nielslange.de>
2022-09-09 13:33:15 +02:00
Alba Rincón cc0f9906d2 Add Apply button placeholders to filters and adjust title margins (https://github.com/woocommerce/woocommerce-blocks/pull/7077)
* Adjust filter titles margins

* Show the Apply button placeholder and adjust title margins

* Add placeholder for the Apply button on filter by price

* Add placeholder for the Apply button on filter by attr

* Update stock filter snapshot

* Move the apply button placeholder to inside the FilterSubmitButton component

* Fix the placeholder button height

* Fix apply button on editor

* Change loading class to be is-loading
2022-09-09 13:28:04 +02:00
Tom Cafferkey dd11b23bef Active Filters Loading Placeholders (https://github.com/woocommerce/woocommerce-blocks/pull/7083)
* Active Filters Loading Placeholders

* Use flexbox for active filters loading placeholders

* Clear all placeholder loading styles

* Ensure active filters which arent attribute filters render null when in a loading state

* Refactor loading placeholders and state setting

* Add useIsMounted to shared hooks and check productAttributes only when mounted

* Add componentHasMounted to useMemo deps

* Check URL for attribute filter hint

* Check URL for attribute filter hint

* Remove border-radius from placeholder for clear all button

* Fix filter loading when no filters are active on shop page
2022-09-09 11:59:29 +01:00
Niels Lange 4e0f50b3e5 Fix broken table 2022-09-09 15:17:00 +07:00
Albert Juhé Lluveras 380f270975 Make Active filters texts bigger (https://github.com/woocommerce/woocommerce-blocks/pull/7087) 2022-09-09 09:53:27 +02:00
Albert Juhé Lluveras 4b6a5bf997 Fix remove button alignment in Filter by Attribute block (https://github.com/woocommerce/woocommerce-blocks/pull/7088) 2022-09-08 15:38:20 +02:00
Alba Rincón 9f0d1cd86e Compare count with null to avoid rendering a 0 when count is 0 (https://github.com/woocommerce/woocommerce-blocks/pull/7073) 2022-09-08 10:41:11 +02:00
Daniel W. Robert 207354fb4e Move experimental item under Feature Plugin group
The addition of the font-weight controls is an experimental feature and should be added under the Feature Plugin section so it does not get rolled into Core.
2022-09-07 12:49:57 -04:00
Paulo Arromba 0631b04dbe Suppress unnecessary warnings for old namespace aliasing (https://github.com/woocommerce/woocommerce-blocks/pull/7046)
* Aliasing classes in deprecated.php now checks for prior alias declaration to suppress unnecessary warnings.
2022-09-07 13:55:15 +01:00
Luigi Teschio 2dcd9a954a Replace 'gutenberg_build_query_vars_from_query_block' filter with 'query_loop_block_query_vars' filter (https://github.com/woocommerce/woocommerce-blocks/pull/7078) 2022-09-07 14:05:01 +02:00
Tarun Vijwani 6294b0c227 Add steps to retrieve products variations in Store API docs (https://github.com/woocommerce/woocommerce-blocks/pull/7076) 2022-09-07 15:49:10 +05:30
Luigi Teschio 26327264c0 Add default value to parameter woocommerce/woocommerce-blocks#7060 (https://github.com/woocommerce/woocommerce-blocks/pull/7074)
add default value to  parameter
2022-09-06 16:23:15 +02:00
Alba Rincón a15ffff043 Update `filter by attribute` skeleton design (https://github.com/woocommerce/woocommerce-blocks/pull/6990)
* Update filter by attribute skeleton design

* Update filter by attribute skeleton design

* Start using the FilterTitlePlaceholder

* Fix title animation

* Show two placeholder lines on checkboxes

* Fix dropdown border

* Fix gap

* Fix border radius for dropdown

* Don't show placeholder when changing other filters

* Improve filter title margins
2022-09-06 15:17:11 +02:00
Tom Cafferkey cf9325fc07 Fix corrupt Classic Template placeholders for specific products. (https://github.com/woocommerce/woocommerce-blocks/pull/7033)
* If user has created a template for a specific product, find the closest matching template details

* Move Classic Template functions into Utils file and refactor function for specific template names

* Classic Template utils refactor and unit tests
2022-09-06 10:52:33 +01:00
dependabot[bot] 820a22af0f Bump @wordpress/deprecated from 3.12.0 to 3.16.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7065)
Bumps [@wordpress/deprecated](https://github.com/WordPress/gutenberg/tree/HEAD/packages/deprecated) from 3.12.0 to 3.16.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/deprecated/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/deprecated@3.16.0/packages/deprecated)

---
updated-dependencies:
- dependency-name: "@wordpress/deprecated"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-06 11:44:10 +02:00
dependabot[bot] 575f4a4903 Bump wp-phpunit/wp-phpunit from 6.0.1 to 6.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7067)
Bumps [wp-phpunit/wp-phpunit](https://github.com/wp-phpunit/wp-phpunit) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/wp-phpunit/wp-phpunit/releases)
- [Commits](https://github.com/wp-phpunit/wp-phpunit/compare/6.0.1...6.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-06 11:28:46 +02:00
Niels Lange 25eb9f4950 Update checkout-flow-and-events.md 2022-09-06 16:23:58 +07:00
dependabot[bot] e3771fcf41 Bump @wordpress/autop from 3.12.0 to 3.16.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7063)
Bumps [@wordpress/autop](https://github.com/WordPress/gutenberg/tree/HEAD/packages/autop) from 3.12.0 to 3.16.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/autop/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/autop@3.16.0/packages/autop)

---
updated-dependencies:
- dependency-name: "@wordpress/autop"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-06 11:23:05 +02:00
dependabot[bot] b1aadf8c7c Bump @wordpress/dom from 3.2.7 to 3.16.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7053)
Bumps [@wordpress/dom](https://github.com/WordPress/gutenberg/tree/HEAD/packages/dom) from 3.2.7 to 3.16.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.16.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-05 15:37:17 +02:00
dependabot[bot] 6695359883 Bump moment-timezone from 0.5.34 to 0.5.37 (https://github.com/woocommerce/woocommerce-blocks/pull/7022)
Bumps [moment-timezone](https://github.com/moment/moment-timezone) from 0.5.34 to 0.5.37.
- [Release notes](https://github.com/moment/moment-timezone/releases)
- [Changelog](https://github.com/moment/moment-timezone/blob/develop/changelog.md)
- [Commits](https://github.com/moment/moment-timezone/compare/0.5.34...0.5.37)

---
updated-dependencies:
- dependency-name: moment-timezone
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

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>
2022-09-05 12:51:25 +02:00
dependabot[bot] 7bd1464c9e Bump commander from 9.3.0 to 9.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6831)
Bumps [commander](https://github.com/tj/commander.js) from 9.3.0 to 9.4.0.
- [Release notes](https://github.com/tj/commander.js/releases)
- [Changelog](https://github.com/tj/commander.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tj/commander.js/compare/v9.3.0...v9.4.0)

---
updated-dependencies:
- dependency-name: commander
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

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>
2022-09-05 12:34:07 +02:00
dependabot[bot] 846666deda Bump core-js from 3.23.3 to 3.25.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7051)
Bumps [core-js](https://github.com/zloirock/core-js) from 3.23.3 to 3.25.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.23.3...v3.25.0)

---
updated-dependencies:
- dependency-name: core-js
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-05 12:17:12 +02:00
dependabot[bot] 58838d025f Bump automattic/jetpack-autoloader from 2.11.6 to 2.11.7 (https://github.com/woocommerce/woocommerce-blocks/pull/6810)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.6 to 2.11.7.
- [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.6...v2.11.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-05 12:05:06 +02:00
Alba Rincón 5e96759159 Fix php format (https://github.com/woocommerce/woocommerce-blocks/pull/7050) 2022-09-05 11:35:10 +02:00
dependabot[bot] 2c9e9e9dc6 Bump @actions/core from 1.9.0 to 1.9.1 (https://github.com/woocommerce/woocommerce-blocks/pull/6938)
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-05 11:05:06 +02:00
dependabot[bot] 83b5a482af Bump @wordpress/browserslist-config from 4.1.2 to 5.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7003)
Bumps [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) from 4.1.2 to 5.0.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.0.0/packages/browserslist-config)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2022-09-05 10:59:13 +02:00
dependabot[bot] e4d0f1d0af Bump @typescript-eslint/parser from 5.31.0 to 5.35.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7004) 2022-09-05 08:49:33 +00:00
Tarun Vijwani ec1da6a68c Fix experimental interface document link in release initial checklist (https://github.com/woocommerce/woocommerce-blocks/pull/6992) 2022-09-05 10:45:03 +05:30
github-actions[bot] db69fd92fc Release: 8.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/7001)
* Empty commit for release pull request

* Add the changelog to `readme.txt`

* Add testing instructions & release zip

* Fix video tags

* Update feedback document path

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-09-02 18:20:01 +01:00
Alba Rincón f141a75acc Update `filter by price` skeleton design (https://github.com/woocommerce/woocommerce-blocks/pull/6997)
* Update filter by price skeleton design

* Improve skeleton colors

* Update skeleton when no apply button

* Update skeleton with apply button

* Avoid showing a very wide placeholder when the filter title is very long

* Start using the FilterTitlePlaceholder component for the placeholder

* Add comment to isUpdating

* Remove unneeded styles

* Fix title animation
2022-09-02 15:52:52 +02:00
Alba Rincón 70cbc31332 Fix pills in the `Filter by Attribute` block dropdown overlapping with the chevron (https://github.com/woocommerce/woocommerce-blocks/pull/7039)
* Avoid chevron overlap

* Improve input width calculation
2022-09-02 12:57:58 +02:00
Luigi Teschio 3ea46e426a Add to the Product Image block the support for the Product Query block (https://github.com/woocommerce/woocommerce-blocks/pull/6911)
* Adds to the Product Image Block the support for the Product Query Block

Adds to the Product Image Block the support for the Product Query Block woocommerce/woocommerce-blocks#6911

* Add to the Product Image Block the support for the Product Query Block

* address feedback

* set grid view and font-size L as default
2022-09-01 15:13:19 +02:00
Tung Du a80426917f Product Search E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/7005) 2022-09-01 18:20:20 +07:00
Daniel W. Robert 6b251cc222 Remove __experimentalDuotone from block.json. (https://github.com/woocommerce/woocommerce-blocks/pull/7000)
The __experimentalDuotone Supports property in the block.json files were
preventing the Global Styles from being applied in the Editor.

Removing them remedies the issue.

This also adds a Schema property to improve development in supported
editors. See
https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#benefits-using-the-metadata-file.
2022-08-31 13:03:21 -04:00
Tom Cafferkey 89cdf7897a Set default orderby to popularity (https://github.com/woocommerce/woocommerce-blocks/pull/7025) 2022-08-31 12:38:48 +01:00
Alba Rincón 3421857599 Fix stock filter placeholder (https://github.com/woocommerce/woocommerce-blocks/pull/7009)
* Set max-height to avoid showing a big placeholder on longer titles

* Avoid showing placeholder when no there are no products

* Extract the placeholder to a separate component

* Adjust width

* Adjust border radius

* Pass the title to adjust the placeholder width/height

* Rename component
2022-08-31 10:43:26 +02:00
Saad Tarhi ff48e7d45a Update version to 8.5.0-dev 2022-08-30 12:37:33 +01:00
Alba Rincón 1e488287ed Update `filter by stock` skeleton design (https://github.com/woocommerce/woocommerce-blocks/pull/6996)
* Update filter by stock skeleton design

* Show skeleton only when is loading, otherwise it will show the loading state also after clicking on an option
2022-08-30 09:32:30 +02:00
Alex Florisca d6d94ae622 Add static class name for product-details (https://github.com/woocommerce/woocommerce-blocks/pull/6914)
* Add a static class name for the product details item instead of the translatable string

* Update Jest snapshot

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-08-29 11:46:33 +01:00
Alba Rincón aa214f4d28 Remove the price filter setting label style (https://github.com/woocommerce/woocommerce-blocks/pull/6994) 2022-08-29 10:41:25 +02:00
Seghir Nadir 42f3ffefc9 Turn current page into the default Cart/Checkout page (https://github.com/woocommerce/woocommerce-blocks/pull/6867)
* Add default page notice

* show notice all inner blocks

* support flow when page isnt saved

* switch from where we get the current post id

* update lock

* fix types

* update logic to support cart as well

* fix package.json

* update design and move away from wc.data

* restore notice

* handle older versions of WooCommerce

* fix package lock

* fix typo
2022-08-29 09:35:05 +01:00
Seghir Nadir 241350c0c9 only load shipping countries when shipping is needed (https://github.com/woocommerce/woocommerce-blocks/pull/6901) 2022-08-29 09:05:19 +01:00
Tarun Vijwani c0f6aec882 Change Type for shipping_address and billing_address to object (https://github.com/woocommerce/woocommerce-blocks/pull/6974)
* Change Type for shipping_address and billing_address to object

* Fix description
2022-08-29 07:29:50 +01:00
Saad Tarhi d64cb9f4b2 Fix a broken link in "available-filters.md" (https://github.com/woocommerce/woocommerce-blocks/pull/6971) 2022-08-26 18:21:50 +01:00
Daniel W. Robert b2f98c2f51 Layout Updates to Active Filters Block (https://github.com/woocommerce/woocommerce-blocks/pull/6905)
* Reverse ordter of filter item name and close btn.

* Update layout & typography styles for block items

* Update chip ui view styles.

Additionally, add editor styles to have the editor match the rendered
frontend.

* Update additional remove button styles.

- Add hover state to remove button on chip layout.
- Update disabled styles to remove button in both layouts (mainly relevant
to the editor view).

* Adjust remove button colors.

Set hover states to shades of grey. Also set chip color and text to
match selected text color of the block.

* Update e2e test to account for new element order.

Since we're moving the remove button in the list view from the last
child node to the first child node, we need to adjust the expected order
of the active filter item text.

* Design and copy updates on the block settings

Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2022-08-26 09:11:23 -04:00
dependabot[bot] a9bcc9a8fc Bump terser from 4.8.0 to 4.8.1 (https://github.com/woocommerce/woocommerce-blocks/pull/6727)
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-25 15:25:56 -04:00
dependabot[bot] aa34dfc321 Bump @storybook/react from 6.5.9 to 6.5.10 (https://github.com/woocommerce/woocommerce-blocks/pull/6858)
Bumps [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/app/react) from 6.5.9 to 6.5.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/app/react)

---
updated-dependencies:
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-25 09:10:38 -04:00
Niels Lange 6ca73386f6 Update folder-structure.md 2022-08-25 14:39:34 +02:00
Albert Juhé Lluveras 2c1dacdd93 Fix z-index issue in Filter by Attribute dropdowns (https://github.com/woocommerce/woocommerce-blocks/pull/6981)
* Fix z-index issue in Filter by Attribute dropdowns

* Remove unnecessary z-index property
2022-08-25 13:55:33 +02:00
Alba Rincón 90562ae3e0 Remove pattern file added by mistake (https://github.com/woocommerce/woocommerce-blocks/pull/6980) 2022-08-25 13:03:10 +02:00
Alba Rincón 2060f11474 `Filter by Attribute` block design updates (https://github.com/woocommerce/woocommerce-blocks/pull/6920)
* Add and style Reset and Apply buttons

* Style the dropdown option

* Fix class and label

* Fix checkbox margin in editor

* Fix alignment

* Fix the reset button

* Disable Apply button when no changes have been made to the filter to improve UX

* Reduce vertical spacing between list items

* Style chips

* Don't reload on reset if filters have not been applied

* Fix heading styles on the front end

* Add chevron down to filter by attribute dropdown ui component

* Force FormTokenField to remount on reset

* Fix dropdown z-index

* Reduce apply button margin

* Fix styles for single token selection

Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
2022-08-25 12:01:41 +02:00
Lucio Giannotta 95963a7bab Fix Product Query block hijacking all Query blocks queries (https://github.com/woocommerce/woocommerce-blocks/pull/6952)
* Fix Product Query block hijacking all Query blocks queries

The Product Query block was adding a filter to Gutenberg's core
Query Loop block. When this filter was added once, it would from
then on apply to all other Query Loop blocks (or variations thereof)
on a page.

This change makes sure that:

1. No filters are added in the first place if our custom `__woocommerceVariationProps`
are not set.
2. The filter only gets run once.
2022-08-25 02:48:36 +02:00
Seghir Nadir 58e3b33439 support mdlint in husky (https://github.com/woocommerce/woocommerce-blocks/pull/6968) 2022-08-24 14:26:14 +01:00
Tung Du 6327094a49 Style the Filter by Price block based on the wrapper width (https://github.com/woocommerce/woocommerce-blocks/pull/6943) 2022-08-24 16:10:21 +07:00
Tomasz Tunik b295689571 Product search block as core/search variation (https://github.com/woocommerce/woocommerce-blocks/pull/6191)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-08-23 23:06:17 +07:00
Alba Rincón aae8c5d357 Update filter button styles (https://github.com/woocommerce/woocommerce-blocks/pull/6958)
* Update filter button styles

* Address feedback: use mixings

* Improve the editor selector for stock apply button

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

* Reduce vertical margin and input width

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-08-23 12:38:39 +02:00
Alba Rincón d8a1dfc456 Make the inlineInput default to false to avoid changing existing block behaviour (https://github.com/woocommerce/woocommerce-blocks/pull/6957) 2022-08-23 12:10:46 +02:00
Seghir Nadir d059d98379 document add rest schema (https://github.com/woocommerce/woocommerce-blocks/pull/6960) 2022-08-22 22:24:49 +01:00
Albert Juhé Lluveras a362a89524 When converting the Filter Products by Price widget into the Filter by Price block, don't use inline input (https://github.com/woocommerce/woocommerce-blocks/pull/6953) 2022-08-22 14:29:29 +02:00
Tom Cafferkey a07cc3c978 Update Filter by Stock block (https://github.com/woocommerce/woocommerce-blocks/pull/6883)
* Update Filter by Stock controls and UI to include custom checkbox and settings.

* Include and style Filter by Stock reset button

* Make checkbox accessible via keyboard

* Update snapshot tests for Filter Products by Stock component

* Update E2E tests with new label value

* Update label test for Apply Filters in E2E tests

* Specify checkbox type so styles are not overridden in the editor

* Update E2E test label for filter button

* Update label selector to search for containing text rather than exact match

* Escape quotation marks for label query in E2E shopper tests for Filter by Stock

* Correct typo on Filter by Stock controls

* Replace custom checkbox with CheckboxControl component from the checkout package.

* Remove opacity on product count for checkbox label so its the same color as the label.

* Update snapshot tests with new component usage for filter by stock

* Update block title from Filter Products by Stock to Filter by Stock

* Update reset button behaviour to clear selections immediately regardless of whether the Apply Filters button is active or not.

* Pass option value as ID to satisfy E2E tests

* Update snapshot tests for stock filter

* Reset checked state on reset for when they have filters checked but not applied.
2022-08-19 09:04:04 +01:00
Alba Rincón 8167f0afb4 `Filter by Attribute` block settings design update (https://github.com/woocommerce/woocommerce-blocks/pull/6912)
* Updata block title and description

* Update block settings to match designs

* Update block title in tests

* Update copy in test
2022-08-19 08:55:34 +02:00
Tung Du 0bea874c8d Fix: flaky test related to setMaxPrice (https://github.com/woocommerce/woocommerce-blocks/pull/6917) 2022-08-18 13:28:46 +02:00
Luigi Teschio ffbf5823d3 Product Query Block POC (Phase 1) (https://github.com/woocommerce/woocommerce-blocks/pull/6812)
* Move `EditorBlock` to general `type-defs`

`EditorBlock` was scoped under the `featured-items` directory at the time of its creation. It is, however, a useful type that should be shared repo-wide. For this reason, I am moving it into the `blocks` type-defs and updating all the references.

* Define types for the Product Query block

Also defines a more generic `WooCommerceBlockVariation` type which should be also useful in the future to implement a similar pattern.

* Add Product Query utils

Add two utility functions:

 1. `isWooQueryBlockVariation`: is used to check whether a given block is a variation of the core Query Loop block, and also one of the allowed variations within our repo. See: `QueryVariation` enum type.
2. `setCustomQueryAttribute`: is a shorthand to set an attribute within the variation query attribute.

* Refactor and cleanup the JS demo code

Specifically:

1. Creates a `constant.ts` file to store all shared constants. Currently, the default variation attributes.
2. Move the variations to their own directory. One file per variation.
3. Move the inspector controls into own file and create a conditional logic to allow showing only certain settings.

* Update webpack config

* Add ProductQuery class

* Fix `QueryVariation` enum

We had changed the Products on Sale variation slug to something else,
but we had forgotten to update the proper enum.

* Remove unused params from `update_query`

The filter we added to Gutenberg will pass the block and the page,
as we might need them in the future and we want to minimize the
amount of changes we'll have to do upstream.

However, we currently do not use those, so I removed
them from our own inner function.

Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2022-08-18 10:02:21 +02:00
Tarun Vijwani 40ad67d9a1 Update version to 8.4.0-dev 2022-08-17 18:13:00 +05:30
Tarun Vijwani 9af266a3b9 Merge 8.3.1 patch release 2022-08-17 18:10:15 +05:30
github-actions[bot] d827e8176e Release: 8.3.1 (https://github.com/woocommerce/woocommerce-blocks/pull/6910)
* Add global styles to Product Categories List block in WC core (https://github.com/woocommerce/woocommerce-blocks/pull/6906)

* add side effect to package (https://github.com/woocommerce/woocommerce-blocks/pull/6904)

* Add _blank to terms link (https://github.com/woocommerce/woocommerce-blocks/pull/6908)

* Only show items if there are multiple packages in the cart (https://github.com/woocommerce/woocommerce-blocks/pull/6899)

* Price Filter Block Design update (https://github.com/woocommerce/woocommerce-blocks/pull/6877)

* make toggle control full width

* add inlineInput attribute

* add inlineInput sidebar setting

* add inlineInput help text

* style the filter button

* style price input

* wip: reset button

* clicking on reset button will reset the price query

* support inline input fields

* price text styling update

* fix reset button font size

* add loading placeholder to all elements

* fix filter button style

* update range slider thumb and track style

* fix loading placeholder for non empty query

* move reset button into FilterSubmitButton component

* try: render placeholder serverside

* update filter button label

* Revert "try: render placeholder serverside"

This reverts commit 98f08efdb8048b8f78c7476b774d1128c1d31295.

* remove LoadingPlaceholder component

* remove Price: prefix from the current displayed price range

* update labels

* extract reset button as a dedicated component

* update price text section

* update reset button behavior

* avoid breaking filter submit button style for other filter blocks

* rename block to Filter by Price

* fix e2e test

* remove border support

* adjust padding for elments

* rename panel title

* Make the inline option enabled by default and fix frontend rendering

* Make the `Price Range Selector` uppercase

* Show `Reset` button only when a selection has been made

* Revert the `save` change to avoid the 'Block Recovery Prompt'

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>

* Release: 8.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6897)

* Empty commit for release pull request

* Bump version numbers and add changelog

* Add testing notes

* Add global styles to Product Categories List block in WC core

* add side effect to package

* Update testing instructions

* Empty commit

* Fix linting

* Update zip file with latest changes

* Fix linting

* Update changelog entries

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Update version to 8.4.0-dev

* Empty commit for release pull request

* Add change log

* Add testing instructions

* Fix the version number in testing instructions

* Bumping version strings to new version.

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-08-17 17:32:49 +05:30
Tarun Vijwani 9eaa5d9f73 Update version to 8.4.0-dev 2022-08-17 13:19:44 +05:30
github-actions[bot] 515919617c Release: 8.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6897)
* Empty commit for release pull request

* Bump version numbers and add changelog

* Add testing notes

* Add global styles to Product Categories List block in WC core

* add side effect to package

* Update testing instructions

* Empty commit

* Fix linting

* Update zip file with latest changes

* Fix linting

* Update changelog entries

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-08-17 12:30:15 +05:30
Tung Du 401e7b5a70 Price Filter Block Design update (https://github.com/woocommerce/woocommerce-blocks/pull/6877)
* make toggle control full width

* add inlineInput attribute

* add inlineInput sidebar setting

* add inlineInput help text

* style the filter button

* style price input

* wip: reset button

* clicking on reset button will reset the price query

* support inline input fields

* price text styling update

* fix reset button font size

* add loading placeholder to all elements

* fix filter button style

* update range slider thumb and track style

* fix loading placeholder for non empty query

* move reset button into FilterSubmitButton component

* try: render placeholder serverside

* update filter button label

* Revert "try: render placeholder serverside"

This reverts commit 98f08efdb8048b8f78c7476b774d1128c1d31295.

* remove LoadingPlaceholder component

* remove Price: prefix from the current displayed price range

* update labels

* extract reset button as a dedicated component

* update price text section

* update reset button behavior

* avoid breaking filter submit button style for other filter blocks

* rename block to Filter by Price

* fix e2e test

* remove border support

* adjust padding for elments

* rename panel title

* Make the inline option enabled by default and fix frontend rendering

* Make the `Price Range Selector` uppercase

* Show `Reset` button only when a selection has been made

* Revert the `save` change to avoid the 'Block Recovery Prompt'

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2022-08-16 19:58:55 +02:00
Thomas Roberts de9b044eba Only show items if there are multiple packages in the cart (https://github.com/woocommerce/woocommerce-blocks/pull/6899) 2022-08-16 17:19:40 +01:00
Tarun Vijwani fcde655ae5 Bumping version strings to new version. 2022-08-16 21:48:54 +05:30
Seghir Nadir c338a799b3 Add _blank to terms link (https://github.com/woocommerce/woocommerce-blocks/pull/6908) 2022-08-16 15:59:21 +01:00
Saad Tarhi 51c4b9e18d Update changelog entries 2022-08-16 15:40:36 +01:00
Tarun Vijwani cb7bc46223 Fix linting 2022-08-16 17:05:23 +05:30
Tarun Vijwani 8c2a277234 Update zip file with latest changes 2022-08-16 16:45:34 +05:30
Tarun Vijwani 0b30f0fcd5 Fix linting 2022-08-16 16:33:24 +05:30
Tarun Vijwani 7042ada23f Empty commit 2022-08-16 16:26:51 +05:30
Tarun Vijwani 7584e43354 Update testing instructions 2022-08-16 16:23:28 +05:30
Nadir Seghir 9e4f093f90 add side effect to package 2022-08-16 16:22:03 +05:30
Seghir Nadir 4bfb255f6b add side effect to package (https://github.com/woocommerce/woocommerce-blocks/pull/6904) 2022-08-16 16:21:26 +05:30
Albert Juhé Lluveras 61e78c6709 Add global styles to Product Categories List block in WC core 2022-08-16 15:08:29 +05:30
Albert Juhé Lluveras 03c5d9ccd1 Add global styles to Product Categories List block in WC core (https://github.com/woocommerce/woocommerce-blocks/pull/6906) 2022-08-16 09:42:38 +02:00
Tarun Vijwani 356cebda63 Add testing notes 2022-08-15 18:56:33 +05:30
Tarun Vijwani 74a1ba215f Bump version numbers and add changelog 2022-08-15 13:48:11 +05:30
Thomas Roberts 2285d1d4e2 Include Cart and Checkout Blocks when included in WC Core (https://github.com/woocommerce/woocommerce-blocks/pull/6805)
* Remove all inbox notifications about cart and checkout blocks

* Remove feature flag check from CreateAccount class

* Remove feature plugin check to register PaymentsApi class

* Comment out is_feature_plugin_build function

We might need this later, so keeping it around seems useful.

* Remove feature plugin check when adding resource hints

* Import registerBlockType and use it over registerFeaturePLuginBlockType

* Ensure Cart and Checkout inner blocks register even if not feature plugin

* Comment out registerFeaturePluginBlockType

* Remove duplicate import

* Revert "Comment out registerFeaturePluginBlockType"

This reverts commit bec6ed899b68e26e836bde1c573d6066fb2bcc47.

* Align PHPDoc correctly

* Update feature flag doc to remove Cart and Checkout blocks + PaymentApi
2022-08-15 11:15:15 +05:30
Wojtek Naruniec eb1c1c5201 Refactor Product Categories block to use block.json (https://github.com/woocommerce/woocommerce-blocks/pull/6875)
I refactor block to use block.json schema. The block schema
internally extends the main block.json schema and it fixes an issue
that occurs on WPCOM.
2022-08-12 17:46:00 +02:00
Thomas Roberts d45ef84219 Add dismissible compatibility notice to sidebar when editing Cart and Checkout (https://github.com/woocommerce/woocommerce-blocks/pull/6869)
* Add default page notice

* show notice all inner blocks

* support flow when page isnt saved

* switch from where we get the current post id

* update lock

* fix types

* Remove old compatibility notices from Cart and Checkout

* Move useCompatibilityNotice to sidebar-compatibility-notice directory

* Remove old CartCheckoutCompatibilityNotice

* Create sidebar compatibility notice hoc

* Add isCartOrCheckoutOrInnerBlock function

* Refactor defaultNotice to use new isCartOrCheckoutOrInnerBlock func

* Remove BlockSettings from checkout edit and export from checkout-shared

* Change so component still renders, it is just hidden with display: none

This is required because when it returns null the component gets skipped from being added to the Slot, then when it does return a component, then it gets rendered at the bottom of the Slot. By ensuring it always renders we can have it at the top all the time.

* Set the priorities of the hoc filters so compat notice renders first

* Make isCartOrCheckoutInnerBlock a hook

* Remove old compatibility notice related tests

* Remove BlockSettings from Cart

* Remove withDefaultNotice hoc

* Include DefaultNotice in compatibility notice

* Remove DefaultNotice from Checkout

* Rename withSidebarCompatibilityNotice to withSidebarNotices

This is because it includes the sidebar compatibility notice and the default notices

* Remove useIsCartOrCheckoutOrInnerBlock hook

* Remove compatibility notice code from tests

* Revert DefaultNotice back to the old one

* Remove unused components

* Remove withBlockSettings HOC and fix TS types

This is an abstraction that is no longer required, we can just include BlockSettings in the Cart and Checkout blocks

* Remove CartCheckoutFeedbackPrompt from BlockSettings

It will be included in sidebar-notices instead

* Fix TS Types in DefaultNotice

* Add BlockSettings to cart and checkout edit

* Editor: Add feedback box to the Cart & Checkout Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6881)

* Show "Feedback prompt" for all inner blocks

* Fix the "feedback" notice position for these blocks

The "checkout fields", "checkout billing address" and
"checkout shipping address" have the addressFields option which
gets rerendered and placed at the bottom of the inspector controls.

* Tidy up the address-fields hoc

* Use correct block name to check for billing or shipping address

* Revert "Editor: Add feedback box to the Cart & Checkout Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6881)"

This reverts commit 5f3d6cf15ce08d9c303e62ec3e0d0315ead1281f.

* Add hack to get feedback prompt to render last

* Fix TS errors for context and attributes

* Include CartCheckoutFeedbackPrompt in accountcontrols & addresscontrols

* Do not include feedback prompt if on an address block or contact info

* Remove unused hoc for address fields

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-08-12 15:23:08 +01:00
Wojtek Naruniec 4a377ef729 Fix broken contributing links (https://github.com/woocommerce/woocommerce-blocks/pull/6876)
* Fix contributing docs links as some of them point to incorrect locations

* Fix typo
2022-08-12 06:38:17 -07:00
Alba Rincón 5bcabd0361 Register patterns under `patterns` folder and add filters pattern (https://github.com/woocommerce/woocommerce-blocks/pull/6861)
* POC about registering patterns

* POC load patterns from `/patterns` folder

* Change class name and remove unnecessary comment

* Add all four blocks to the filters pattern

* Add all 4 blocks to the block type to allow for transformations

* Add internal

* Improve filters name

* Extract regex to constants

* Add class description

* Rename and move class

* Fix wrong imports

* Address feedback

* Early return from condition

* Fix wrong block type
2022-08-12 13:09:37 +02:00
Raluca Stan f1846025db Add a new structure and clearer steps for the WC Core PR section of the release steps (https://github.com/woocommerce/woocommerce-blocks/pull/6878)
* Add a new structure and clearer steps for the WC Core PR release steps

* Apply suggestions from code review

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

* Update .github/patch-initial-checklist.md

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-08-11 13:25:49 +02:00
Daniel W. Robert 5c40b83480 Add Style Attributes Hooks to blocks/hooks Directory. (https://github.com/woocommerce/woocommerce-blocks/pull/6870)
* Copy style-attributes file to desired directory.

Add a copy of the style-attributes file in blocks/hooks to the desired
base/hooks directory with the other hooks.

* Remove relative imports in favor of global aliases

Utilizes the custom global project aliases in place of using relative
imports.

Note: seeing some linting issues with the aliases. This seems to be the
case elsewhere so it is likely not a blocker for this effort, however,
it may be worth looking into as a follow-up.

* Adjust all imports to use @woocommerce/base-hooks.

Replace all instances of relative file paths to hooks/style-attributes
to use the custom global alias.

* Remove the hooks dir in `assets/js/blocks/`.

Now that everything is using the `@woocommerce/base-hooks` custom global
alias and we have the `style-attributes` hooks file in the base/hooks
directory, we no longer need the `style-attributes` hooks file in the
aforementioned `assets/js/blocks` directory.

* Split style-attributes.ts out into separate files.

Moved the four hooks in style-attributes.ts out into their own, separate
hook file to be consistent with the rest of our custom hooks.

Additionally, moved the helper function (parseStyle) out into a separate
export in base/utils.
2022-08-10 20:04:12 -04:00
Tarun Vijwani d258a0696c Update billing address when shipping address gets change in Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6823) 2022-08-10 17:03:28 +05:30
Tung Du 9253ba0eec Fix: Override the description to prevent infinite loop (https://github.com/woocommerce/woocommerce-blocks/pull/6849) 2022-08-09 16:28:35 +07:00
Tung Du dc66942cbb Fix: Attribute filter flaky test (https://github.com/woocommerce/woocommerce-blocks/pull/6862) 2022-08-09 08:30:11 +07:00
Daniel W. Robert 02ce62109e Add font-weight option to Mini Cart block text (https://github.com/woocommerce/woocommerce-blocks/pull/6760)
* Add font-weight option to Mini Cart button text.

Need to repeat steps for icon SVG and cart item count.

* Add font-weight controls to mini-cart item count.

* Add better error handling to PHP style output.

Ensure style value is set for style item in the
get_font_weight_class_and_style attributes array before rendering it to
the output.

* Revert font-weight option for quantity badge.

Per conversation with @vivialice, it looks better for now to keep the
font weight adjustment capabilities to just the price and leave the cart
icon and count as-is.

* Move $typography_styles variable into markup fn.

To resolve merge conflicts and get everything in it's proper place, this
commit will move the $typography_styles variable into the
get_cart_price_markup() function from woocommerce/woocommerce-blocks#6796.
2022-08-05 14:15:10 -04:00
Tung Du fcedd5174f Fix: flaky tests related to setMaxPrice (https://github.com/woocommerce/woocommerce-blocks/pull/6856) 2022-08-05 16:37:44 +07:00
Tung Du c252e7a907 Fix: Compare action should update its original comment instead of a new comment (https://github.com/woocommerce/woocommerce-blocks/pull/6736) 2022-08-05 16:25:42 +07:00
Luigi Teschio 19e0883861 Add missing label to dependabot configuration (https://github.com/woocommerce/woocommerce-blocks/pull/6848) 2022-08-05 09:58:55 +02:00
Luigi Teschio 88027a5e00 fix markdownlint violation (https://github.com/woocommerce/woocommerce-blocks/pull/6853) 2022-08-04 16:05:14 +02:00
Paulo Arromba 39d4bb4ed9 Merge branch 'release/8.2.0' into trunk
# Conflicts:
#	docs/internal-developers/testing/releases/README.md
#	package.json
#	readme.txt
#	src/Package.php
#	woocommerce-gutenberg-products-block.php
2022-08-04 12:45:20 +01:00
github-actions[bot] f48ae038fa Release: 8.2.1 (https://github.com/woocommerce/woocommerce-blocks/pull/6826)
* Empty commit for release pull request

* Update 8.2.1 changelog

* Ensure onChange is set for radio buttons in SavedPaymentMethodOptions (https://github.com/woocommerce/woocommerce-blocks/pull/6825)

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

* Add 8.2.1 testing steps

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-08-04 12:32:12 +01:00
dependabot[bot] 372a56c1bd Bump mini-css-extract-plugin from 1.3.6 to 1.6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/6714)
Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 1.3.6 to 1.6.2.
- [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.6...v1.6.2)

---
updated-dependencies:
- dependency-name: mini-css-extract-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>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-08-04 12:05:44 +02:00
Luigi Teschio e942ce8367 Update renovate configuration (https://github.com/woocommerce/woocommerce-blocks/pull/6836)
* delete renovate bot

* update renovate configuration

* try now
2022-08-04 11:06:13 +02:00
Tung Du b5cc976905 E2E: Try improving product list loading state detection and fix Site Editor URL (https://github.com/woocommerce/woocommerce-blocks/pull/6811)
* e2e:try: detect loading state for product list

* fix: always use site-editor.php

* wait for price filter to be applied before checking the result
2022-08-03 16:22:37 -04:00
dependabot[bot] 7eb665e726 Bump @wordpress/api-fetch from 6.9.0 to 6.11.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6833)
Bumps [@wordpress/api-fetch](https://github.com/WordPress/gutenberg/tree/HEAD/packages/api-fetch) from 6.9.0 to 6.11.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/api-fetch/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/api-fetch@6.11.0/packages/api-fetch)

---
updated-dependencies:
- dependency-name: "@wordpress/api-fetch"
  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>
2022-08-03 18:16:04 +02:00
Luigi Teschio 36ecb2f6f9 delete renovate bot (https://github.com/woocommerce/woocommerce-blocks/pull/6824) 2022-08-03 14:00:15 +02:00
Thomas Roberts aad09c975d Ensure onChange is set for radio buttons in SavedPaymentMethodOptions (https://github.com/woocommerce/woocommerce-blocks/pull/6825)
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-08-03 11:51:56 +01:00
dependabot[bot] 33b45f163f Bump @typescript-eslint/parser from 5.30.5 to 5.31.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6809)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.30.5 to 5.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.31.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  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: Luigi Teschio <gigitux@gmail.com>
2022-08-03 12:03:16 +02:00
dependabot[bot] 3521a0f68b Bump @wordpress/wordcount from 3.12.0 to 3.13.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6711)
Bumps [@wordpress/wordcount](https://github.com/WordPress/gutenberg/tree/HEAD/packages/wordcount) from 3.12.0 to 3.13.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/wordcount/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/wordcount@3.13.0/packages/wordcount)

---
updated-dependencies:
- dependency-name: "@wordpress/wordcount"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-03 12:02:10 +02:00
dependabot[bot] 1466367e66 Bump johnbillion/wp-hooks-generator from 0.7.0 to 0.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6705)
Bumps [johnbillion/wp-hooks-generator](https://github.com/johnbillion/wp-hooks-generator) from 0.7.0 to 0.9.0.
- [Release notes](https://github.com/johnbillion/wp-hooks-generator/releases)
- [Commits](https://github.com/johnbillion/wp-hooks-generator/compare/0.7.0...0.9.0)

---
updated-dependencies:
- dependency-name: johnbillion/wp-hooks-generator
  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: Luigi Teschio <gigitux@gmail.com>
2022-08-03 12:00:04 +02:00
dependabot[bot] e656f6b48f Bump github/codeql-action from 1 to 2 (https://github.com/woocommerce/woocommerce-blocks/pull/6700)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  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>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-08-03 11:15:53 +02:00
dependabot[bot] dcccd33aa3 Bump yoast/phpunit-polyfills from 1.0.2 to 1.0.3 (https://github.com/woocommerce/woocommerce-blocks/pull/6704)
Bumps [yoast/phpunit-polyfills](https://github.com/Yoast/PHPUnit-Polyfills) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/Yoast/PHPUnit-Polyfills/releases)
- [Changelog](https://github.com/Yoast/PHPUnit-Polyfills/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/Yoast/PHPUnit-Polyfills/compare/1.0.2...1.0.3)

---
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>
2022-08-03 11:12:38 +02:00
dependabot[bot] 3ee24f9a93 Bump @wordpress/i18n from 4.12.0 to 4.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6817)
Bumps [@wordpress/i18n](https://github.com/WordPress/gutenberg/tree/HEAD/packages/i18n) from 4.12.0 to 4.14.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/i18n/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/i18n@4.14.0/packages/i18n)

---
updated-dependencies:
- dependency-name: "@wordpress/i18n"
  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: Luigi Teschio <gigitux@gmail.com>
2022-08-03 11:11:22 +02:00
dependabot[bot] 54ff4315f9 Bump AbleLincoln/push-to-sftp from 1.0 to 1.2 (https://github.com/woocommerce/woocommerce-blocks/pull/6808)
Bumps [AbleLincoln/push-to-sftp](https://github.com/AbleLincoln/push-to-sftp) from 1.0 to 1.2.
- [Release notes](https://github.com/AbleLincoln/push-to-sftp/releases)
- [Commits](https://github.com/AbleLincoln/push-to-sftp/compare/v1.0...v1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-08-03 10:49:52 +02:00
dependabot[bot] 1d849997e5 Bump @wordpress/is-shallow-equal from 4.12.0 to 4.13.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6710)
Bumps [@wordpress/is-shallow-equal](https://github.com/WordPress/gutenberg/tree/HEAD/packages/is-shallow-equal) from 4.12.0 to 4.13.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/is-shallow-equal/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/is-shallow-equal@4.13.0/packages/is-shallow-equal)

---
updated-dependencies:
- dependency-name: "@wordpress/is-shallow-equal"
  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: Luigi Teschio <gigitux@gmail.com>
2022-08-02 17:46:17 +02:00
Albert Juhé Lluveras d93bb44537 Update version to 8.3.0-dev 2022-08-02 17:24:34 +02:00
github-actions[bot] c8728fb2b5 Release: 8.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6806)
* Empty commit for release pull request

* Update 8.2.0 changelog

* Add 8.2.0 testing steps

* Fix typo in 8.2.0 testing steps

* Ensure package names display correctly if only one item is in package (https://github.com/woocommerce/woocommerce-blocks/pull/6815)

* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate

* Update 8.2.0 testing zip

* Bumping version strings to new version.

* Remove empty element from changelog

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-08-02 17:22:37 +02:00
Albert Juhé Lluveras 26472acc14 Remove empty element from changelog 2022-08-02 17:08:48 +02:00
Albert Juhé Lluveras 3b24911c0e Bumping version strings to new version. 2022-08-02 16:59:58 +02:00
Daniel W. Robert fef4d5e597 Add option to hide/show price in Mini Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6796)
* Add toggle control to sidebar in editor.

Adds a visibility toggle in the Mini Cart block's sidebar editor
settings for the block price.

* Update name of hasVisiblePrice attrubite.

Adjusts the name of the hasVisiblePrice attribute to hasHiddenPrice.
This seems a bit easier to reason about, where we can set the default
state of the visibility toggle to 'off'.

* Add conditional price rendering to server side.

Since this is a dynamic block, need to add the condidional attribute
state to the server-side render callback.

* Add price visibility setting to block frontend.

We need to prevent pricec from rendering when hidden setting is active
after the JS kicks in on the frontend (i.e., when the Mini Cart is
interacted with by the user).

* Fix logic error in frontend rendering conditional.

* Add unit tests for both show/hide price states.
2022-08-02 10:28:52 -04:00
Albert Juhé Lluveras 3a4c123026 Update 8.2.0 testing zip 2022-08-02 15:53:46 +02:00
Thomas Roberts 5fe61143d8 Ensure package names display correctly if only one item is in package (https://github.com/woocommerce/woocommerce-blocks/pull/6815)
* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate
2022-08-02 15:49:17 +02:00
Thomas Roberts 0fc1ee46bd Ensure package names display correctly if only one item is in package (https://github.com/woocommerce/woocommerce-blocks/pull/6815)
* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate
2022-08-02 04:51:21 -07:00
Albert Juhé Lluveras fbb0e1e6ee Fix typo in 8.2.0 testing steps 2022-08-02 11:15:54 +02:00
Albert Juhé Lluveras a0938e5ee4 Add 8.2.0 testing steps 2022-08-01 19:45:52 +02:00
Albert Juhé Lluveras 5bac0fefcf Update 8.2.0 changelog 2022-08-01 18:37:20 +02:00
Tung Du 862477f9aa Remove compatibility notice from Mini Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6803) 2022-08-01 18:01:57 +02:00
Seghir Nadir 8e2a2636c2 fix proceed to checkout button (https://github.com/woocommerce/woocommerce-blocks/pull/6804) 2022-08-01 16:29:28 +01:00
Saad Tarhi dc97e5af1e Fix missing translations in inspector (https://github.com/woocommerce/woocommerce-blocks/pull/6737)
* Try registering the "cart taxes" inner block

Registering server side. This example isn't working, but I'm pushing to
share it and see what's wrong with this implementation.

* Fix registering the cart taxes inner block issue

* Update translation script loading

* Remove unnecessary JS translation

The translation should work fine by getting the title & description from
the `block.json` file

* Put back the initial code in the 'Cart Taxes' inner block

We didn't provide the correct `block.json` file path server side,
that's why the `metadata` wasn't correctly registered

* Generate `block.json`files for inner blocks

This is the first step on fixing the missing translations of `metadata`
in `block.json` files

* Set the folder name exactly the same as the inner block name

We are doing this first test for the `Cart taxes` inner block.

The `Block` & its containing folder need to have the same name for:
- Consistency
- We use the `Block` name to get the file Path

* Update imports after folder renaming

* Get block name directly from the JSON metadata

Getting the block name from the JSON metadata is less error prone than
extracting it from the file path.

And no need to rename all our `inner-blocks` to get the correct
`block.json` path

* Revert folder naming change of `Cart taxes` inner block

Since we are getting the `block` name directly from the `block.json`
metadata instead of extracting it from the file path, there is no need
to keep their names in sync anymore

* Fix missing translations for the `Cart Subtotal` Block

* Register only the client-side settings on the client

When the block is registered on the server, you only need to register
the client-side settings on the client using the same block’s name.
See [docs](https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md#javascript-client-side).

* Add schema validation to `block.json`

Development is improved by using a defined schema definition file.
Supported editors can provide help like tooltips, autocomplete, and
schema validation.

* Use the same `editor_script` as the parent block

This prevents WordPress from generating script tags to inexistant
inner blocks JS files

* Add C&C inner blocks in Cart.php & Checkout.php

This is a refactoring to keep the block types controller file less
overloaded

* Fix all Cart inner blocks missing translations

* Create the "AbstractInnerBlock" class

The "Inner Blocks" will use their parent's script, so no need to create
new scripts for each one of them

And, our "Inner Blocks" should always be registered using the metadata file

* Update the "Inner Blocks" PHP classes

* Fix PHP lint erros & update function description

* Fix missing translations bug for all Checkout Inner Blocks

* Update src/BlockTypes/Checkout.php

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

* skip lazy loaded scripts

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-08-01 15:57:33 +01:00
Tung Du 0ee5dbbc18 Fix: Replace DropdownSelector with FormTokenField from Gutenberg (https://github.com/woocommerce/woocommerce-blocks/pull/6647) 2022-08-01 19:00:59 +07:00
Seghir Nadir 2ebb166b41 add new action for customer updates (https://github.com/woocommerce/woocommerce-blocks/pull/6792) 2022-08-01 09:56:28 +01:00
Daniel W. Robert 056e6946e8 Add new icon for mini cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6784)
* Add new icon for mini cart block (inserter).

See https://github.com/woocommerce/woocommerce-blocks/issues/6617.

* Adjust size of SVG

The new SVG was rendering a little bit smaller than the original icon.
Potentially because of the mask and the artboard size.

This commit adjusts the size to render at the same size as the original
version of the icon in the inserter.
2022-07-29 15:40:03 -04:00
Seghir Nadir 008c63b0dc Refactor external dispatch actions from being called inside useSelect (https://github.com/woocommerce/woocommerce-blocks/pull/6718)
* refactor coupon functions outside of useSelect

* fix test
2022-07-29 16:20:48 +01:00
renovate[bot] 6f87c75587 Update babel monorepo to v7.18.9 (https://github.com/woocommerce/woocommerce-blocks/pull/6719)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-29 14:46:31 +02:00
renovate[bot] 8a5973d995 Update dependency @types/wordpress__blocks to v11.0.5 (https://github.com/woocommerce/woocommerce-blocks/pull/6758)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-29 14:02:02 +02:00
Niels Lange 59eead8ae8 Update pull_request_template.md 2022-07-29 13:55:23 +02:00
Thomas Roberts 82dd8c22db Add comment to prevent linting error on commented out code (https://github.com/woocommerce/woocommerce-blocks/pull/6789) 2022-07-29 04:54:52 -07:00
Niels Lange 42fd38858c Update pull_request_template.md 2022-07-29 13:47:57 +02:00
Thomas Roberts 89022e18f8 Ensure addresses sync when loading the checkout shipping address block (https://github.com/woocommerce/woocommerce-blocks/pull/6773) 2022-07-28 07:38:29 -07:00
renovate[bot] a03487d9ad Update dependency @types/jest to v27.5.2 (https://github.com/woocommerce/woocommerce-blocks/pull/6759)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-28 15:51:44 +02:00
dependabot[bot] 52282e51cd Bump mockery/mockery from 1.4.4 to 1.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6703)
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.4.4 to 1.5.0.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.4.4...1.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2022-07-28 15:34:17 +02:00
Alba Rincón ef13f65dc0 Use the archive-product template to render product attributes pages (https://github.com/woocommerce/woocommerce-blocks/pull/6776) 2022-07-28 12:49:13 +02:00
Bernie Reiter 3858b03aec All Products block: Migrate to block.json (https://github.com/woocommerce/woocommerce-blocks/pull/6754)
* All Products: Use block.json to register

* Simplify edit def

* Separate file for save

* No more client-side registration

* Remove uncommented, now-obsolete code

* Add back client-side block registration

* Remove stray textdomain from keywords field

* Add textdomain field

* Set apiVersion to 1
2022-07-28 12:26:36 +02:00
Thomas Roberts 488ff13ca9 Update the `previewCart` property we use to get `hasCalculatedShipping` in `useShippingData` and fix broken JS tests (https://github.com/woocommerce/woocommerce-blocks/pull/6781)
* Require the rest of the @woocommerce/block-settings module in block.test.js

* Use correct property from previewCart for hasCalculatedShipping
2022-07-28 02:22:42 -07:00
Niels Lange 423fd29c0d Add link to ZIP file only ones (https://github.com/woocommerce/woocommerce-blocks/pull/6769)
* Add link to ZIP file only ones

* Add text file for testing purposes

* Remove text file for testing purposes
2022-07-27 13:24:06 +02:00
Thomas Roberts 3fbd497d28 Add gap between pakage panels (https://github.com/woocommerce/woocommerce-blocks/pull/6740) 2022-07-26 23:00:38 -07:00
Thomas Roberts 6bf8f07c39 Ensure shipping rate names show when multiple packages are used (https://github.com/woocommerce/woocommerce-blocks/pull/6753)
* Get shipping rates from preview cart in editor

* Set showItems in ShippingRatesControl to true if multiple packages

* Move dependency in useShippingData to correct section

* Ensure getting packageData.shipping_rates.length won't error
2022-07-26 23:00:17 -07:00
Seghir Nadir cf91d616e4 switch up token (https://github.com/woocommerce/woocommerce-blocks/pull/6755) 2022-07-26 17:26:26 +02:00
dependabot[bot] 088907dec2 Bump automattic/jetpack-autoloader from 2.10.7 to 2.11.6 (https://github.com/woocommerce/woocommerce-blocks/pull/6702)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.10.7 to 2.11.6.
- [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.10.7...v2.11.6)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-26 15:14:18 +02:00
dependabot[bot] caedfa278a Bump wp-phpunit/wp-phpunit from 5.8.1 to 6.0.1 (https://github.com/woocommerce/woocommerce-blocks/pull/6701)
Bumps [wp-phpunit/wp-phpunit](https://github.com/wp-phpunit/wp-phpunit) from 5.8.1 to 6.0.1.
- [Release notes](https://github.com/wp-phpunit/wp-phpunit/releases)
- [Commits](https://github.com/wp-phpunit/wp-phpunit/compare/5.8.1...6.0.1)

---
updated-dependencies:
- dependency-name: wp-phpunit/wp-phpunit
  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>
2022-07-26 14:40:13 +02:00
Alba Rincón e56107f436 Select the correct inner button for the "Featured Item" button to update its url (https://github.com/woocommerce/woocommerce-blocks/pull/6741)
* Select the correct id/attributes for the button to update its url

* Fix variables case
2022-07-26 14:30:18 +02:00
dependabot[bot] c7d49bc792 Bump moment from 2.29.3 to 2.29.4 (https://github.com/woocommerce/woocommerce-blocks/pull/6689)
Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.3...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-26 11:48:18 +02:00
renovate[bot] 06dbe95eb6 Update dependency @types/react to v17.0.47 (https://github.com/woocommerce/woocommerce-blocks/pull/6638)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-25 14:52:12 +02:00
renovate[bot] 2e0f0b00d0 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/6632)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-25 12:12:26 +02:00
Tung Du c10e91e7e1 Fix: navigate through Mini Cart contents with keyboard (https://github.com/woocommerce/woocommerce-blocks/pull/6731)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-07-25 12:39:47 +07:00
Niels Lange 91e498c28a Generate ZIP file using GitHub Actions (https://github.com/woocommerce/woocommerce-blocks/pull/6661)
* Generate ZIP file using GitHub Actions

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Upload generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Create release for each PR in sub-repo

* Update generate-zip.yml

* Push release ZIP to woocommerce/woocommerce-blocks-releases

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Generate ZIP file using GitHub Actions

* Generate ZIP file using GitHub Actions

* Generate ZIP file using GitHub Actions

* Generate ZIP file using GitHub Actions

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Update generate-zip.yml

* Generate ZIP file using GitHub Actions

* Update .github/workflows/generate-zip.yml

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

* Rename temp folder to wc-blocks-pr-release__temp

Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
2022-07-22 13:48:54 +02:00
Tung Du 6e2fa9061b Revert "ci: try update existing report first" (https://github.com/woocommerce/woocommerce-blocks/pull/6735)
This reverts commit 60bf1e286c.
2022-07-22 17:18:04 +07:00
Tung Du 60bf1e286c ci: try update existing report first 2022-07-22 17:10:58 +07:00
Lucio Giannotta 615ff35fac `SearchListControl`: Fix preserving case of original item (https://github.com/woocommerce/woocommerce-blocks/pull/6551)
Searches would keep the case of the user input instead of the original
case of the name. Search still is case insensitive, but preserves
the original item's case.

Also, this PR adds a test for this bug and fixes a previous test case.
2022-07-21 21:49:42 +02:00
Saad Tarhi 3e6503a0d3 Fix typo & code error in the translation docs (https://github.com/woocommerce/woocommerce-blocks/pull/6726) 2022-07-21 20:40:33 +01:00
Tung Du 02a3d27de6 Fix: WooCommerce messages don't appear in block themes with Mini Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6728) 2022-07-22 00:05:52 +07:00
Alba Rincón 63ce706139 Start using `block.json` and convert to TS the `Product Best Sellers` block (https://github.com/woocommerce/woocommerce-blocks/pull/6683)
* Start using `block.json` and convert to TS the `Product Best Sellers` block

* Update assets/js/blocks/product-best-sellers/edit.tsx

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* Import props

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-07-20 11:29:49 +02:00
Luigi Teschio c1c2860232 Mini Cart Block: additional class are visible on the frontend page woocommerce/woocommerce-blocks#5581 (https://github.com/woocommerce/woocommerce-blocks/pull/6716)
Mini Cart Block: additional class are visible on the frontend page
2022-07-20 09:57:41 +02:00
Alba Rincón ad4fb01228 Start using `block.json` and convert to TS the `Product by Category` block (https://github.com/woocommerce/woocommerce-blocks/pull/6680)
* Start using `block.json` and convert to TS the `Product by Category` block

* Address feedback to remove some TS errors

* Remove unnecessary prop
2022-07-19 15:09:46 +02:00
Alba Rincón a4077d865c Bump version from 8.1.0 to 8.2.0-dev 2022-07-19 10:59:47 +02:00
github-actions[bot] 8ae71628a1 Release: 8.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6693)
* Empty commit for release pull request

* Update readme.txt

* Update versions

* Update WC versions

* Add testing notes and release zip file

* Update testing instructions

* Fix typo in testing instructions

* Remove fix from the testing instructions

* Update readme

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2022-07-19 10:51:50 +02:00
Luigi Teschio f999790df8 Update deps (https://github.com/woocommerce/woocommerce-blocks/pull/6670)
* fix E2E tests

* Empty-Commit

* upgrade deps

* upgrade deps

* upgrade deps

* fix E2E tests

* update deps

* try now

* try now

* install @wordpress/compose

* try different version

* update packages

* update package-lock

* restore husky
2022-07-19 09:38:57 +02:00
Luigi Teschio 1761da37cd fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/6639) 2022-07-18 11:38:49 +02:00
Michael P. Pfeiffer 1784b525df Update block template descriptions (https://github.com/woocommerce/woocommerce-blocks/pull/6667) 2022-07-15 15:54:04 +02:00
Alba Rincón 5b50d37028 Prevent showing the blockified templates util they are implemented (https://github.com/woocommerce/woocommerce-blocks/pull/6682) 2022-07-14 14:54:25 +02:00
Paulo Arromba 678fa6bff0 Add: Cross-sells for the Store API Cart response. (https://github.com/woocommerce/woocommerce-blocks/pull/6635)
* Added Cross-sells object and schema for the API Cart response.

* Cross-sells are now WC_Product objects that pass through the visibility filter.

* Removed redundant check.

* Updated function doc comment.

* Cleaned up imports.

* Cross-sells item schema (extension of ProductSchema) was removed, and replaced by ProductSchema itself. Cross-sells are direct product representation, and extending this goes out of scope for the task at hand.

* Unit testing for cart response containing cross-sell products.
2022-07-13 15:02:49 +01:00
Luigi Teschio abf7b80576 Mini Cart: Fix loading deps when WordPress is installed in a subdir (https://github.com/woocommerce/woocommerce-blocks/pull/6673)
* Fix loading deps when WordPress is installed in a subdir woocommerce/woocommerce-blocks#6500

Fix loading deps when WordPress is installed in a subdir

* update logic
2022-07-13 12:42:28 +02:00
Niels Lange 45c27adac5 Update release-initial-checklist.md 2022-07-12 18:16:55 +02:00
Raluca Stan cb9ec18f7f Update README.md 2022-07-11 16:21:46 +03:00
Tung Du 42453b7582 Fix: Add support to apply filters via URL for All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/6642)
* price-filter: update URL when filtering products of All Products block.

* active-filters: update the URL when removing price filter

* price-filter: prevent update query on PHP templates when changing prices

* active-filters: on PHP templates, remove filter only triggers the page reload

* price-filter: update comments and naming to reflect new URL behavior

* stock-filter: update url when filtering for All Products block

* attribute-filter: update the URL when filtering for All Products block

* attribute-filter: fix: uncheck all filter doesn't clear the URL

* attribute-filter: fix: endless page reload when filtering for PHP template

* attribute-filter: correctly set the defaults and update the filter query from URL

* fix: filter URL containing stock status doesn't work on homepage

* price-filter: fix issue with URL on All Products

The price slider doesn't reset after removing price filter from the Active Filters block if the initial price filter is set from URL

* ref: passing document.title to pushState is unnecessary

* use replaceState to avoid changing browser history

* extract change URL logic
2022-07-11 14:04:19 +07:00
Tung Du 4e8c48144c Fix: Attribute Filters: allow choosing between single/multiple selection (https://github.com/woocommerce/woocommerce-blocks/pull/6620) 2022-07-07 06:14:22 +07:00
Paulo Arromba ffbc39bfd3 fix: fixed colors for error input and labels on dark palette mode themes and dark controls. (https://github.com/woocommerce/woocommerce-blocks/pull/6292) 2022-07-06 15:03:15 +01:00
Luigi Teschio 4aaaebe0c0 Disable render blockified Product Grid Block (https://github.com/woocommerce/woocommerce-blocks/pull/6660)
* Disable render blockified Product Grid Block

* try now
2022-07-06 14:16:32 +02:00
Alba Rincón 75184ae22d Add migration strategy and load blockified templates (https://github.com/woocommerce/woocommerce-blocks/pull/6538)
* Increase `schema_version` to add the new `wc_blocks_use_blockified_templates` flag

If the schema version stored on the db is <= 260 means the plugin is being updated
to the new version and we should keep using the old templates, not the blockified ones.

* After the theme is switched we check if we need to update the flag to
start loading the blockified templates or not.

* Get the templates from the blockified folder if the flag is set to true on the db

* Add temporary blockified template for testing purposes

* Inline variable

* Improve comment

* Use blockified templates on new installs with block themes only

* Don't use blockified templates when switching to a non FSE theme

* Fix condition

* Add tests for the option value

* Move the check to use blockified templates

* WIP

* WIP

* Add migration strategy

* Move the blockified templates to the templates folder and filter them depending on the option

* Fix tests and start using the Options constants

* Fix migration, the `should_use_blockified_product_grid_templates` and tests

* Rename tests and move to Utils folder

* add Migration class test

* try

* remove PHP

* add composer

* Replace the blockified templates with a temporary version

* Fix tests

* add comment

* Add feature gating for experimental builds

* Inject the package to the controller

* test

* Change blocks.ini

* debug

* Remove debug info

* fix test

* fix tests

* try now

* using composer cache

* install deps

* test

* Remove unnecessary extra key

* Add cache actions

* Undo tests change

* Fix readme format

Co-authored-by: Luigi <gigitux@gmail.com>
2022-07-06 09:51:39 +02:00
Niels Lange 073392c96a Bump version from 8.0.0 to 8.1.0-dev 2022-07-05 18:48:38 +02:00
github-actions[bot] 4e6da0b80d Release: 8.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6652)
* Empty commit for release pull request

* Empty commit for release pull request

* Update readme.txt

* Update phpcs.xml

* Add testing notes and ZIP for release 8.0.0

* Update testing notes

* Update testing notes

* Revert woocommerce/woocommerce-blocks#6591

* Update testing notes

* Update readme.txt

* Update ZIP for release 8.0.0

* Change version from 8.0.0-dev to 8.0.0

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-07-05 18:41:05 +02:00
Alba Rincón f36115b175 Prevent `Featured Product` block from breaking when product is out of stock + hidden from catalog (https://github.com/woocommerce/woocommerce-blocks/pull/6640) 2022-07-05 09:24:28 +02:00
Niels Lange 1ab1e17205 Update README.md 2022-07-04 12:39:17 +02:00
Tarun Vijwani e6dfd66d5d Update billing address when shipping address gets change in Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6591)
* update billing address when shipping address gets change in Cart block

* Add a new line to test linting error

* Remove a new line to test linting error

* Fix linting error

* Fix linting error

* Fix linting error by adding a space and removing a comma

* Fix linting error by replacing a space with tab

Co-authored-by: Niels Lange <info@nielslange.de>
2022-07-04 12:22:32 +02:00
Tarun Vijwani a1526ed660 Make form components require onChange and have a default value (https://github.com/woocommerce/woocommerce-blocks/pull/6636) 2022-07-01 21:50:44 +04:00
Alba Rincón b5b454ad42 Fix condition to allow rendering classic templates (https://github.com/woocommerce/woocommerce-blocks/pull/6643) 2022-06-29 17:35:40 +02:00
Luigi Teschio e7eb8a6dd5 Show classic template in the inserter only for specific templates (https://github.com/woocommerce/woocommerce-blocks/pull/6539)
* Show classic template in the inserter only for specific templates

* add feature gate

* add todo comment

* rename variable

* address feedback

* not register block on post and page editor

* avoid casting
2022-06-29 09:42:02 +02:00
Seghir Nadir 6e9c348cc4 add custom local pick handling (https://github.com/woocommerce/woocommerce-blocks/pull/6631)
This PR fixes an issue in which taxes are calculated against the user address for local pickups orders. A niche issue, but an important one.
2022-06-27 15:52:24 +01:00
Tarun Vijwani 474d432836 Add key to BlockErrorBoundary component in renderForcedBlocks (https://github.com/woocommerce/woocommerce-blocks/pull/6582) 2022-06-24 16:55:49 +04:00
Luigi Teschio dc2765efcb Add dry run and simulate release mode (https://github.com/woocommerce/woocommerce-blocks/pull/5273)
* Add dry run and simulate release mode woocommerce/woocommerce-blocks#3059

Add dry run and simulate release mode

* execute more svn commands in release mode

* fix boolean

* fix command
2022-06-23 17:39:30 +02:00
Luigi Teschio 16c11c2c50 Fix Markdown errors (https://github.com/woocommerce/woocommerce-blocks/pull/6616)
* Fix Markdown lint errors

* fix markdown
2022-06-22 17:02:15 +02:00
Brian 2328ca3f4f Add Footer Template Part (https://github.com/woocommerce/woocommerce-blocks/pull/6596)
* Adjust template with tagname footer

* Adjust template with tagname footer

* Adjust template with tagname footer

* Adjust template with tagname footer

* Adjust template with tagname footer

* Update e2e tests snapshots

Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-06-22 16:31:20 +02:00
Ovidiu Liuta 9796af2fb4 changing tax_query field to term_id (https://github.com/woocommerce/woocommerce-blocks/pull/6585)
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2022-06-22 12:51:14 +02:00
renovate[bot] a2a7235ea2 Update dependency @types/react-dom to v17.0.17 (https://github.com/woocommerce/woocommerce-blocks/pull/6573)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-06-22 10:10:00 +00:00
Nadir Seghir e50b654d69 update version 2022-06-22 10:42:03 +01:00
github-actions[bot] da202ab1e0 Release: 7.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6604)
* Empty commit for release pull request

* update readme

* add testing notes

* update link

* Bumping version strings to new version.

* move testing docs

* remove old folder

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2022-06-22 10:40:03 +01:00
Albert Juhé Lluveras f1e20172b3 Add Cart & Checkout testing steps to Feature plugin only section in 7.7.0 testing instructions (https://github.com/woocommerce/woocommerce-blocks/pull/6615) 2022-06-22 11:36:27 +02:00
Luigi Teschio 97dbbc5520 Move testing release instructions in the right folder after refactor (https://github.com/woocommerce/woocommerce-blocks/pull/6614) 2022-06-22 11:09:48 +02:00
Luigi Teschio 15ee965e48 Fix crash when the user saves Mini Cart Template (https://github.com/woocommerce/woocommerce-blocks/pull/6613) 2022-06-21 18:30:26 +02:00
Tung Du aadb94c012 Fix: Display the correct title for templates from theme (https://github.com/woocommerce/woocommerce-blocks/pull/6452) 2022-06-21 22:26:09 +07:00
Tung Du 138df96762 Fix: Convert Active Filters Block codebase to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/6580) 2022-06-21 21:53:49 +07:00
Raluca Stan 1fd41e39f4 Fix list indentation for the Blocks Handbook 2022-06-21 14:43:23 +01:00
Raluca Stan f0952fa4c4 Update the WooCommerce Blocks Handbook (https://github.com/woocommerce/woocommerce-blocks/pull/6601)
* Update the WooCommerce Blocks Handbook

Add 3 subsections to the Developer resources section and add the new tools we have availble

* Grammar fixes
2022-06-21 14:41:30 +01:00
Seghir Nadir 298a76495b Fix broken storybook link 2022-06-21 14:39:24 +01:00
Luigi Teschio 5e2eeb4c45 Add markdownlint extension in the recommended extensions list (https://github.com/woocommerce/woocommerce-blocks/pull/6605) 2022-06-21 11:13:44 +02:00
Niels Lange e38d429f70 Clean up docs (https://github.com/woocommerce/woocommerce-blocks/pull/6550)
* Link translation section to docs file

* Delete duplicated docs

* Move internal developer docs into corresponding folder

* Correct merge conflict

* Change ‘docs/testing/’ to ‘docs/internal-developers/testing’

* Fix visible \ and missing bulletpoint

* Add missing testing notes
2022-06-20 19:04:41 +02:00
Luigi Teschio 72599384f5 Fix MD lint errors and fix conflicts (https://github.com/woocommerce/woocommerce-blocks/pull/6598)
* Empty commit for release pull request

* Add changelog for the 7.8.0 release

* Add testing notes for 7.8.0 release

* move legacy payment processing to its own class (https://github.com/woocommerce/woocommerce-blocks/pull/6519)

* update changelog and testing instructions after the cherry-pick

* add link

* Featured Item: Fix colors from default palette not being applied (https://github.com/woocommerce/woocommerce-blocks/pull/6525)

Gutenberg uses two different attributes for text colors:

* `style.color.text`, and
* `textColor`

However, the second one is used only when a color from the default
palette is selected AND the post is saved and reloaded.

With this fix we use the human readable string from the default palette
as a CSS variable.

Please note that while Gutenberg correctly assigns the appropriate CSS
class to render the right color, the problem is that if the color is
handled by a class, it can be overridden for example by themes.

See woocommerce/woocommerce-blocks#6492

* upload new zip

* update changelog

* Revert "Remove Combobox patch (https://github.com/woocommerce/woocommerce-blocks/pull/6465)" (https://github.com/woocommerce/woocommerce-blocks/pull/6531)

This reverts commit 4976afad58.

* upload new zip

* Bumping version strings to new version.

* Fix MD lint errors and fix conflicts

* Empty commit for release pull request

* Release: 7.8.3 (https://github.com/woocommerce/woocommerce-blocks/pull/6602)

* Fix PHP notice in Mini Cart when prices included taxes (https://github.com/woocommerce/woocommerce-blocks/pull/6537)

* Empty commit for release pull request

* Add changelog to readme.txt

* Update versions

* Add Testing steps for version 7.8.1

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme() (https://github.com/woocommerce/woocommerce-blocks/pull/6590)

* update changelog and testing instructions

* Empty commit for release pull request

* upload zip

* Bumping version strings to new version.

* Fix images hidden by default in Product grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6599)

* update changelog and testing instructons

* Bumping version strings to new version.

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>

* fix MD lint errors

* fix sort deps

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-20 16:27:11 +02:00
Daniel Dudzic 8f00447f2d Add descriptions for all WC templates and refactor Search template hierarchy loading logic (https://github.com/woocommerce/woocommerce-blocks/pull/6345)
* Refactor template title and description loading and search template hierarchy updating

* Remove an unnecessary return

* Fix template descriptions for custom templates

* Fix template description typos

* Move the template description loading logic to mirror the title's

* Remove the descriptions filter and move the search hierarchy code back to a separate file

* Restore the original order of the container registrations

* Restore the product search template slug

* Restore the Product Search Results slug as a constant

Co-authored-by: Luigi <gigitux@gmail.com>
2022-06-20 14:49:18 +01:00
Luigi 4d9780269f Merge branch 'release/7.6.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2022-06-20 15:00:25 +02:00
github-actions[bot] a35b67cd0f Release: 7.6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/6600)
* Fix PHP notice in Mini Cart when prices included taxes (https://github.com/woocommerce/woocommerce-blocks/pull/6537)

* Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme() (https://github.com/woocommerce/woocommerce-blocks/pull/6590)

* Empty commit for release pull request

* Add 7.6.1 changelog to readme.txt

* Add Testing steps for version 7.6.1

* Bump versions to 7.6.1-dev

* Update testing ZIP

* Remove wrong testing step

* Bumping version strings to new version.

* Fix images hidden by default in Product grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6599)

* update changelog and testing instructons

* Empty commit for release pull request

* upload zip

* update readme

* Bumping version strings to new version.

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
2022-06-20 14:57:08 +02:00
Albert Juhé Lluveras fc956b7f48 Fix images hidden by default in Product grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6599) 2022-06-20 14:13:56 +02:00
Paulo Arromba 2477e5ed19 Fix/4929 remove unnecessary files from core build process (https://github.com/woocommerce/woocommerce-blocks/pull/6425)
* Added /assets, /packages, /patches and global.d.ts to .distignore

* re-added /assets folder

* Reverted "/packages" removal
2022-06-20 09:07:39 +01:00
Albert Juhé Lluveras 9ce6cd6117 Add link to WC Blocks 7.6.1 testing steps 2022-06-17 16:43:18 +02:00
Albert Juhé Lluveras 1b39de4af0 Add back missing release testing steps after update 2022-06-17 16:42:29 +02:00
Albert Juhé Lluveras 7520c26065 Add WooCommerce 7.6.1 changelog and testing notes 2022-06-17 16:39:08 +02:00
Albert Juhé Lluveras b543fa2684 Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme() (https://github.com/woocommerce/woocommerce-blocks/pull/6590) 2022-06-17 14:51:04 +02:00
Tung Du 27224fd46e Fix: Convert Filter Products by Attribute Block to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/6545)
* wip: convert attribute filter to ts

* change query to optional

* update SearchListControlProps and SearchListItemType

* get default attribute from metadata

* update types

* convert attributes utils to ts

* convert attribute query utils to ts

* fix type error, remove type casting

* revert type change for SearchListItemType

* apply new format
2022-06-15 19:50:42 +07:00
Michael P. Pfeiffer 521f93619b Upgrade wp-prettier to 2.6.2 and reformat the codebase (https://github.com/woocommerce/woocommerce-blocks/pull/6566)
* Remove mixed tabs and spaces in tsconfig.json

* Update formatting in json files

* Upgrade wp-prettier to 2.6.2
2022-06-15 11:56:52 +02:00
Tomasz Tunik 0dfc1ad58b provide span wrapper for category list item name (https://github.com/woocommerce/woocommerce-blocks/pull/6574)
will enable adding text overflow of other effects that user might not want to interfere with the image element
2022-06-15 11:37:21 +02:00
Tung Du 1ba3ca2ba1 Fix: Mini Cart content scrolling issue (https://github.com/woocommerce/woocommerce-blocks/pull/6565) 2022-06-15 15:18:50 +07:00
Albert Juhé Lluveras 027ee07b57 Fix linting errors in WC Blocks 7.8.1 testing instructions (https://github.com/woocommerce/woocommerce-blocks/pull/6564) 2022-06-14 10:56:07 +02:00
Tung Du 6531c4cb0b Fix: Convert Filter Products by Price Block to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/6514) 2022-06-14 15:48:49 +07:00
Albert Juhé Lluveras 680ebba7cb Fix an endless loop when using product grid blocks inside product descriptions (https://github.com/woocommerce/woocommerce-blocks/pull/6471)
* Fix an endless loop when using product grid blocks inside product descriptions

* Add array_key_exists protection

* Typo in comment

* 👌IMPROVE: Improve comments - woocommerce/woocommerce-blocks#6416

Co-authored-by: Panos (Panagiotis) Synetos <panos.synetos@automattic.com>
2022-06-14 11:24:48 +03:00
Niels Lange 10d6e97833 Use default .editorconfig settings for *.md files (https://github.com/woocommerce/woocommerce-blocks/pull/6553) 2022-06-13 23:10:21 +02:00
Albert Juhé Lluveras bfd62a3f78 Add Testing steps for version 7.8.1 2022-06-13 15:50:02 +02:00
Albert Juhé Lluveras 3cae916042 Add changelog to readme.txt 2022-06-13 15:49:55 +02:00
Niels Lange 15a22db4f4 Update README.md 2022-06-13 14:37:05 +02:00
Michael P. Pfeiffer d7820b98bb Featured items: fix focal point block json spacing (https://github.com/woocommerce/woocommerce-blocks/pull/6552) 2022-06-13 14:06:48 +02:00
Luigi Teschio 04ebfd2264 Fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/6415)
* Fix E2E tests woocommerce/woocommerce-blocks#6415

Fix E2E tests

* Add full state in customer data and exclude it from details check

* update webpack configuration

* Revert change to combobox index

* don't splitChunk frontend scripts

* simplfy output folders

* reduce minimum chunk size to 10kb

* add all inner blocks for loading

* better splitChunks

* update translation code

* wait for scripts

* try sleeping

* fix loading translation

* fix tests for mini cart

* simplfy po logic

* automate loading chunks

* rename webpack group file

* rename block.json path

* remove test

* revert changes to webpack file

* fix loading of chunks

* revert changes to assets api as well

* restore wp-env json configuration

* restore .wp-env.json

* address feedback

* add comment

* address comments

* improve utils function

* install puppeteer

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2022-06-13 11:15:29 +02:00
Tung Du 876e955125 Fix: Convert Filter Products by Stock to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/6533) 2022-06-13 08:39:09 +07:00
Niels Lange d7d043cb5b Rename billingData to billingAddress (https://github.com/woocommerce/woocommerce-blocks/pull/6369)
* Rename billingData to billingAddress

* Add unit test to ensure billingData remains accessible

* add integration tests for slots

* Keep billingData in usePaymentMethodRegistration for backwards compatibility

* Gate `billingData` in deprecation gate

* Replace deprecation call

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2022-06-10 18:59:25 +02:00
Niels Lange d348db4779 Add docs about translation handling (https://github.com/woocommerce/woocommerce-blocks/pull/6405)
* Create translation handling files

* Add docs about “Translation basics”

* Update docs for “Translation basics”

* Add docs about “Translations in PHP files”

* Add docs about “Translations in JS/TS files”

* Update docs for “Translation basics”

* Add docs for “Translation management”

* Add docs for “Translations in FSE templates”

* Add “Translations” to “WooCommerce Blocks Handbook”

* Add docs for “Lazy-load translations”

* Rewrite first paragraph of “Translations in FSE templates”

* Fix typo

* Update repo URL

* Remove obsolete space and comma

* Update repo URL

* Rename lazy-load file

* Add section about “sprintf()” to “Translations in JS/TS files”

* Remove reference to “npm install @wordpress/i18n”

* Add docs for “Translation files and loading”

* Rename readme.md to README.md

* Remove double file extension

* Remove self-explaining explenations

* Update docs/README.md

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

* Update docs/translations/translation-basics.md

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

* Update docs/translations/translation-basics.md

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

* Update docs/translations/translation-loading.md

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

* Update docs/translations/translation-loading.md

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

* Update docs/translations/translation-loading.md

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

* Update docs/translations/translation-loading.md

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

* Update docs/translations/translation-loading.md

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

* Update docs/translations/translation-loading.md

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

* Update docs/translations/translation-management.md

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

* Update docs/translations/translations-in-FSE-templates.md

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

* Clarify how to use variables in translations

* Change “i18n” to “internationalization (i18n)”

* Link translation functions to the WordPress reference

* Add Translation management to Translation management

* Update “Translations in FSE templates”

* Lint Markdown files

* Update chunk translation register functions

* Update function that loads the translation file

* Update information about lazy-loading

* Adjust lazy-loading docs title and file name

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-06-10 17:40:05 +02:00
Michael P. Pfeiffer a432a85bf0 Cart: ensure express checkout placeholder does not stick to checkout button (https://github.com/woocommerce/woocommerce-blocks/pull/6547)
* Cart: ensure express checkout placeholder does not stick to checkout button

* Display to affect description only
2022-06-10 15:20:41 +02:00
Luigi Teschio 8ac7fd2440 Restore package.json and package-lock.json (https://github.com/woocommerce/woocommerce-blocks/pull/6546) 2022-06-10 14:05:51 +02:00
Niels Lange 3208da551b Improve the structure of the WooCommerce Blocks Handbook (https://github.com/woocommerce/woocommerce-blocks/pull/6429)
* Improve the structure of the WooCommerce Blocks Handbook

Co-authored-by: Rania Lang <rania.langouretou@automattic.com>
2022-06-09 17:52:19 +02:00
Tung Du 45f48e6b0a Fix: Register Filter Blocks using `block.json` (https://github.com/woocommerce/woocommerce-blocks/pull/6505) 2022-06-09 21:45:24 +07:00
Luigi Teschio abd5c6afd1 Fix ESLint: use window.localstorage instead localstorage woocommerce/woocommerce-blocks#6442 (https://github.com/woocommerce/woocommerce-blocks/pull/6540)
Fix ESLint: use window.localstorage instead localstorage
2022-06-09 14:47:17 +02:00
Niels Lange a748f533a8 Format Markdown files using wp-scripts (https://github.com/woocommerce/woocommerce-blocks/pull/6462)
* Format Markdown files using Prettier

* Format Markdown files using wp-scripts

* Adjust MD linting
2022-06-09 14:43:17 +02:00
Alex Florisca 295184a734 Change Checkout.md to correct mistake (https://github.com/woocommerce/woocommerce-blocks/pull/6541) 2022-06-09 13:18:25 +03:00
Thomas Roberts 0aa3bcd9cb Access correct property of package destination in Store API (https://github.com/woocommerce/woocommerce-blocks/pull/6470)
* Access correct property of package destination

* Check for address_1 first then address
2022-06-09 12:45:00 +03:00
Tung Du 111b4eca48 Convert `useCollectionData` hook to TS (https://github.com/woocommerce/woocommerce-blocks/pull/6535) 2022-06-09 16:05:11 +07:00
renovate[bot] 2bc09b13e6 Update dependency cross-env to v7 (https://github.com/woocommerce/woocommerce-blocks/pull/6504)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-06-09 11:26:23 +03:00
Albert Juhé Lluveras b5252dbd8f Disable page scroll when Mini Cart is open (https://github.com/woocommerce/woocommerce-blocks/pull/6532) 2022-06-09 09:58:29 +02:00
Albert Juhé Lluveras d994f06803 Fix PHP notice in Mini Cart when prices included taxes (https://github.com/woocommerce/woocommerce-blocks/pull/6537) 2022-06-09 09:57:37 +02:00
Luigi Teschio 9a80ad3f6a bump version and update tested up value for WordPress and WooCommerce (https://github.com/woocommerce/woocommerce-blocks/pull/6534) 2022-06-07 15:58:18 +02:00
github-actions[bot] 7a05f8559d Release: 7.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6517)
* Empty commit for release pull request

* Add changelog for the 7.8.0 release

* Add testing notes for 7.8.0 release

* move legacy payment processing to its own class (https://github.com/woocommerce/woocommerce-blocks/pull/6519)

* update changelog and testing instructions after the cherry-pick

* add link

* Featured Item: Fix colors from default palette not being applied (https://github.com/woocommerce/woocommerce-blocks/pull/6525)

Gutenberg uses two different attributes for text colors:

* `style.color.text`, and
* `textColor`

However, the second one is used only when a color from the default
palette is selected AND the post is saved and reloaded.

With this fix we use the human readable string from the default palette
as a CSS variable.

Please note that while Gutenberg correctly assigns the appropriate CSS
class to render the right color, the problem is that if the color is
handled by a class, it can be overridden for example by themes.

See woocommerce/woocommerce-blocks#6492

* upload new zip

* update changelog

* Revert "Remove Combobox patch (https://github.com/woocommerce/woocommerce-blocks/pull/6465)" (https://github.com/woocommerce/woocommerce-blocks/pull/6531)

This reverts commit 4976afad58.

* 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>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-06-07 15:40:54 +02:00
Albert Juhé Lluveras 40231ea1f9 Revert "Remove Combobox patch (https://github.com/woocommerce/woocommerce-blocks/pull/6465)" (https://github.com/woocommerce/woocommerce-blocks/pull/6531)
This reverts commit 4976afad58.
2022-06-07 14:09:50 +02:00
Luigi Teschio bbda7f42b5 Update step for the section 'Create the Testing Notes' (https://github.com/woocommerce/woocommerce-blocks/pull/6523)
* update step for the section 'Create the Testing Notes'

* Update .github/patch-initial-checklist.md

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

* Update .github/release-initial-checklist.md

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

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-06-07 11:07:42 +02:00
Lucio Giannotta 7531428b31 Featured Item: Fix colors from default palette not being applied (https://github.com/woocommerce/woocommerce-blocks/pull/6525)
Gutenberg uses two different attributes for text colors:

* `style.color.text`, and
* `textColor`

However, the second one is used only when a color from the default
palette is selected AND the post is saved and reloaded.

With this fix we use the human readable string from the default palette
as a CSS variable.

Please note that while Gutenberg correctly assigns the appropriate CSS
class to render the right color, the problem is that if the color is
handled by a class, it can be overridden for example by themes.

See woocommerce/woocommerce-blocks#6492
2022-06-07 10:44:45 +02:00
Luigi Teschio 96b9cbf0c6 Add the button to migrate to the blockified version of the Product Grid Block woocommerce/woocommerce-blocks#6483 (https://github.com/woocommerce/woocommerce-blocks/pull/6485)
Add the button to migrate to the blockified version of the Product Grid Block
2022-06-06 16:49:19 +02:00
Seghir Nadir 87a5e41e05 move legacy payment processing to its own class (https://github.com/woocommerce/woocommerce-blocks/pull/6519) 2022-06-06 13:44:52 +01:00
renovate[bot] ec7705d5ce Update storybook monorepo to v6.5.7 (https://github.com/woocommerce/woocommerce-blocks/pull/6503)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-06 10:38:22 +02:00
Tung Du fb84599f42 Fix: Use `register_block_type_from_metadata` function (https://github.com/woocommerce/woocommerce-blocks/pull/6511) 2022-06-03 10:10:08 +07:00
Michael P. Pfeiffer f38e0819ad Featured items: ensure valid DOM nesting in inspector controls (https://github.com/woocommerce/woocommerce-blocks/pull/6501) 2022-06-01 10:02:24 +02:00
Albert Juhé Lluveras 70a1af8288 Add WC core release thread tasks to release checklist (https://github.com/woocommerce/woocommerce-blocks/pull/6502)
* Add WC core release thread tasks to release checklist

* Apply suggestions from code review

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
2022-06-01 08:42:23 +02:00
Lucio Giannotta 52b946bd29 Featured Item: Fix default color being overridden by themes (https://github.com/woocommerce/woocommerce-blocks/pull/6492)
This fix applies the user selected color on the block's parent element.

Also: Fix default and custom colors not being applied to title correctly.
2022-05-31 17:43:03 +02:00
Alba Rincón 2a99207fac Set the default value for focalPoint on block.json (https://github.com/woocommerce/woocommerce-blocks/pull/6499) 2022-05-31 13:26:36 +02:00
Michael P. Pfeiffer d17bb32c02 Filter Products by Price: Decrease step sequence from 10 to 1 (https://github.com/woocommerce/woocommerce-blocks/pull/6486) 2022-05-31 12:44:50 +02:00
Tung Du d3ab637ba2 Show a warning to notify the user if the WC Blocks version is behind the one bundled in WC Core (https://github.com/woocommerce/woocommerce-blocks/pull/6459)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-05-31 07:42:28 +07:00
Tung Du 775e149ad7 Fix: All translations related to JS blocks are loaded even if the block is not used (https://github.com/woocommerce/woocommerce-blocks/pull/6478) 2022-05-30 23:00:40 +07:00
Lucio Giannotta d63c5dafc1 Migrate Featured Items Blocks to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/6439)
Also:

* Refactored some composed components into one inclusive HOC,
called `withUpdateButtonAttributes`.

* The HOC `withTransformSingleSelectToMultipleSelect` allows for the wrong
type to be passed to its wrapped component: if a single element is
passed, that is wrapped into an array.

This didn't play well with TypeScript which obviously complains about
the wrong type being passed to the component.

So we now allow for arrays to be passed as props and ignored by the HOC
2022-05-30 16:38:52 +02:00
Daniel Dudzic b15050909e Mini Cart: Add font size and font family controls (https://github.com/woocommerce/woocommerce-blocks/pull/6396)
* Mini Cart: Add font size and family controls

* Remove redundant property from the path

* Add conditional check for isFeaturePluginBuild
2022-05-30 10:45:15 +02:00
Alba Rincón 7ab9cb214b Refactor: `Featured product` and `Featured category` classes (https://github.com/woocommerce/woocommerce-blocks/pull/6443)
* Add `Fixed/Repeated background` to the `Featured Category` block

* Reorganize `Featured Product` and `Feature Category` before unification

* Add new `FeaturedItem` class with the shared code for `Featured Product/Category`

* Remove space

* Small tweaks after review feedback
2022-05-30 09:08:53 +02:00
Seghir Nadir 3ff8440643 Respect low stock setting (https://github.com/woocommerce/woocommerce-blocks/pull/6444) 2022-05-27 20:55:46 +01:00
Luigi Teschio 90736d1742 Update RenovateBot configuration (https://github.com/woocommerce/woocommerce-blocks/pull/6477)
* Update RenovateBot configuration

* increase priority for devDeps

* update conf
2022-05-27 15:47:27 +02:00
Alex Florisca f85e0c6347 Only assign a reviewer when a PR is ready for review (https://github.com/woocommerce/woocommerce-blocks/pull/6461)
* Only assign a reviewer when a PR is ready for review

* Also run reviwer action when opening a normal PR

* Only assign a reviewer when a PR is ready for review
2022-05-27 18:05:54 +07:00
Luigi Teschio b72b1556d8 Update RenovateBot configuration (https://github.com/woocommerce/woocommerce-blocks/pull/6469)
* Update RenovateBot configuration

* increase priority for devDeps
2022-05-27 11:33:24 +02:00
Tung Du 0b51900bd2 Fix: Wait for the product to be added to cart before redirecting customer to the cart page (https://github.com/woocommerce/woocommerce-blocks/pull/6466) 2022-05-27 13:36:49 +07:00
Albert Juhé Lluveras 4976afad58 Remove Combobox patch (https://github.com/woocommerce/woocommerce-blocks/pull/6465) 2022-05-26 12:31:29 +02:00
Daniel Dudzic 9488b9186d Post-release version bump to 7.8.0-dev 2022-05-26 11:08:20 +02:00
github-actions[bot] 7f32bc4c14 Release: 7.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6448)
* Empty commit for release pull request

* Add changelog for the 7.7.0 release

* Add testing notes for the 7.7.0 release

* Fix being able to remove Cart Totals block (https://github.com/woocommerce/woocommerce-blocks/pull/6449)

* Update .zip link for the 7.7.0 release

* Revert changes to webpack build output (https://github.com/woocommerce/woocommerce-blocks/pull/6456)

* revert changes to webpack file

* fix loading of chunks

* revert changes to assets api as well

* include chunks from other blocks

* bail early if there is no build folder

* check if current folder exist (https://github.com/woocommerce/woocommerce-blocks/pull/6460)

* Update the 7.7.0 release .zip file

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-05-26 11:03:56 +02:00
Seghir Nadir f031f8f83a check if current folder exist (https://github.com/woocommerce/woocommerce-blocks/pull/6460) 2022-05-26 10:34:29 +02:00
Saad Tarhi 25cb047483 Remove `useStoreSnackbarNotices` and interact directly with data store instead (https://github.com/woocommerce/woocommerce-blocks/pull/6411)
* Use wp store directly instead of React Context

We are using now actions directly from wp store in 'useStoreCartCoupons'
hook to apply and remove coupon.

* Remove unused "useStoreSnackbarNotices" related
files

* Add NoticeContext TS definition

* Remove the Provider references and refactor code

* Fix snackbar notice creation bug

* Fix "clear out snackbar coupon notice" bug

* Update "notices" API documentation

Remove snackbar hooks mentions since it's not used anymore
2022-05-25 22:00:47 +01:00
Seghir Nadir d3c2f638fa Revert changes to webpack build output (https://github.com/woocommerce/woocommerce-blocks/pull/6456)
* revert changes to webpack file

* fix loading of chunks

* revert changes to assets api as well

* include chunks from other blocks

* bail early if there is no build folder
2022-05-25 16:59:51 +01:00
Saad Tarhi 8a702ab50f Fix broken link 2022-05-25 08:12:54 +01:00
Alba Rincón 983a13c8bf Add `Fixed/Repeated background` to the `Featured Category` block (https://github.com/woocommerce/woocommerce-blocks/pull/6440)
* Add `Fixed/Repeated background` to the `Featured Category` block

* Reorganize `Featured Product` and `Feature Category` before unification

* Fix gradient overlay
2022-05-24 16:10:16 +02:00
Alex Florisca 3f0e93268e Fix being able to remove Cart Totals block (https://github.com/woocommerce/woocommerce-blocks/pull/6449) 2022-05-24 12:49:53 +01:00
Alex Florisca 52a87760c3 Cache node_modules between workflows (https://github.com/woocommerce/woocommerce-blocks/pull/6404)
* Running actions

* Cache node_modules

* Correct cache-name-prop

* rejig if statements

* cache node_modules everywhere

* Simplify unit test action

* Add checkout action back into other unit test action steps

* Share node_modules and build assets between jobs

* Cache node_modules between jobs

* Fix github error

* Tidy up

* Change wp-env-with-gutenberg to support multiple plugins

* Fix permissions issue

* Remove chmod

* Pass woocommerce.zip as a string

* Revert change to plugins override in unit test workflow

* Revert wp-env-with-gutenberg change

* Revert wp-env-with-gutenberg change

* Revert wp-env-with-gutenberg change

* Refactor check-modified-assets workflow

* Fix missed dependency

* Revert breaking the check-modified-assets.yml
2022-05-24 12:42:54 +01:00
Thomas Roberts 4a7b8ae1cf Revert "Add `requireExactMatch` prop to `ComboBox` to prevent wrong country/state values being sent to the server (https://github.com/woocommerce/woocommerce-blocks/pull/6426)" (https://github.com/woocommerce/woocommerce-blocks/pull/6447)
This reverts commit b1f4e35c00.
2022-05-24 10:49:17 +02:00
Seghir Nadir 238ab01ab2 Refactor webpack splitting to fix missing translation (https://github.com/woocommerce/woocommerce-blocks/pull/6420)
* don't splitChunk frontend scripts

* simplfy output folders

* reduce minimum chunk size to 10kb

* add all inner blocks for loading

* better splitChunks

* update translation code

* wait for scripts

* try sleeping

* fix loading translation

* fix tests for mini cart

* simplfy po logic

* automate loading chunks

* rename webpack group file

* rename block.json path
2022-05-23 15:58:13 +01:00
Luigi Teschio 33a9e654ca Enable ESLint for E2E folder woocommerce/woocommerce-blocks#6410 (https://github.com/woocommerce/woocommerce-blocks/pull/6413)
Enable ESLint for E2E folder; fix ESLint errors
2022-05-23 14:05:30 +02:00
Alex Florisca 903f96f677 Locked blocks cannot be unlocked and removed (https://github.com/woocommerce/woocommerce-blocks/pull/6419)
* DIsable the locking/unlocking mechansism for the cart-items-block so it cannot be unlocked and deleted

* Update all locked inner blocks with support: { lock: false } to disable locking/unlocking the blocks
2022-05-23 13:59:07 +02:00
Alba Rincón a18e44e1a7 Convert `Products by Attribute` to TS (https://github.com/woocommerce/woocommerce-blocks/pull/6418)
* Convert `Products by Attribute` block to TS

* Small tweaks after review

* Extract InspectorControls and EditMode into components

* Refactor: move the edit related code to the edit.jsx file

* Remove the `editMode` attribute and control the edit mode inside the edit component

* Remove edit mode

* Change `isEditing` depending on attributes are selected or not

* Improved interfaces/props after review

* Add enum allowed values to `attrOperator` and `orderby` on the `block.json`

* Move `withSpokenMessages` to wrap the whole Edit block
2022-05-23 10:45:54 +02:00
Alba Rincón eec68ed371 Convert `Handpicked Products` block to TS (https://github.com/woocommerce/woocommerce-blocks/pull/6417)
* Convert `Handpicked Products` block to TS

* Extract InspectorControls and EditMode into components

* Refactor edit and remove the `editMode` attribute

* Change `isEditing` default depending on products selected or not

* Improve interfaces/props after review

* Move withSpokenMessages to wrap the whole Edit block
2022-05-23 10:14:51 +02:00
Alba Rincón d61c5116ad Start using `block.json` for the `Products by Attribute` block (https://github.com/woocommerce/woocommerce-blocks/pull/6414) 2022-05-23 10:10:06 +02:00
Albert Juhé Lluveras bcdb2174aa Remove bold styles from All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/6436) 2022-05-20 15:15:55 +02:00
Alba Rincón 6e5ebdff85 Start using the `block.json` metadata file for `Products by Tag` (https://github.com/woocommerce/woocommerce-blocks/pull/6403)
* Start using the block.json metadata file for `Products by Tag`

* Remove comment

* Add version, schema, and text domain

* Add defaults

* Remove wrong keyword

* Add tag icon when registering the block
2022-05-20 14:43:43 +02:00
Alba Rincón 3b86ff6b39 Fix padding for the Featured Product block (https://github.com/woocommerce/woocommerce-blocks/pull/6435) 2022-05-20 14:20:57 +02:00
Lucio Giannotta 7fcc561db1 Refactor Featured Category and Featured Product blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6406)
This PR creates a new directory called `featured-items` which includes both blocks.
All the shared code lives at the top level of that directory.

Individual blocks still have their own directories, with their `block.json` and all other relevant configuration.

All the functionalities have been refactored out into their own files, accepting configuration when relevant, but mostly de-duplicating all the code.

Styles have also been refactored using mixins and extends and they mostly live in one place.
2022-05-19 18:16:46 +02:00
Thomas Roberts b1f4e35c00 Add `requireExactMatch` prop to `ComboBox` to prevent wrong country/state values being sent to the server (https://github.com/woocommerce/woocommerce-blocks/pull/6426)
* Add requireExactMatch prop to ComboBox & only run onChange if value matches

* Set requireExactMatch to true for Country and State inputs

* Add unit tests for ComboBox

* Update expected value for onChange call

* Re-add autocomplete option to country input

* Use correct case for autoComplete in country input
2022-05-18 18:32:42 +01:00
Alba Rincón 22e6394d47 Implement `Fixed image` and `Repeated image` media controls for the `Featured Product` (https://github.com/woocommerce/woocommerce-blocks/pull/6344)
* Add `Fixed` and `Repeated` background controls to `Featured Product`

* Add `Repeated background` feature when the toggle is activated

* Extract `get_image_url` function

* Add the styles for rendering the repeated image on the frontend

* Add `hasParallax` and `isRepeated` to the `block.json` file

* Adjust styles

* Remove unused function, improve phpdoc

* Use alt and product name

Fix error rebasing master

* Hide alt if isRepeat is true

When isRepeated is true, the image is a background so it does not
make sense to have an alt attribute.

* Add `Fixed image` behaviour

* Remove unnecessary single quotes

* Remove duplicated const due to rebasing

* Fix focal point getting lost after enabling Fixed bg

* Fix duotone for fixed and repeated images

* Fix duotone for fixed and repeated images on the front end

* Don't allow alt if the image is a bg not an img element
2022-05-18 16:08:32 +02:00
Alba Rincón 89a553a8a7 Fix phpunit path after the repo renaming (https://github.com/woocommerce/woocommerce-blocks/pull/6421)
* Fix phpunit path after the repo renaming

* Use the current folder name to run phpunit tests
2022-05-18 14:58:22 +02:00
Thomas Roberts 622f873c80 Update release PR checklist template (https://github.com/woocommerce/woocommerce-blocks/pull/6422) 2022-05-17 13:01:43 +01:00
Niels Lange c6d22b9471 Rename readme.md to README.md 2022-05-16 09:29:38 +07:00
Niels Lange 98063e454a Rename readme.md to README.md 2022-05-16 09:28:50 +07:00
Luigi Teschio 38c8a2ae32 Add E2E tests for the Active Filters Block (https://github.com/woocommerce/woocommerce-blocks/pull/6393)
* wip

* set editor using env var instead

* fix attribute missing issue when watching the test

* wip php templates test

* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363

add E2E tests for the Filter Products By Price Block

* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363

add E2E tests for the Filter Products By Price Block

* create clickLink util

* Add E2E tests for the Active Filters Block woocommerce/woocommerce-blocks#6377

add E2E tests for the Active Filters Block

* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322

add E2E tests for the Filter Products By Attribute Block

* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323

add E2E tests for the Filter Products By Stock Block

* improve checks

* improve checks

* improve checks

* remove globals.d.ts file

* replace waitForTimeout

* create clickLint utils

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-05-13 15:18:51 +02:00
Alba Rincón 42166068b6 Start using the `block.json` metadata file for `Handpicked products` (https://github.com/woocommerce/woocommerce-blocks/pull/6392)
* Start using the `block.json` metadata file for `Handpicked products`

* Add the `properties` attribute to properly parse booleans

* Remove comment

* Add schema, delete version
2022-05-13 14:57:34 +02:00
Luigi Teschio 07e6878700 Add E2E tests for the Filter Products By Price Block (https://github.com/woocommerce/woocommerce-blocks/pull/6373)
* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363

add E2E tests for the Filter Products By Price Block

* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322

add E2E tests for the Filter Products By Attribute Block

* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323

add E2E tests for the Filter Products By Stock Block

* improve checks

* improve checks

* remove globals.d.ts file

* replace waitForTimeout
2022-05-13 14:15:33 +02:00
Alba Rincón bedd25ead6 Remove unnecessary `index.js` on Featured Category (https://github.com/woocommerce/woocommerce-blocks/pull/6394) 2022-05-13 12:36:46 +02:00
Luigi Teschio ac609f05dc Add E2E tests for the Filter Products By Stock Block (https://github.com/woocommerce/woocommerce-blocks/pull/6357)
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322

add E2E tests for the Filter Products By Attribute Block

* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323

add E2E tests for the Filter Products By Stock Block

* improve checks

* improve checks

* remove globals.d.ts file
2022-05-13 11:11:02 +02:00
renovate[bot] 76383c781c Update dependency @types/react to v17.0.45 (https://github.com/woocommerce/woocommerce-blocks/pull/6397)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-12 19:36:14 +02:00
renovate[bot] 7f501b41df Update dependency @types/wordpress__data to v4.6.11 (https://github.com/woocommerce/woocommerce-blocks/pull/6398)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-12 19:06:36 +02:00
renovate[bot] 11de221b85 Update dependency react-number-format to v4.9.3 (https://github.com/woocommerce/woocommerce-blocks/pull/6399)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-12 17:52:03 +02:00
Luigi Teschio ded12079cf Add E2E tests for the Filter Products By Attribute Block (https://github.com/woocommerce/woocommerce-blocks/pull/6355)
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322

add E2E tests for the Filter Products By Attribute Block

* improve checks
2022-05-12 17:15:53 +02:00
Thomas Roberts 2bfc687093 Bump version numbers following release PR merge 2022-05-10 12:55:02 +01:00
github-actions[bot] 07b201664a Release: 7.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6388)
* Empty commit for release pull request

* Bump version numbers and add changelog

* Add testing notes

* Add correct list of blocks to 6302 notes

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-05-10 12:50:11 +01:00
Thomas Roberts 9f13888d3a Merge branch 'trunk' into release/7.6.0 2022-05-10 12:49:50 +01:00
Thomas Roberts f3dc80c6f7 Bump version numbers to 7.7.0-dev 2022-05-10 09:54:22 +01:00
Thomas Roberts 712a6a6429 Bumping version strings to new version. 2022-05-10 09:37:40 +01:00
Thomas Roberts 88f921eb0d Add correct list of blocks to 6302 notes 2022-05-09 16:12:45 +01:00
Thomas Roberts e6d1341980 Add testing notes 2022-05-09 12:20:22 +01:00
Thomas Roberts 44a7e7f6bf Bump version numbers and add changelog 2022-05-09 12:03:39 +01:00
Tom Cafferkey fffe7903d7 Check asset_data_registry keys do not exist before adding them for PHP templates (https://github.com/woocommerce/woocommerce-blocks/pull/6384)
* Check key does not exists before adding it

* Use third param to check if duplicate key exists instead of condition
2022-05-09 11:50:22 +01:00
Daniel Dudzic 0b3acfad27 Add the product image control for all blocks utilizing GridContentControl (https://github.com/woocommerce/woocommerce-blocks/pull/6302) 2022-05-09 12:04:33 +02:00
Tung Du 773db56bc5 Fix: Empty Mini Cart Contents view in editor is not vertically centered on WP 6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6379) 2022-05-06 18:05:54 +07:00
Artur Piszek 62024321b9 Fix relative include paths (https://github.com/woocommerce/woocommerce-blocks/pull/6365) 2022-05-06 09:46:54 +02:00
Michael P. Pfeiffer 3aba1b4339 Featured Product: add background color option (https://github.com/woocommerce/woocommerce-blocks/pull/6367) 2022-05-06 07:13:11 +02:00
Lucio Giannotta 3ed91db9e7 Add media controls to the Featured Category block (https://github.com/woocommerce/woocommerce-blocks/pull/6360)
Also:

* Make sure media controls are unavailable unless there is media
2022-05-05 17:55:53 +02:00
Michael P. Pfeiffer 3f6b197063 Featured Category: add background color option (https://github.com/woocommerce/woocommerce-blocks/pull/6368) 2022-05-05 16:12:01 +02:00
Tung Du a22c93f00b Disable lock menu item for Mini Carts Contents and its inner blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6374) 2022-05-05 17:31:57 +07:00
Tarun Vijwani 2440fb6f36 Fixed Release Schedule link in release and patch initial checklist (https://github.com/woocommerce/woocommerce-blocks/pull/6338) 2022-05-05 14:01:37 +04:00
Tarun Vijwani 51495ff32c Meaningful comment for skipping the e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/6353)
* Added meaningful comment for skipping the tests if it's a WooCommerce Core process environment.

* Fixed the flag number for MiniCart
2022-05-05 12:19:38 +04:00
Tung Du 26fbb3f569 Shop page: Remove the Template panel from the Setting Sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/6366) 2022-05-05 08:08:10 +07:00
Tung Du 217c822b76 Fix: Mini Cart block is not available from the Edit template screen (https://github.com/woocommerce/woocommerce-blocks/pull/6351)
* revert woocommerce/woocommerce-blocks#5653

* remove unused global variable

* fix class name
2022-05-05 07:41:35 +07:00
Tung Du 5930ee6a94 Remove custom ensureSidebarOpened() (https://github.com/woocommerce/woocommerce-blocks/pull/6359) 2022-05-05 07:14:07 +07:00
Daniel Dudzic cd8196fa5f Product Tag Cloud: Hide from Widgets screen in classic themes (https://github.com/woocommerce/woocommerce-blocks/pull/6327)
* Product Tag Cloud: Hide from Widgets screen in classic themes
* Fix code indentation
2022-05-04 16:57:25 +02:00
Albert Juhé Lluveras 3d8043ca6b Add clarification about 'Do not include in the Testing Notes' checkbox in PR template (https://github.com/woocommerce/woocommerce-blocks/pull/6370) 2022-05-04 15:14:54 +02:00
Tung Du 206672f27e Classic Template: set the default alignment to wide (https://github.com/woocommerce/woocommerce-blocks/pull/6356) 2022-05-04 18:02:42 +07:00
renovate[bot] 18f7d5f3c5 Update dependency @types/react-dom to v17.0.16 (https://github.com/woocommerce/woocommerce-blocks/pull/6361)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-04 11:15:30 +02:00
Tarun Vijwani 02a1b9f78d Remove redundant front-end Checkout block test case (https://github.com/woocommerce/woocommerce-blocks/pull/6352)
* Removed redundant front-end test case
2022-05-04 09:58:12 +04:00
renovate[bot] 8ffd0928c3 Update dependency @types/wordpress__block-editor to v6.0.6 (https://github.com/woocommerce/woocommerce-blocks/pull/6362)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-04 04:02:30 +00:00
Alba Rincón dcc4e60dda Parse categories coming from the back-end as a json array (https://github.com/woocommerce/woocommerce-blocks/pull/6358)
* Parse categories coming from the back-end as a json array

The category ids that come from php are in json array format (e.g. '[40,41]'),
so it's necessary to parse them and convert them into a js array before
processing them. Otherwise the api request will fail.

* Only parse category ids if not undefined
2022-05-03 16:09:20 +02:00