Commit Graph

3842 Commits

Author SHA1 Message Date
Thomas Roberts 918de7bc75 Ensure screenshots can be attached in jest html report (https://github.com/woocommerce/woocommerce-blocks/pull/5919)
* Ensure screenshots can be attached in jest html report

* Force tests to fail in ci

* Console log for testing

* Console log for testing

* Check on hook failure as well as test failure

* Revert "Force tests to fail in ci"

This reverts commit 6efebd63bba4792214f5b24824fb405cf38b1367.

* Take full page screenshot only when error type is not hook_failure

* Remove console log
2022-02-24 09:06:24 +00:00
Tarun Vijwani 2a5a40279f Removed negative margin-bottom from .wc-block-checkout__additional_fields class (https://github.com/woocommerce/woocommerce-blocks/pull/5899) 2022-02-24 12:29:30 +04:00
dependabot[bot] be54e48860 Bump follow-redirects from 1.14.7 to 1.14.8 (https://github.com/woocommerce/woocommerce-blocks/pull/5840)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: direct:development
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-23 17:31:38 +00:00
colinleroy 7cb936bb10 Avoid calling plugin_dir_url a lot (https://github.com/woocommerce/woocommerce-blocks/pull/5915) 2022-02-23 12:20:32 +00:00
Mike Jolley a58b2d0ac4 Store API: Introduce API Versioning System (https://github.com/woocommerce/woocommerce-blocks/pull/5911)
* Fix missing dependency

* Min version exceeds required 5.6

* Move exceptions

* Move schemas under V1 namespace

* Move routes to v1

* Move RouteException

* Route versioning

* Update route and schema identifiers/init

* Rework route init to support multiple versions and multiple schema

* Tests for cart routes

* Cart coupons tests

* Batch

* extensions

* Update docs

* Update remaining tests

* woocommerce_store_api_route_version was unused

* Revert unrelated change

* Fix phpcs

* Update src/StoreApi/docs/guiding-principles.md

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

* Update src/StoreApi/docs/cart-items.md

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

* Update src/StoreApi/RoutesController.php

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

* Note about v1 unversioned endpoints

* Remove unused get_route_version

* 409 comment in tests

* Remove copy pasted comments

* Update all usage to v1

* Correct namespace

* More v1 namespaces

* More missing v1

* fix mocks

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-02-23 12:00:45 +00:00
renovate[bot] 73f6a28e94 Update dependency react-number-format to v4.9.1 (https://github.com/woocommerce/woocommerce-blocks/pull/5922)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-23 11:31:12 +00:00
Tomasz Tunik 1805d29cc9 Add to Featured Product block option to remove custom image (https://github.com/woocommerce/woocommerce-blocks/pull/5886)
* adds toolbar option to remove custom image

removing custom image will reset it back to the default
product image if available

* update copy as per discussion

went with just Reset as it is commonly used in WordPress
and will have translation available
2022-02-23 08:16:47 +01:00
renovate[bot] 4f5ec713df Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/5921)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-23 03:55:08 +00:00
Mike Jolley 0714fa41bd Customer Data Store and revised handling for Shipping As Billing (https://github.com/woocommerce/woocommerce-blocks/pull/5817)
* Add address-related items to wc/store/cart data store

* include shippingAsBilling in return value of useCustomerData

* Add useUpdateCustomerData hook

This allows us to have a single hook responsible for updating the customer information on the server.

* Add useUpdateCustomerData hook in Checkout block

* Remove the updating customer data work from the useCustomerData hook

* Remove shippingAsBilling from previousCustomerData ref type

* Add useShippingAsBillingCheckbox hook

* Control shippingAsBilling from single hook

* Remove checkbox handling from useCheckoutAddress

* Remove CustomerDataContext typedef

* Merge with woocommerce/woocommerce-blocks#5810 changes

* Move shipping as billing to checkout state context provider

* Unused import

* Subscribe to changes

* Only receiveCartContents when updating customer data via checkout

* Cache customerDataToUpdate

* rename debounced function

* Combine customerDataType and customerDataContextType

* Change case of CustomerDataType

* debouncedUpdateCustomerData typo

* Fix notice context

* Clean up inline docs for push changes

* Comment on dirty state

* Phone is always set

* shippingAddress is never undefined

* setBillingPhone

* receiveCartContents explanation

* Tweak customerData to avoid null

* useShippingAsBilling

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2022-02-22 17:45:01 +00:00
Luigi Teschio a02e79ea38 Fix Global Styles for Product Image, Product Category List and Product Tag List Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/5852)
* fix Global Styles for Product Image, Product Category List and Product Tag List blocks

fix Global Styles for Product Image, Product Category List and Product Tag List blocks

* Block style font-size was applying wrong value for fontSize

* Add missing __experimentalSkipSerialization to Category List

Co-authored-by: Tomasz Tunik <tomasztunik@gmail.com>
2022-02-22 18:06:33 +01:00
Luigi Teschio 6e05f2dcf9 update innerBlock template for Featured Product and Featured Category blocks woocommerce/woocommerce-blocks#5676 (https://github.com/woocommerce/woocommerce-blocks/pull/5867)
update innerBlock template for Featured Product and Featured Category blocks
2022-02-22 15:49:11 +01:00
Albert Juhé Lluveras 530730e1a8 Remove hover effect from disabled Mini Cart button (https://github.com/woocommerce/woocommerce-blocks/pull/5909) 2022-02-22 15:40:48 +01:00
Tom Cafferkey 94b2d95693 Change tempalte ID when loading the mini cart template part (https://github.com/woocommerce/woocommerce-blocks/pull/5916) 2022-02-22 10:24:50 +00:00
Raluca Stan 858fffd697 Pass context information about parent block to the existing Slots (https://github.com/woocommerce/woocommerce-blocks/pull/5885)
* Pass context information about containing block to the existing Slots

* Fix images added to the Slots docs

* Use the parent's block name for the context prop passed to Slot fills
2022-02-22 10:33:52 +01:00
Tung Du 399a204138 Fix: Ensure `shopper.goToBlockPage` works with any theme (https://github.com/woocommerce/woocommerce-blocks/pull/5914) 2022-02-22 11:34:51 +07:00
Tung Du 47f8993a8d Shopper → Mini Cart → Can see the icon with a badge (https://github.com/woocommerce/woocommerce-blocks/pull/5877) 2022-02-22 09:50:59 +07:00
dependabot[bot] b7646e4640 Bump url-parse from 1.5.3 to 1.5.9 (https://github.com/woocommerce/woocommerce-blocks/pull/5905)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.9.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.3...1.5.9)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 19:24:49 +00:00
Albert Juhé Lluveras 0008e8b7f1 Update some Cart and Checkout extensibility docs to include the Mini Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/5815)
* Update some Cart and Checkout extensibility docs to include the Mini Cart block

* Add Mini Cart to blocks-registry docs
2022-02-21 16:29:29 +01:00
mrleemon fcaf683fdc Fix typo (https://github.com/woocommerce/woocommerce-blocks/pull/5903) 2022-02-21 14:48:58 +00:00
Lucio Giannotta 341a742916 E2E tests for Product Tag Template and Legacy Block (https://github.com/woocommerce/woocommerce-blocks/pull/5888)
Also: 

* Add fixtures for tags
* Teardown both categories and tags when tests are done
2022-02-21 13:26:22 +01:00
Lucio Giannotta d64ebc72dc E2E tests for Product Category Template and Legacy Block (https://github.com/woocommerce/woocommerce-blocks/pull/5820) 2022-02-21 12:38:36 +01:00
Lucio Giannotta 5de9fec527 E2E tests for Product Archive Template and Legacy Block (https://github.com/woocommerce/woocommerce-blocks/pull/5748)
Also:
* Refactors the function to add a custom paragraph
* Add front-end test for archive template
* Use WordPress data to guarantee block presence
* Use WordPress data instead of selectors to match blocks
2022-02-21 12:01:56 +01:00
Lucio Giannotta 497820dcb9 E2E tests for Single Product Template (https://github.com/woocommerce/woocommerce-blocks/pull/5722)
* Add empty block theme to mock E2E tests
* Install empty theme in the test WP instance
2022-02-21 11:01:42 +01:00
Luigi Teschio 71bd69ad07 Pre-hydrate Mini Cart Block woocommerce/woocommerce-blocks#5882 (https://github.com/woocommerce/woocommerce-blocks/pull/5892)
* Pre-hydrate Mini Cart Block woocommerce/woocommerce-blocks#5882

Pre-hydrate Mini Cart Block

* try to fix test

* fix wrong behaviour
2022-02-18 14:44:10 +01:00
Tung Du dceb480e00 fix shopping button icon (https://github.com/woocommerce/woocommerce-blocks/pull/5859) 2022-02-17 16:19:01 +01:00
Raluca Stan 888d3d85b2 Update info about /checkout get endpoint data (https://github.com/woocommerce/woocommerce-blocks/pull/5807) 2022-02-17 10:13:41 +01:00
Luigi Teschio 54ce880762 Add wc-block-mini-cart__contents class for the Mini Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/5800)
* Add wc-block-mini-cart__contents class for the Mini Cart block woocommerce/woocommerce-blocks#5418

Add wc-block-mini-cart__contents class for the Mini Cart block

* removed comment
2022-02-16 17:18:44 +01:00
Daniel Dudzic 5e55c1ae4a Mini Cart Block contents: Remove item border bottom (https://github.com/woocommerce/woocommerce-blocks/pull/5739)
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-02-16 16:13:26 +01:00
Panos (Panagiotis Synetos) b8e4e37bb5 👌IMPROVE: Update readme.md to include required node version and npm run dev command (https://github.com/woocommerce/woocommerce-blocks/pull/5865) 2022-02-16 13:20:41 +00:00
Lucio Giannotta a9fd133c26 Post release version bump (7.1.0-dev) 2022-02-16 12:23:02 +01:00
github-actions[bot] beb0188116 Release: 7.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5842)
* Fix All Products block pagination not showing up (https://github.com/woocommerce/woocommerce-blocks/pull/5850)
* Fix regression for Twenty Twenty-Two theme with sale prices being underlined (https://github.com/woocommerce/woocommerce-blocks/pull/5851)

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tomasz Tunik <tomasztunik@gmail.com>
2022-02-16 12:18:36 +01:00
renovate[bot] d85f02112a Update dependency @types/react to v16.14.23 (https://github.com/woocommerce/woocommerce-blocks/pull/5857)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-16 04:35:29 +00:00
renovate[bot] f3894aabcd Update dependency @testing-library/react to v12.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/5856)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-16 04:22:50 +00:00
Tomasz Tunik b7c0fd60ce Fix regression for Twenty Twenty-Two theme with sale prices being underlined (https://github.com/woocommerce/woocommerce-blocks/pull/5851)
class name on price container in Product by * blocks changed from 'wc-block-components-product-price' to 'wc-block-grid__product-price'
2022-02-15 22:45:00 +01:00
Alex Florisca 3f1ebfd631 Update version numbers in bug report template (https://github.com/woocommerce/woocommerce-blocks/pull/5818) 2022-02-15 16:08:38 +00:00
Albert Juhé Lluveras cd6ceecd3a Fix All Products block pagination not showing up (https://github.com/woocommerce/woocommerce-blocks/pull/5850) 2022-02-15 16:31:50 +01:00
Luigi Teschio 30e10295c1 Rating Product block: Add support for global style (https://github.com/woocommerce/woocommerce-blocks/pull/5521)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* Rating Product block: add support for global style woocommerce/woocommerce-blocks#4965

Rating Product block: add support for global style

* add feature flag

* fix import after merge

* fix global style css generation

* restore css for classic product rating html element

* don't apply the global style to PHP blocks

* remove registration
2022-02-15 15:48:45 +01:00
Tarun Vijwani 6cfadd9eb4 Fix for inconsistent spacing for checkout input fields (https://github.com/woocommerce/woocommerce-blocks/pull/5743)
Added margin top to :only-child to fix the inconsistent spacing for checkout input fields
2022-02-15 16:17:24 +04:00
Tung Du c7c914218e Fix: Mini Cart template part editor height (https://github.com/woocommerce/woocommerce-blocks/pull/5825) 2022-02-15 16:57:53 +07:00
Tung Du e513968a2d Add Shopping Button Inner block (https://github.com/woocommerce/woocommerce-blocks/pull/5614) 2022-02-15 13:48:06 +07:00
Luigi Teschio 8ae22fbc51 Remove not necessary div woocommerce/woocommerce-blocks#5419 (https://github.com/woocommerce/woocommerce-blocks/pull/5687)
Remove not necessary div
2022-02-14 17:39:04 +01:00
Luigi Teschio fba8b3767f Product Image block: Enable global style (https://github.com/woocommerce/woocommerce-blocks/pull/5562)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style woocommerce/woocommerce-blocks#4965

Featured Category block: Add support for global style

* fix border color

* Product Image block: enable global style woocommerce/woocommerce-blocks#4965

Product Image block: enable global style woocommerce/woocommerce-blocks#4965

* fix test
2022-02-14 11:57:55 +01:00
Niels Lange 6946a0c189 Remove obsolete * in comment 2022-02-14 17:55:28 +07:00
Luigi Teschio d096b21504 Tag List block: Add support for global style (https://github.com/woocommerce/woocommerce-blocks/pull/5528)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* move hooks in a specific folder

* Tag List block: add support for global style woocommerce/woocommerce-blocks#4965

Tag List Block: add support for global style

* add feature flag
2022-02-14 11:34:28 +01:00
Luigi Teschio 481f4c8e8e Sale Product Block: Enable global style (https://github.com/woocommerce/woocommerce-blocks/pull/5565)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style woocommerce/woocommerce-blocks#4965

Featured Category block: Add support for global style

* fix border color

* Sale Product block: enable global style woocommerce/woocommerce-blocks#4965

Sale Product block: enable global style woocommerce/woocommerce-blocks#4965

* add comment
2022-02-14 11:32:13 +01:00
Luigi Teschio f2dad05e0d Category List block: add support for global style (https://github.com/woocommerce/woocommerce-blocks/pull/5516)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* Enable global style for category list block woocommerce/woocommerce-blocks#4965

Enable global style for category list block

* fix import after merge

* add save function

* add feature flag
2022-02-14 11:29:17 +01:00
Tom Cafferkey d178761252 Fix reverting customisations by refactoring pre_get_block_file_template (https://github.com/woocommerce/woocommerce-blocks/pull/5746)
* Refactor maybe_return_blocks_template to get_woocommerce_block_file_template

* Remove unused method and rename get_woocommerce_block_file_template to get_block_file_template

* Account for product-archive template fallbacks

* Fix bug with clearing customizations of templates using the deprecated plugin ID
2022-02-10 14:15:09 +00:00
Mike Jolley 0a8fe0a0c6 Remove `useSelectShippingRate` hook and adjust how local state works for `PackageRates` (https://github.com/woocommerce/woocommerce-blocks/pull/5802)
* Convert radio component to TS and support uncontrolled components

* Further radio control to typescript changes

* Combine useSelectShippingRate and useSelectShippingRates

* Remove useSelectShippingRate hook

* Move local radio checked state to PackageRates

* This is a Controlled component - update inline docs

* useSelectShippingRates -> useSelectShippingRate rename
2022-02-10 11:59:43 +00:00
Raluca Stan 051bb64138 Fix wide appender buttons overlap in Cart & Checkout blocks in the Editor (https://github.com/woocommerce/woocommerce-blocks/pull/5801)
* Add the correct appender button for non empty groups

* Revert "Add the correct appender button for non empty groups"

This reverts commit 4b41d7d7f82461813b3464d1b4f931c442bce3be.

* Force position relative for custom InnerBlocks.ButtonBlockAppender  appenders.

Removing InnerBlocks.ButtonBlockAppender  from renderAppender = {InnerBlocks.ButtonBlockAppender } results in the black appender button beeing shown only when the block is selected, and we need the appender to be visible by default.
2022-02-10 11:33:48 +01:00
Luigi Teschio a594ea5ef5 Fix Mini Cart doesn't update data (https://github.com/woocommerce/woocommerce-blocks/pull/5741)
* Remove api hydration for the Mini Cart Block woocommerce/woocommerce-blocks#5729

Remove api hydration for the Mini Cart Block

* fix PHP error

* send event when the button is clicked

* fix import order
2022-02-10 10:26:09 +01:00