Commit Graph

3082 Commits

Author SHA1 Message Date
Tung Du 9b1a289683 Add global styles to Product Title block (https://github.com/woocommerce/woocommerce-blocks/pull/5009)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-10-28 22:51:25 +07:00
Tung Du e60405689d Mini Cart block: add footer (subtotal, cart & checkout buttons and payment method icons) (https://github.com/woocommerce/woocommerce-blocks/pull/4982)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-10-28 22:48:39 +07:00
Albert Juhé Lluveras edaf0f094d Run BlockTemplatesController filter only on templates (https://github.com/woocommerce/woocommerce-blocks/pull/5027) 2021-10-28 15:33:42 +02:00
Ovidiu Liuta 5b2d24da36 Fix: Adding a visual border to products image placeholder (https://github.com/woocommerce/woocommerce-blocks/pull/4950)
* fixing all products image placeholder border

* fixing grid placeholder image border

* fixing cart checkout product image placeholder border

* order summary product image placeholder border fix

* revert fixing cart checkout product image placeholder border

* fixing product elements atomic block placeholder border

* fixing failing tests for cart-checkout test and class rename

* adding border style mixin

* newline addon

* linting fix and esc_attr addon

* adding border color to _colors.scss abstracts

* fixing cart-checkout block scss color

* removing class names from product-elements atomic block placeholder images

* css linting fix

* css linting fix

* css linting fix

* fixing empty className in cart-checkout

* adding cart-checkout fallback alt text to product name and css changes empty alt placeholder

* adding image fallback alt to AbstractProductGrid

* updating checkout snapshot to include alt

* code style changes

* removing unused scss code

* adding img alt style fix to prevent global changes
2021-10-28 13:57:20 +01:00
Michael P. Pfeiffer b5bb42e799 Update version following release 2021-10-28 09:10:37 +02:00
github-actions[bot] 5454667fa6 Release: 6.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4990)
* Empty commit for release pull request

* Update readme.txt with release changelog

* Add testing instructions for 6.2.0 release

* Return an element instead of a component in useViewSwitcher (https://github.com/woocommerce/woocommerce-blocks/pull/5016)

* return element instead of component in viewSwitcher

* use ToolbarGroup instead of Toolbar

(cherry picked from commit ad133ba901)

* Update release zip in testing note

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Michael P. Pfeiffer <michael@cssconf.eu>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2021-10-28 09:04:30 +02:00
Seghir Nadir ad133ba901 Return an element instead of a component in useViewSwitcher (https://github.com/woocommerce/woocommerce-blocks/pull/5016)
* return element instead of component in viewSwitcher

* use ToolbarGroup instead of Toolbar
2021-10-27 16:41:57 +01:00
renovate[bot] 3bc74b1fb2 Update dependency @types/react to v16.14.20 (https://github.com/woocommerce/woocommerce-blocks/pull/5006)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-27 04:44:14 +00:00
renovate[bot] 506b6a8d10 Update dependency @types/lodash to v4.14.176 (https://github.com/woocommerce/woocommerce-blocks/pull/5004)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-27 02:42:19 +00:00
renovate[bot] f9f84ba271 Pin dependency @types/wordpress__compose to 4.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5003)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-27 02:30:32 +00:00
Mike Jolley 04cd927195 Add inline note around displayWithTax to clarify why prices change (https://github.com/woocommerce/woocommerce-blocks/pull/4979)
* Add inline note around displayWithTax to clarify why prices change

* update snaps

* Snap update

* Clarify docs further for displayCartPricesIncludingTax

* Update assets/js/previews/cart.ts

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
2021-10-26 15:03:51 +02:00
Seghir Nadir b6c314f0d4 Use Cart's needs payment check instead of Order's (https://github.com/woocommerce/woocommerce-blocks/pull/4955)
* Revert "Fix free orders missing payment method (https://github.com/woocommerce/woocommerce-blocks/pull/4854)"

This reverts commit 60f82537f1.

* use Cart needs payment instead of Order needs payment

* switch to nullish coalescing

* remove extra line
2021-10-26 10:42:39 +01:00
Seghir Nadir 3ce06eb87b migrate aligment options (https://github.com/woocommerce/woocommerce-blocks/pull/4986) 2021-10-25 17:42:31 +01:00
Albert Juhé Lluveras 4253a5fe10 Make Mini Cart block react to removed_from_cart events (https://github.com/woocommerce/woocommerce-blocks/pull/4947)
* Make Mini Cart block react to removed_from_cart events

* Move listening to add to cart and remove from cart events to the useStoreCart hook

* Add tests
2021-10-25 18:05:01 +02:00
Seghir Nadir dc1f979ae1 Add custom className support to Cart Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4985)
* move empty cart

* remove Cart and rename Cart i2 to Cart

* graduate blocks

* setup template migration from Cart i1 to Cart i2

* back to js so we have a good diff

* add migration

* fix bug in empty cart template

* add useForceLayout hook to edit

* migrate from old block to new block

* migrate styles

* respect align

* add tests

* Include latest cart line item improvements from cart-i1

* Missing changes from cart-i1

* Line items table should be disabled

* Fix e2e tests for cart i2

* update tests to adapt for inner blocks

* update select to resolveSelect to remove warning checker

* rename test/block to test/index

* move blocks to their own file

* undo rename to keep diff clean

* remove .tsx and update jest config

* Revert "update select to resolveSelect to remove warning checker"

This reverts commit 79d55de30edcfe36bbdfe7506df7a09460824f03.

* revert resolveControl

* Fix empty cart editor E2E test by scrolling to the view switch

* parse attributes for order summary block

* migrate attributes when resaving

* Update documentation

Automatic update after running npm run build:docs

* add classname support to accepted payment methods block

* add classname support to express payment methods block

* add classname support to cart items  block

* add classname support to cart line items block

* add classname support to order summary block

* add classname support to totals block

* add classname support to empty cart  block

* add classname support to filled cart block

* add classname support to proceed to checkout block

* type edit

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
2021-10-25 16:31:22 +01:00
Raluca Stan 357a1265cb Add a loading state to Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4980)
* Add a loading state to Cart i2

We use CSS and the is-loading class to hide empty state and show regular state

* Lint cart/style.scss
2021-10-25 16:31:12 +01:00
Seghir Nadir 2408e34faa Migrate Cart i1 to Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4973)
* move empty cart

* remove Cart and rename Cart i2 to Cart

* graduate blocks

* setup template migration from Cart i1 to Cart i2

* back to js so we have a good diff

* add migration

* fix bug in empty cart template

* add useForceLayout hook to edit

* migrate from old block to new block

* migrate styles

* respect align

* add tests

* Include latest cart line item improvements from cart-i1

* Missing changes from cart-i1

* Line items table should be disabled

* Fix e2e tests for cart i2

* update tests to adapt for inner blocks

* update select to resolveSelect to remove warning checker

* rename test/block to test/index

* move blocks to their own file

* undo rename to keep diff clean

* remove .tsx and update jest config

* Revert "update select to resolveSelect to remove warning checker"

This reverts commit 79d55de30edcfe36bbdfe7506df7a09460824f03.

* revert resolveControl

* Fix empty cart editor E2E test by scrolling to the view switch

* parse attributes for order summary block

* migrate attributes when resaving

* Update documentation

Automatic update after running npm run build:docs

* add align options to filled cart and empty cart

* append instead of replcae

* import style.scss in frontend

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
2021-10-25 15:46:34 +01:00
Tom Cafferkey 35d49f1583 BlockTemplateController (https://github.com/woocommerce/woocommerce-blocks/pull/4981)
* BlockTemplateController

* Check if theme already has template

* ThemeUtils file to check for FSE enabled themes

* Use Gutenberg global gutenberg_supports_block_templates

* Remove ThemeUtils reference

* Update with code review comments

* Delete ThemeUtils and move supports_block_templates check

* Duplicate functions from Gutenberg into Utils file

* Remove template file

* Check template directory and stylesheet directory for template
2021-10-25 10:45:50 +01:00
Tung Du 7dc9b16f4a Add basic E2E tests for products grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4872)
* wip: add product on sale test

* test: add fixture for product on sale test

* try: permission

* Revert "try: permission"

This reverts commit f8eb09c0152a567383e93c18f61e91fdadd13c40.

* test: basic e2e test for products by category block

* test: basic e2e test for products by tag block

* add basic test for products by attribute block

* trigger build

* fix: slug
2021-10-21 10:23:15 +01:00
Tung Du bd3e7126f8 Mini Cart block: display a compatibility notice when the user first adds the block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/4945) 2021-10-21 16:07:20 +07:00
Tom Cafferkey b8fbb56055 Convert Title component to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4891)
* Convert sharedConfig and Title blockConfig to TS

* Convert constants.tsx to TS

* Convert attributes.js to TS

* Amend attributes.ts record type

* Convert title component edit.js to TS

* Convert title component block.js to TS

* Amend product name index.tsx to prevent TS errors in product title block.tsx

* Amend product-name and base tsconfig

* Add rel to ProductName component element

* Replace ReactElement with JSX.Element

* Move TagName component to outside of the main component

* Add HTMLAttributes import

* WIP: Add props to TagName component

* Fix TagName typing

* Update TagName interface

* Replace ReactElement typing with JSX.Element

* Code review feedback amends

* Replace return type undefined to void

Co-authored-by: Michael P. Pfeiffer <michael@cssconf.eu>
2021-10-21 09:58:03 +01:00
Mike Jolley 5cd05b6d99 Add custom className support to Checkout Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4978)
* Pass classname from DOM to react components

* Actions Block ClassName support

* Form step field classname support

* Payment block className support

* Classname support for fields and totals

* Order summary classname support

* Classname support for order note block

* Express payment classname support

* Terms block custom class

* Let useBlockProps handle class in actions block
2021-10-20 17:18:13 +01:00
Mike Jolley c4be7ca307 Styling (margin and padding) tweaks (https://github.com/woocommerce/woocommerce-blocks/pull/4974) 2021-10-20 17:02:05 +01:00
Mike Jolley 4b0f975707 Force array type for valid states (https://github.com/woocommerce/woocommerce-blocks/pull/4975) 2021-10-20 16:29:21 +01:00
Raluca Stan a1046eb95e Add empty cart to Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4976) 2021-10-20 15:42:57 +01:00
Niels Lange 02dbd8bf4f Correct WooCommerce branding color (https://github.com/woocommerce/woocommerce-blocks/pull/4959) 2021-10-20 10:30:16 +01:00
Mike Jolley 8b093f949a Merge branch 'trunk' of https://github.com/woocommerce/woocommerce-gutenberg-products-block into trunk 2021-10-20 10:11:25 +01:00
Mike Jolley 4385619be5 Fix notice in e2e test suite from potentially undefined id 2021-10-20 10:11:20 +01:00
renovate[bot] 17dbd667bc Update dependency @types/jquery to v3.5.8 (https://github.com/woocommerce/woocommerce-blocks/pull/4968)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-20 09:52:39 +01:00
renovate[bot] 16e94dd3bc Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/4967)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-20 03:04:30 +00:00
Seghir Nadir 7c8becccd7 Move shared code between Cart and Checkout into single folder. (https://github.com/woocommerce/woocommerce-blocks/pull/4961)
* move shared code out of checkout into shared folder

* move code from cart i2 to shared folder

* move columns

* move viewSwitcher

* code cleanup inside Cart i2
2021-10-19 15:29:12 +01:00
Mike Jolley 2e0d0faa84 Enforce valid states from the API (https://github.com/woocommerce/woocommerce-blocks/pull/4844)
* Enforce valid states from the API

* Remove paypal from test
2021-10-19 14:30:02 +01:00
Seghir Nadir 91296b09cc Update blocks-registry docs (https://github.com/woocommerce/woocommerce-blocks/pull/4946)
* add handleMap

* remove useValidation from cart blocks

* add namespace options to docs

* Update packages/checkout/blocks-registry/README.md

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

* expand on the docblock

* Update packages/checkout/blocks-registry/README.md

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

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-10-19 14:05:26 +01:00
Mike Jolley 3840462cf0 Add Accepted Payment Methods Block (https://github.com/woocommerce/woocommerce-blocks/pull/4944)
* Remove icons from checkout button

* Add new block type

* Register new block

* Remove unused attribute

* Add to new template

* Remove duplicate attributes

* Update Inner Block handling to use consistent appender and unlock payment methods
2021-10-19 12:23:33 +01:00
Mike Jolley dc19412a54 Update dependency @woocommerce/e2e-utils to v0.1.6 (https://github.com/woocommerce/woocommerce-blocks/pull/4957)
* Update @woocommerce/e2e-utils

* Define grouped
2021-10-18 20:01:10 +01:00
Mike Jolley dad8331242 Cart i2 Attribute Audit (https://github.com/woocommerce/woocommerce-blocks/pull/4956)
* Add dark mode inputs toggle to top level block

* Remove top level attributes which moved to inner blocks

* Remove unused components

* Pass down hasDarkControls and currentView via context props
2021-10-18 17:12:36 +01:00
renovate[bot] 45b1b4569b Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4883)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-18 15:08:05 +01:00
Niels Lange 40e43b5328 Add e2e tests for Hand-picked Products (https://github.com/woocommerce/woocommerce-blocks/pull/4788) 2021-10-18 15:07:24 +01:00
Niels Lange 3f530ac755 Add e2e tests for Best Selling Products (https://github.com/woocommerce/woocommerce-blocks/pull/4785) 2021-10-18 15:06:48 +01:00
renovate[bot] 409230cff5 Update dependency @types/react to v16.14.17 (https://github.com/woocommerce/woocommerce-blocks/pull/4933)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-18 15:00:13 +01:00
renovate[bot] f8c9bc54f9 Update dependency @types/jquery to v3.5.7 (https://github.com/woocommerce/woocommerce-blocks/pull/4932)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-18 14:59:52 +01:00
Albert Juhé Lluveras c3152aec96 Add e2e tests to verify disabled blocks can't be inserted into widget areas (https://github.com/woocommerce/woocommerce-blocks/pull/4910) 2021-10-18 08:48:03 +02:00
Tung Du 277a20cca3 Fix: Spilled icecream error with Filter Products by Attribute when no attribute was selected (https://github.com/woocommerce/woocommerce-blocks/pull/4847) 2021-10-15 21:50:47 +07:00
hafhaf10 4d0ba20d6d Fix correct branding color (https://github.com/woocommerce/woocommerce-blocks/pull/4911)
* Correct WooCommerce branding color

* Correct WooCommerce branding color

* Fixed lowercase colors

* Changed color in more files
2021-10-15 15:27:59 +01:00
Albert Juhé Lluveras c5bf549d9f Add Mini Cart block tests (https://github.com/woocommerce/woocommerce-blocks/pull/4938) 2021-10-15 12:53:44 +02:00
Mike Jolley 901a78979e Fix positioning of default locked blocks in the editor and frontend (https://github.com/woocommerce/woocommerce-blocks/pull/4937)
* Update default empty template on server side

* template->registeredBlocks wording

* useForcedLayout: insert in correct place

* Remove test div

* Clarify inline docs

* Apply changes to cart block
2021-10-15 10:48:57 +01:00
Raluca Stan 05dc130d21 Register as experimental the Cart i2 blocks and update the feature flag documentation (https://github.com/woocommerce/woocommerce-blocks/pull/4936)
* Use registerExperimentalBlockType for registering Cart i2 related blocks

* Update feature flags and experimental interfaces doc
2021-10-14 13:44:46 +01:00
Mike Jolley 749c0d2dfc Remove duplicate data attributes (https://github.com/woocommerce/woocommerce-blocks/pull/4941)
* Remove inject_html_data_attributes

* Exclude class/align attributes from injection
2021-10-14 13:36:03 +01:00
Ovidiu Liuta eb0ddbe29a Add a label to the textarea from the editor view of the Product search block (https://github.com/woocommerce/woocommerce-blocks/pull/4905)
* woocommerce/woocommerce-blocks#1682 fixing product search accesibility label

* fix duplicate text annoncement

* removing aria-hidden from label
2021-10-14 11:27:05 +01:00
Niels Lange 63b7766586 Increase error message spacing (https://github.com/woocommerce/woocommerce-blocks/pull/4896) 2021-10-14 12:05:13 +07:00