Commit Graph

3384 Commits

Author SHA1 Message Date
Tom Cafferkey cf9c82e02e Allow LegacyTemplate block to be reinserted, only on WooCommerce block templates. (https://github.com/woocommerce/woocommerce-blocks/pull/5545)
* Set attribute of legacy template block when block is inserted

* Allow inserter on Woo templates only

* Allow correct legacy block straight from the inserter

* Use WP Data store outside component to register block

* Pass in all attribute data when registering block

* Accommodate templates targetted at specific products or taxonomies

* Replace beginsWith with startsWith

* Replace test data with production data

* Conditionally use stores selector if it exists

* Unsubscribe if the store does not exist

Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2022-01-17 10:50:57 +00:00
Mike Jolley 37bf7a8067 When processing payments, use the woocommerce_hold_stock_minutes option (https://github.com/woocommerce/woocommerce-blocks/pull/5546) 2022-01-17 10:42:27 +01:00
Luigi Teschio 2a2aee49df Stock Indicator block: Add support for global style (https://github.com/woocommerce/woocommerce-blocks/pull/5525)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* Stock indicator block: add support for global style woocommerce/woocommerce-blocks#4965

Stock indicator block: add support for global style

* fix import after merge
2022-01-17 10:11:26 +01:00
Luigi Teschio dfa98dcb5e Price Filter block: enable global style woocommerce/woocommerce-blocks#4965 (https://github.com/woocommerce/woocommerce-blocks/pull/5559)
Price Filter block: enable global style woocommerce/woocommerce-blocks#4965
2022-01-17 10:10:26 +01:00
Niels Lange 599e395dc1 Fix inconsistent HTML of rating section (https://github.com/woocommerce/woocommerce-blocks/pull/5552) 2022-01-14 18:32:28 +07:00
Thomas Roberts c950f29400 Remove extra padding for cart sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/5430)
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-01-13 17:10:18 +00:00
Raluca Stan b1bef86632 Fix Using / for division is deprecated warnings seen when building the project (https://github.com/woocommerce/woocommerce-blocks/pull/5556) 2022-01-13 15:01:36 +01:00
Tung Du 61afd2b6ce Fix: fatal error when page contains edited template or template part (https://github.com/woocommerce/woocommerce-blocks/pull/5558) 2022-01-13 17:52:42 +07:00
Alex Florisca a8d979c47b Default all product images to "cropped" and actual image width (https://github.com/woocommerce/woocommerce-blocks/pull/5551)
* Default imageSizing for the all products block to 'cropped'

* set max-width:100%, width: auto on product grid images
2022-01-12 17:50:48 +00:00
Luigi Teschio d2ef7143d9 Summary Product block: Add support for global style (https://github.com/woocommerce/woocommerce-blocks/pull/5524)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

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

Summary Product block: add support for global style

* add color global style under feature flag

* fix import after merge

* fix typo
2022-01-12 16:31:25 +01:00
Luigi Teschio 9ad060b352 Product Title block: add support global style (https://github.com/woocommerce/woocommerce-blocks/pull/5515)
* 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

* fix global style title color (https://github.com/woocommerce/woocommerce-blocks/pull/5548)

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-01-12 14:33:46 +01:00
dependabot[bot] 56c68265b6 Bump postcss from 8.2.10 to 8.2.13 (https://github.com/woocommerce/woocommerce-blocks/pull/5543)
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.10 to 8.2.13.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.2.10...8.2.13)

---
updated-dependencies:
- dependency-name: postcss
  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-01-12 13:11:30 +00:00
renovate[bot] a6e199b222 Update dependency @babel/cli to v7.16.8 (https://github.com/woocommerce/woocommerce-blocks/pull/5550)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-12 03:27:51 +00:00
renovate[bot] 6f04bac4e0 Update Node.js to v16.13.2 (https://github.com/woocommerce/woocommerce-blocks/pull/5549)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-12 03:25:53 +00:00
Mike Jolley d47c82ed61 remove prepare statement (https://github.com/woocommerce/woocommerce-blocks/pull/5471) 2022-01-11 15:36:43 +00:00
Luigi Teschio cba17c2ef9 Mini Cart block: re-enable background support woocommerce/woocommerce-blocks#4965 (https://github.com/woocommerce/woocommerce-blocks/pull/5539)
Mini Cart block: re-enable background support woocommerce/woocommerce-blocks#4965
2022-01-11 15:08:16 +01:00
Mike Jolley a5bd8f0564 Fix All Products Block Tests due to incorrect Stock Filter addition (https://github.com/woocommerce/woocommerce-blocks/pull/5541)
* Remove stock filter from all products block

* Add missing stock filter to product-category block
2022-01-11 11:25:05 +00:00
Mike Jolley a1695861f2 Add minimum quantity, maximum quantity, and step (multiple_of) to the Cart Block and Store API (https://github.com/woocommerce/woocommerce-blocks/pull/5406)
* add min and step to Store API

* add min and step support

* typo

* Update assets/js/base/components/quantity-selector/index.tsx

* Update assets/js/base/components/quantity-selector/index.tsx

* Fix debounce callback

* Style qty input to show steps

* Implement quantity_limits in API

* Quantity validation

* Update product API

* Normalize on + -

* Separate add to cart events from cart item events in regards to limits

* Prevent qty change for editable line items

* Unify filters

* Remove step number indicator from buttons ¯\_(ツ)_/¯

* Normalize on mount

* Update docs

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2022-01-11 11:09:59 +00:00
Raluca Stan 33e3d9179a Update patch-initial-checklist.md (https://github.com/woocommerce/woocommerce-blocks/pull/5538)
Update the patch release checklist to include the email confirmation step
2022-01-11 11:58:51 +01:00
Mike Jolley e19abbc0c2 Remove Built-in Stripe Integration in favour of Stripe Extension (https://github.com/woocommerce/woocommerce-blocks/pull/5449)
* Remove Stripe from PHP side

* Remove stripe from client

* fix const name in tests

* Update docs
2022-01-11 10:53:38 +00:00
Raluca Stan 7073e3bb5f Update release-initial-checklist.md (https://github.com/woocommerce/woocommerce-blocks/pull/5537)
Add information about the the confirmation email step for the release
2022-01-11 10:28:26 +00:00
Thomas Roberts df6e27e22f Add margin below shipping packages in checkout (https://github.com/woocommerce/woocommerce-blocks/pull/5529)
* Add margin below shipping packages in checkout

* Add margin below shipping packages in checkout but not in cart
2022-01-11 10:27:37 +00:00
jonny-bull 87cb033cbd Add stock level filter to product blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4943) 2022-01-10 13:39:24 +00:00
Tung Du 14c1017feb Mini Cart Contents block improvements (https://github.com/woocommerce/woocommerce-blocks/pull/5446) 2022-01-08 08:19:01 +07:00
Tung Du 4b159f0fcd Allow inserting blocks to filled mini cart (https://github.com/woocommerce/woocommerce-blocks/pull/5527) 2022-01-08 07:51:20 +07:00
Raluca Stan a574e12863 Add back 6.8.0-dev version after 6.7.1 patch 2022-01-07 18:13:49 +01:00
Raluca Stan 9759ccbf0a Merge branch 'release/6.7.0' with 6.7.1 details into trunk 2022-01-07 18:11:25 +01:00
github-actions[bot] b60afb534b Release: 6.7.1 (https://github.com/woocommerce/woocommerce-blocks/pull/5536)
* Force a string token property for the activePaymentMethod

* Empty commit for release pull request

* Update readme.txt with 6.7.1 info

* Add testing notes for 6.7.1

* Bumping version strings to new version.

Co-authored-by: Raluca Stan <ralucastn@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
2022-01-07 18:00:35 +01:00
Raluca Stan fc01458670 Update release initial checklist template (https://github.com/woocommerce/woocommerce-blocks/pull/5526)
* Update release initial checklist template

This PR includes more information about updating the Woo Blocks version in the WooCommerce repository:
- it updates the PR used as an example
- it updates the url for the composer.json file in WC repo
- it add info about how to update the composer.json and lock files

* Update .github/release-initial-checklist.md
2022-01-07 17:46:25 +01:00
Raluca Stan 5c232fa7a1 Force a string token property for the activePaymentMethod (https://github.com/woocommerce/woocommerce-blocks/pull/5535) 2022-01-07 14:41:25 +01:00
Albert Juhé Lluveras ea64dadb16 Update PR assignment automation to match new Team Kirigami name (https://github.com/woocommerce/woocommerce-blocks/pull/5534) 2022-01-07 13:40:41 +01:00
Tom Cafferkey 8bee57378b Query legacy and correct plugin slug for WooCommerce block templates (https://github.com/woocommerce/woocommerce-blocks/pull/5519) 2022-01-07 10:17:08 +00:00
Luigi Teschio c54440d0e1 Add wide and full alignment support for legacy template block (https://github.com/woocommerce/woocommerce-blocks/pull/5433)
* add align wide and full support for legacy template block

* fix PHP warning

* add a comment on get_markup_with_classes_by_attributes

* rename function

* add align wide and full support for legacy template block

* fix PHP warning

* add a comment on get_markup_with_classes_by_attributes

* rename function

* fix regex

* update regex

* update regex

* fix code styling
2022-01-07 10:47:48 +01:00
Luigi Teschio 340669bb90 Filter Products By Price block: don't allow to insert negative values on inputs (https://github.com/woocommerce/woocommerce-blocks/pull/5123)
* Don't allow to insert negative values on input for Filter Products By Price block woocommerce/woocommerce-blocks#2695

Don't allow to insert negative values on input for Filter Products By Price block

* renaming util functions and add comments
2022-01-06 15:30:34 +01:00
Luigi Teschio 549e10fabb Mini Cart Block: The color of the badge reflects the global style (https://github.com/woocommerce/woocommerce-blocks/pull/5477)
* Mini Cart Block: the color of the badge reflects the global style woocommerce/woocommerce-blocks#4965

Mini Cart Block: the color of the badge reflects the global style woocommerce/woocommerce-blocks#4965

* disable background
2022-01-06 09:47:34 +01:00
Lucio Giannotta 168984edc2 Move Woo Blocks template directories to latest Gutenberg convention (https://github.com/woocommerce/woocommerce-blocks/pull/5464)
* Align Woo Block template locations with the newest convention

While we now support both the old and new conventions for the templates
paths, our own repo should be aligned with the latest convention.

See: woocommerce/woocommerce-blocks#5455
Fixes: woocommerce/woocommerce-blocks#5343

* Simplify `generate_template_slug_from_path` function
* Change `BlockTemplatesController` constructor to get correct dir names
* Update Mini Cart template path
2022-01-05 19:28:51 +01:00
Lucio Giannotta 78a25b235f Legacy Template: Add warning about block removal (https://github.com/woocommerce/woocommerce-blocks/pull/5208)
Legacy blocks were previous locked for removal to avoid unintended
consequences. However, this would lock the ability to move the block within
other e.g. layout blocks and unnecessarily limit merchant customization ability.

Now that we have reverted this decision, merchants could delete this block,
which is likely **not** what they want to do. While we investigate other, more
long-term, solutions, we are adding a warning notice.

Refs woocommerce/woocommerce-blocks#5180. Fixes woocommerce/woocommerce-blocks#5207.

* Rename legacy blocks to avoid confusion with the term “Template”
2022-01-05 19:18:23 +01:00
Luigi Teschio 64696e06df Mini Cart Contents: Fix missing custom background (https://github.com/woocommerce/woocommerce-blocks/pull/5448)
* fix missing custom background mini cart contents

* fix naming
2022-01-05 13:53:12 +01:00
renovate[bot] d5af28a16f Update dependency eslint-plugin-import to v2.25.4 (https://github.com/woocommerce/woocommerce-blocks/pull/5518)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-05 04:08:56 +00:00
renovate[bot] a888ec33a2 Update babel monorepo to v7.16.7 (https://github.com/woocommerce/woocommerce-blocks/pull/5517)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-05 04:06:56 +00:00
Mike Jolley 7f2af8c1a6 Validate available payment methods before attempting payment or updating order statuses (https://github.com/woocommerce/woocommerce-blocks/pull/5440)
* Make payment method required

* removed unused imports

* Remove PUT method

* Validate available method when updating order

* Enable bacs for tests
2022-01-04 18:04:08 +00:00
Malith Senaweera 65835d3689 Fix duplicated error notices (https://github.com/woocommerce/woocommerce-blocks/pull/5476)
* Fix duplicated error notices

StoreNoticeProvider is already being used within Block component. This
removal prevents duplicated error notices within the Payment Options
section

* Move StoreNoticeProvider from payment block

Remove StoreNoticeProvider from payment block and move it to the parent
frontend block to avoid unnecessarily loading the notice provider
2022-01-04 17:37:46 +00:00
Mike Jolley 7cb46eb092 Prevent duplicate hooks in hook docs (https://github.com/woocommerce/woocommerce-blocks/pull/5472)
* Update wp-hooks-generator

* Update inline hook documentation into consistent format

1. Hook docs for the same hook should be identical
2. Prefix with `Hook: ` so the case of the hook is not changed.
3. Use `@see` instead of `@hooked`. Hooked is not a standard PHP Doc tag.

cc @Aljullu

* Update hook doc script to support duplicate hooks across files

* Remove unused variables in function

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2022-01-04 14:12:08 +00:00
Raluca Stan 3fd22f385d Update 6.8.0-dev tag 2022-01-04 12:33:01 +01:00
github-actions[bot] afcd224e73 Release: 6.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5478)
* Empty commit for release pull request

* Update readme.txt with 6.7.0 changelog

* Add testing notes for the 6.7.0 release

* Fix typo in testing notes

* Update Testing Notes

* Remove item from testing notes for 6.7.0

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
2022-01-04 12:23:10 +01:00
Raluca Stan a07146f501 Bumping version strings to new version. 2022-01-04 11:47:59 +01:00
Raluca Stan f1e7c7d706 Remove item from testing notes for 6.7.0 2022-01-04 10:07:44 +01:00
Raluca Stan 695fb19f62 Update Testing Notes 2022-01-03 17:52:36 +01:00
Raluca Stan 70f8bc9500 Fix typo in testing notes 2022-01-03 15:59:35 +01:00
Raluca Stan 5c0f3bfd33 Add testing notes for the 6.7.0 release 2022-01-03 15:58:09 +01:00
Raluca Stan 2ad7fdd313 Update readme.txt with 6.7.0 changelog 2022-01-03 14:30:11 +01:00
Luigi Teschio 723eabee80 Add global style for Active Filters block (https://github.com/woocommerce/woocommerce-blocks/pull/5465)
* Enable global style for active filters block

* show blacklisted blocks in full site editing side

* fix test

* --amend

* fix check
2022-01-03 10:41:19 +01:00
Mike Jolley 0e53cea85c Fix initial population of address data in `useCustomerData` hook (https://github.com/woocommerce/woocommerce-blocks/pull/5473)
* Re-init customer data once cart has loaded

* Tweak typedef

* Track changes without capturing blank initial state in useCheckoutAddress
2021-12-31 16:10:43 +01:00
Raluca Stan 6eb3f9e17a Account for products without variations in the On Sale Products block (https://github.com/woocommerce/woocommerce-blocks/pull/5470)
* Account for products without variations in the prime_product_variations function

* Update src/BlockTypes/AbstractProductGrid.php

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

* Fix whitespace

* Remove unnecessary variable declaration

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-12-30 14:53:56 +01:00
Thomas Roberts a8e094473c Revert "Remove extra padding for cart sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/5247)" (https://github.com/woocommerce/woocommerce-blocks/pull/5429)
This reverts commit a60cd66692.
2021-12-30 12:24:18 +00:00
Niels Lange 17a0325b72 Correct name of lazy loaded translation file (https://github.com/woocommerce/woocommerce-blocks/pull/5453) 2021-12-30 12:23:02 +00:00
renovate[bot] 088be50f3c Update dependency jest-environment-puppeteer to v6.0.3 (https://github.com/woocommerce/woocommerce-blocks/pull/5469)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-29 04:07:31 +00:00
renovate[bot] c8ca9deea3 Update dependency @types/lodash to v4.14.178 (https://github.com/woocommerce/woocommerce-blocks/pull/5468)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-29 04:05:36 +00:00
renovate[bot] cabfd59023 Update dependency @types/jquery to v3.5.11 (https://github.com/woocommerce/woocommerce-blocks/pull/5467)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-29 02:52:05 +00:00
renovate[bot] a08553899c Pin dependency expect-puppeteer to 6.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/5466)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-29 02:41:54 +00:00
Lucio Giannotta 0367117d15 Move block templates and parts directories to the Gutenberg 12.1.0 convention (https://github.com/woocommerce/woocommerce-blocks/pull/5455)
Gutenberg 12.1.0 has changed the convention for the directory paths from
`block-templates` and `block-template-parts` to `templates` and `parts` respectively.

Allow compatibility with themes which follow both conventions and also make sure that
we remain backwards-compatible.

Fixes woocommerce/woocommerce-blocks#5450

Some of this fix has a dependency on WooCore

See: WooCommerce/woocommercewoocommerce/woocommerce-blocks#31522
2021-12-28 23:32:15 +01:00
Lucio Giannotta 4d616d7a76 Fix custom templates with fallback being incorrectly attributed (https://github.com/woocommerce/woocommerce-blocks/pull/5447)
* Fix custom templates with fallback being incorrectly attributed

Category and tags templates can fallback to the generic archive if, e.g., the theme
provides one for the latter but not for the former. However, since Gutenberg is not
aware of this fallback mechanism, it would incorrectly attribute the custom template
to the user instead of the theme.

Here we are explicitly setting the `has_theme_file` to make sure Gutenberg knows
we do, in fact, have a theme fail (if not what it expects).

Also skip the loop if template is duplicate but has no fallback

Fixes woocommerce/woocommerce-blocks#5441
2021-12-24 16:15:19 +01:00
Thomas Roberts 5036c69638 Add E2E tests for Filter blocks (Price, Attribute, and Active Filters) (https://github.com/woocommerce/woocommerce-blocks/pull/4562)
* Add clear and fill input test util

* Add tests for Filter Products by Price

* Add class name to filter products by price block in editor

* Update wp-env

* Fix formatting

* Update lock

* Revert "Update lock"

This reverts commit f4e809e000430eea3972c94fd2aea0a19ba6961b.

* Create product attributes during setup

* Remove product attributes during teardown

* Add attributes in fixture-data

* Add two new products, for attribute testing

* Load attributes into store and apply them to products

* Add class to Filter by Attribute when editing

This is so it can be targeted in E2E tests more easily.

* Add tests for Filter Product by Attribute

* Fix formatting in attribute-filter.test.js

* Add tests for active filters block

* Add doc block for ensuteCleanAttributes

* Update wording of title test in all filter block E2E

* Update test wording to read better

* Update snapshots

* Use pptr-testing-library selectors to click elements

This makes the tests easier to reason with, and lets us take a step back from the implementation details (classnames etc.)

* Add saveOrPublish test util

* Use pptr-testing-library selectors to click elements in attribute filter

* Use pptr-testing-library selectors to click elements in price filter

* Add `puppeteer-testing-library`

* Use puppeteer-testing-library API to look for H6 button

* Use correct argument in jest-puppeteer.dev.config

* Update package.json & package-lock.json

* remove tests for 5.3

* remove snapshots

* Remove ensureCleanAttributes

* Remove puppeteer-testing-library, install missing expect-puppeteer package and update tests

The puppeteer-testing-library, although added by gutenberg is not actively used.
I have removed it and realised that the added functionality can be easily replaced by expect-puppeteer.
This is a package that we specify in the jest configuration but it was not part of our package.json.
The selectors from puppeteer-testing-library have been replaced with .toClick and the utility clearAndFillInput with .toFill

The Filter by Attribute block has been skiped until tests are fixed.

* Add back setupPageSettings to jest setup

* Fix filter by attribute block test

* Fix linting error

Co-authored-by: Raluca Stan <ralucastn@gmail.com>
2021-12-23 17:26:10 +01:00
Lucio Giannotta ba9c602006 Remove “Page” suffix from template titles (https://github.com/woocommerce/woocommerce-blocks/pull/5434) 2021-12-23 17:20:52 +01:00
Thomas Roberts 20cac18474 Don't show shipping price when no options are available (https://github.com/woocommerce/woocommerce-blocks/pull/5444)
* Add isCheckout prop to NoShippingPlaceholder and TotalsShipping

* Pass isCheckout to TotalsShipping in Checkout sidebar

* Show the NoShippingPlaceholder if no rates are found

* Show better error message when no shipping is available in checkout
2021-12-23 13:24:08 +00:00
Tung Du b2eecf3bb0 Fix: Mini Cart: Default content for empty state (https://github.com/woocommerce/woocommerce-blocks/pull/5421) 2021-12-22 18:03:58 +07:00
Niels Lange 9a1cd85779 Remove text decorations from product filter (https://github.com/woocommerce/woocommerce-blocks/pull/5384) 2021-12-22 15:33:37 +07:00
renovate[bot] 047abeab84 Update dependency eslint-plugin-import to v2.25.3 (https://github.com/woocommerce/woocommerce-blocks/pull/5438)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-22 04:15:47 +00:00
renovate[bot] ba3c7e6132 Update babel monorepo to v7.16.5 (https://github.com/woocommerce/woocommerce-blocks/pull/5437)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-22 04:13:35 +00:00
renovate[bot] 2ee9c73c94 Update Node.js to v16.13.1 (https://github.com/woocommerce/woocommerce-blocks/pull/5436)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-22 02:57:41 +00:00
renovate[bot] 4f4ef36510 Pin dependency snakecase-keys to 5.1.2 (https://github.com/woocommerce/woocommerce-blocks/pull/5435)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-22 02:48:41 +00:00
Lucio Giannotta 35adae3fa4 Add Storybook documentation and remove deprecated knobs (https://github.com/woocommerce/woocommerce-blocks/pull/5407)
* Remove Storybook knobs

They are now fully replaced by controls

* Update Storybook to 6.4.9
* Add Storybook documentation and VSCode snippets
* Add VSCode snippets
* Convert stories from checkout packages and include them in Storybook
2021-12-21 18:08:57 +01:00
Tom Cafferkey 5730574fde Update testing instructions for missing PRs in 6.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5431) 2021-12-21 16:09:12 +00:00
Mike Jolley c1ca93aa0a 6.7.0-dev 2021-12-21 13:59:01 +00:00
github-actions[bot] 5d807a52e1 Release: 6.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5422)
* Empty commit for release pull request

* Add changelog and version info

* 6.6.0 testing notes

* Remove mini cart from testing instructions

* Clarify testing instructions

* Remove experimental feature from changelog

* fix not found template for the template editor

* update zip

* Remove test instructions for icon

* Testing steps for 5425

* Link order controller to cart routes

* Remove order controller from checkout route

* Fix PHP warnings in abstract schema

* Fix PHP warnings in abstract route

* Update shipping phone handling

* Includes are handled in core now

* Remove maybe_update_order_from_customer

* Add cart_updated routine to all cart routes

* Remove abstract method

* Remove test for woocommerce_blocks_cart_update_order_from_customer_request

* Remove do_order_callback

* Update readme

* Update tests

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Luigi <gigitux@gmail.com>
2021-12-21 13:57:01 +00:00
Alex Florisca a60cd66692 Remove extra padding for cart sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/5247) 2021-12-21 13:46:49 +00:00
Mike Jolley ecc80e5cff Sync order data with cart data when cart is updated from any route (https://github.com/woocommerce/woocommerce-blocks/pull/5379)
* Link order controller to cart routes

* Remove order controller from checkout route

* Fix PHP warnings in abstract schema

* Fix PHP warnings in abstract route

* Update shipping phone handling

* Includes are handled in core now

* Remove maybe_update_order_from_customer

* Add cart_updated routine to all cart routes

* Remove abstract method

* Remove test for woocommerce_blocks_cart_update_order_from_customer_request

* Remove do_order_callback
2021-12-21 13:11:51 +00:00
Luigi Teschio 14a45a4380 fix not found template for the template editor (https://github.com/woocommerce/woocommerce-blocks/pull/5425) 2021-12-21 11:55:51 +01:00
Tom Cafferkey 13d151fe2a Check for woocommerce as the theme before rendering with a more user friendly plugin name (https://github.com/woocommerce/woocommerce-blocks/pull/5420) 2021-12-20 14:36:26 +00:00
Tom Cafferkey d8dac8bb0a Check if the current theme has a product-archive block template in the absence of a product taxonomy block template. (https://github.com/woocommerce/woocommerce-blocks/pull/5380)
* Add archive-product template into block template hieachy

* Add archive-product condition to product tag block template render method

* Move taxonomy hierarchy filter to WC core

* Undo template amends

* Duplicate the themes archive-product template if it has one for taxonomy block templates

* Review feedback

* Use TextDomain instead of Name

* use correct if/else syntax

* Remove unncessary boolean syntax
2021-12-20 12:53:57 +00:00
Mike Jolley 469223fa54 Remove validateOnMount in favour of validation on state change (https://github.com/woocommerce/woocommerce-blocks/pull/5381)
* Remove validateOnMount in favour of validation on state change.

* Use useEffect

* test
2021-12-20 12:16:41 +00:00
Niels Lange ee45d9d9cf Remove full-width mode from cart and checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/5315) 2021-12-20 11:27:51 +00:00
Albert Juhé Lluveras 976b158e6f Make it so WooCommerce template names are not editable (https://github.com/woocommerce/woocommerce-blocks/pull/5385)
* Make it so WooCommerce template names is not editable

* Remove source='plugin' from templates
2021-12-20 10:46:41 +00:00
Albert Juhé Lluveras ab061782f2 Fix saving WooCommerce templates in WP 5.9 beta 3 (https://github.com/woocommerce/woocommerce-blocks/pull/5408) 2021-12-20 10:58:11 +01:00
Tung Du 50066455c0 Fix: Mini Cart block: divide contents into three inner blocks (https://github.com/woocommerce/woocommerce-blocks/pull/5386)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-12-20 14:57:55 +07:00
Luigi Teschio 4524799b5e Revert theme name woocommerce/woocommerce-blocks#5411 (https://github.com/woocommerce/woocommerce-blocks/pull/5412)
Revert theme name woocommerce/woocommerce-blocks#5411
2021-12-17 16:58:56 +01:00
Tom Cafferkey 5a7adba1bd Update 640.md 2021-12-17 10:47:16 +00:00
Mike Jolley 7d8c184603 Remove the unused get_skeleton_inline_script method (https://github.com/woocommerce/woocommerce-blocks/pull/5361) 2021-12-16 17:32:35 +00:00
Albert Juhé Lluveras bffbc491a8 Add correct class to Legacy Template block icon (https://github.com/woocommerce/woocommerce-blocks/pull/5400) 2021-12-16 13:29:55 +01:00
Alex Florisca d05a43dadb Update to node 16/npm 8 (https://github.com/woocommerce/woocommerce-blocks/pull/5222)
* Update to node 16/npmm 8

* package-lock.json from trunk

* package-lock.json v2

* Revert "package-lock.json v2"

This reverts commit 9d11533da840471aed815d131f54a87d237658c7.

* Package-lock.json v2, take 2

* eslint-plugin requires npm 8
2021-12-16 11:19:30 +00:00
Alex Florisca 6624d898e8 ignore eslint-plugin-woocommerce build files (https://github.com/woocommerce/woocommerce-blocks/pull/5340) 2021-12-16 10:35:25 +00:00
Alex Florisca e61eb3b0a4 Fix extra network request on cart (https://github.com/woocommerce/woocommerce-blocks/pull/5394) 2021-12-16 10:30:23 +00:00
M. L. Giannotta 1db7ede31e Migrate storybook entries of ProductPrice component (https://github.com/woocommerce/woocommerce-blocks/pull/5371)
Closes woocommerce/woocommerce-blocks#5368
2021-12-15 19:07:49 +01:00
M. L. Giannotta 5524c0aa91 Storybook and TS migration of `PriceSlider` component (https://github.com/woocommerce/woocommerce-blocks/pull/5253) (https://github.com/woocommerce/woocommerce-blocks/pull/5293)
* Add full documentation to the component props in Storybook
* Fix `FormattedMonetaryAmount` TypeScript errors

Since this component is passing on props to `NumberFormat`,
it needs to extend all of its original props, except for `onValueChange`
which we wrap in order to accept only `number`s.

* Convert `constrainRangeSliderValues` to TypeScript
* Add docs to `Currency` types
* Convert `PriceSlider` to TypeScript

*Note:* All TypeScript errors were fixed during the conversion,
except for the IE workaround which wasn't clear to me at this time.
Opened an issue: woocommerce/woocommerce-blocks#5276

* Fix Price Slider story (https://github.com/woocommerce/woocommerce-blocks/pull/5253)
* Migrate stories for `ProductName` to latest Storybook

Also add props documentation and add named export.
2021-12-15 17:54:49 +01:00
M. L. Giannotta 703051b1bc Storybook and TS migration of some cart checkout components (https://github.com/woocommerce/woocommerce-blocks/pull/5324)
* Migrate stories for `ProductName` to latest Storybook. Also add props
documentation and add named export.
* Migrate `TotalsFooterItem` to TypeScript and latest Storybook
* Add a `LooselyMustHave` utility type.
* Export `allSettings` so that they can be manipulated in stories and tests

* Implement a way to easily define and reuse Storybook controls

Implement a currency control for a common use-case of selecting currencies.
It currently implements EUR and USD as they have different properties.

* Migrate `TotalsDiscount` to TypeScript and implement stories
* Migrate `TotalsCoupon` to TypeScript and fix stories
* Change Coupon name within Storybook
* Nicer handling of removal of a coupon from Storybook

It now dynamically calculates the discount from the actual coupons.
2021-12-15 17:30:17 +01:00
M. L. Giannotta 91c2ca2143 Migrate storybook entries of QuantitySelector component (https://github.com/woocommerce/woocommerce-blocks/pull/5370)
* Add experimental Emotion11 compatibility

Revert the changes introduced in woocommerce/woocommerce-blocks#5354. The team over at Storybook
has recently implemented a workaround to enable Emotion11 compatibility
in 6.x releases.

See: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#emotion11-quasi-compatibility

* Add `QuantitySelector` property docs and migrate stories

*Note:* Because of a Storybook bug, the number input on the control panel of the
story, is not going to get updated by the component.

See: https://github.com/storybookjs/storybook/issues/15924
2021-12-15 17:03:02 +01:00
Albert Juhé Lluveras 8030e278db Set the origin of custom templates to 'plugin' and fix plugin name on REST requests (https://github.com/woocommerce/woocommerce-blocks/pull/5375)
* Set the origin of custom WC templates to 'plugin'

* Fix plugin name
2021-12-15 11:56:41 +01:00
renovate[bot] 0b6686910f Update dependency eslint-import-resolver-typescript to v2.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5383)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-15 05:04:26 +00:00
renovate[bot] 6d487fd242 Update wordpress monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/5382)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-15 03:18:45 +00:00
Mike Jolley c5e07b8dd2 Move class removal to render callback (https://github.com/woocommerce/woocommerce-blocks/pull/5364) 2021-12-14 10:39:14 +00:00
Tung Du b0623a8b52 Mini Cart: only display the editing link to users with site editing permission (https://github.com/woocommerce/woocommerce-blocks/pull/5372) 2021-12-14 07:54:23 +07:00
Tung Du 0350268b82 Switch to correct view if inner block is selected (https://github.com/woocommerce/woocommerce-blocks/pull/5358) 2021-12-14 07:46:10 +07:00
Mike Jolley 3fc597775c Trigger validation on change (https://github.com/woocommerce/woocommerce-blocks/pull/5373) 2021-12-13 16:44:28 +00:00
Mike Jolley 226780107a Add error message for fetch errors on checkout (https://github.com/woocommerce/woocommerce-blocks/pull/5341)
* Add error message for fetch errors on checkout

* Update message text

* revert gitignore change

* Remove errorNotice variable
2021-12-13 15:31:49 +00:00
Mike Jolley 661896ce9e Loading animation (https://github.com/woocommerce/woocommerce-blocks/pull/5362) 2021-12-13 13:57:59 +00:00
Mike Jolley 59c8c88438 Introduce 2 new hooks in Customer Update Route (https://github.com/woocommerce/woocommerce-blocks/pull/5345)
* Introduce woocommerce_blocks_cart_update_customer_from_request hook

* Introduce woocommerce_blocks_cart_update_order_from_customer_request

* Test actions fire

* Update hook docs
2021-12-13 13:57:45 +00:00
Albert Juhé Lluveras 6e2b5ebb8a Downgrade @wordpress/scripts to 17.1.0 to fix dependency mistmach issue (https://github.com/woocommerce/woocommerce-blocks/pull/5349)
* Downgrade @wordpress/scripts to 17.1.0 to fix dependency mistmach issue

* Update package-lock.json
2021-12-10 17:44:03 +01:00
M. L. Giannotta 1c837c0de7 Fix conflict between Storybook and `@emotion/styled@11.x` (https://github.com/woocommerce/woocommerce-blocks/pull/5354)
Resolve the alias for `@emotion/styled` to the root of the module in Storybook
WebPack config.

Fixes woocommerce/woocommerce-blocks#5353
2021-12-10 17:08:23 +01:00
Seghir Nadir 772ee23faa Update item quantity if server result is different from client (https://github.com/woocommerce/woocommerce-blocks/pull/5352)
* respect when quantity changes from up

* add test
2021-12-10 16:26:57 +01:00
Mike Jolley 70106d45d3 Revise checkout payment statuses to avoid data loss on error (https://github.com/woocommerce/woocommerce-blocks/pull/5350)
* Clarify docs for STARTED

* Clarify docs for setActivePaymentMethod

* Remove useActivePaymentMethod hook (this held state for active methods and tokens)

* Update type defs

* Enhance setActivePaymentMethod action to accept method data

* SET_ACTIVE_PAYMENT_METHOD action

* Add setActivePaymentMethod dispatcher and make "started" status only

* Update setActivePaymentMethod usage in express methods

* Set radio control defaults

* Consolodate tokens and methods

* Update assets/js/base/context/providers/cart-checkout/payment-methods/reducer.ts

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

* Spacing

* Split saved cards tests from regular, since saved cards are checked by default

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2021-12-10 16:26:16 +01:00
Niels Lange 6a74887464 Limit CSS styles to WooCommerce Block icons only (https://github.com/woocommerce/woocommerce-blocks/pull/5363)
* Limit CSS styles to WooCommerce Block icons only

* Update assets/css/editor.scss

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

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-12-10 21:32:44 +07:00
Luigi Teschio 13deb1b09e Mini Cart Block: render the empty state set on template parts (https://github.com/woocommerce/woocommerce-blocks/pull/5338)
* add view switcher for mini cart contents block

* editor view switcher

* update mini cart template file

* render the empty state template parts for the Mini Cart Block woocommerce/woocommerce-blocks#4674

render the empty state template parts for the Mini Cart Block woocommerce/woocommerce-blocks#4674

* update selector

* allow empty mini cart block to add all blocks

* fix tests; improve code style

* install @wordpress/block-editor package

* fix warning on frontend side

* block-editor package is not necessary

* merge attributes object

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2021-12-10 12:11:59 +01:00
Tom Cafferkey 34ba6ab937 Load required scripts in LegacyTemplate.php render method (https://github.com/woocommerce/woocommerce-blocks/pull/5346) 2021-12-10 10:51:35 +00:00
Mike Jolley b0f9e524a3 Move Draft Order Handling to Shared Trait (DraftOrderTrait) (https://github.com/woocommerce/woocommerce-blocks/pull/5323)
* Introduce shared trait for draft order handling (DraftOrderTrait)

* Use trait where needed for maybe_release_stock

* Introduce woocommerce_blocks_cart_update_customer_from_request

This hook gets the request data and customer object, and from there, 3rd parties could grab a draft order and manually update it if needed (if the use cases requires this).

* Revert "Introduce woocommerce_blocks_cart_update_customer_from_request"

This reverts commit 6620818eb1e03b87c6eca0d757ec8b78802e3c57.
2021-12-10 10:49:04 +00:00
Albert Juhé Lluveras 29fa0a61e6 Fix Mini Cart template part link on WP 5.9 (https://github.com/woocommerce/woocommerce-blocks/pull/5348)
* Fix link to edit the Mini Cart template part in WP 5.9

* Use wp_is_block_theme() function

* Add protection against overwriting isSiteEditorAvailable setting

* Rename isSiteEditorAvailable to isBlockTheme
2021-12-10 11:23:16 +01:00
Niels Lange 865a0a5ffa Update icon of legacy template block (https://github.com/woocommerce/woocommerce-blocks/pull/5317)
* Update icon of legacy template block

* Display legacy block template color in Woo purple

* Display icons in white when block being selected within list view
2021-12-10 17:07:10 +07:00
Tung Du b3ba90e7e9 Fix: Mini Cart block: Edit template part link doesn't work for themes don't have mini cart template part. (https://github.com/woocommerce/woocommerce-blocks/pull/5347) 2021-12-09 20:58:03 +07:00
Albert Juhé Lluveras 6cbff66977 Fix reverting WC templates (https://github.com/woocommerce/woocommerce-blocks/pull/5342) 2021-12-09 10:35:32 +01:00
Mike Jolley f1b85c6bcb Removes legacy shipping_phone handling (https://github.com/woocommerce/woocommerce-blocks/pull/5326) 2021-12-08 15:05:00 +00:00
Seghir Nadir 8e62dea95d Wait until carts load before calling `canMakePayment` (https://github.com/woocommerce/woocommerce-blocks/pull/5337)
* wait till cart loads before calling canMakePayment

* fix tests
2021-12-08 13:41:31 +00:00
Alex Florisca 311a531826 Chip component stories for storybook (https://github.com/woocommerce/woocommerce-blocks/pull/5322)
* ship component stories for storybook

* Refactor RemovableChip for Storybook

* Implement lucio feedback changes

* RemovableChip is part of the Chip story
2021-12-08 12:17:49 +00:00
Tom Cafferkey 30abe6f3bc Update block theme conditionals in BlockTemplateController (https://github.com/woocommerce/woocommerce-blocks/pull/5335) 2021-12-08 11:21:57 +00:00
renovate[bot] 7822affe2e Update dependency @types/wordpress__compose to v4.0.1 (https://github.com/woocommerce/woocommerce-blocks/pull/5334)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-08 05:51:31 +00:00
renovate[bot] 5e3528a05c Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/5333)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-08 03:25:48 +00:00
Mike Jolley cfeb5558b7 Update WordPress Monorepo packages with React 17x support (https://github.com/woocommerce/woocommerce-blocks/pull/5223)
* Use npm 14

* Update WP packages

* Update non-dev wordpress dependencies

* Remove usage of @automattic/data-stores

* Moves tag, search-list-control components back into private `editor-components` to mitigate dependency conflicts with`@woocommerce/components`

* Fix tests with act()

* package-lock

* fix broken maps

* Patch 14x package

* update locks

* Revert nvmrc change

* Fix tests due to debounce

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-12-07 15:47:50 +00:00
M. L. Giannotta 77c237d6a2 Storybook migration of `CountryInput` component (https://github.com/woocommerce/woocommerce-blocks/pull/5312)
* Enable `exactOptionalPropertyTypes` in TS config

This option will create more strict types out of optional properties.
Read more: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-beta/#exact-optional-property-types

* Extract `ComboBoxProps` as own interface

This way we can export it to use it somewhere else. In this specific case,
I'll need to use it as a base to extend the `CountryInputProps`.

Also fixed some types to be optional, as the component requires.

* Fix stories and props for `CountryInput` (https://github.com/woocommerce/woocommerce-blocks/pull/5252)
2021-12-07 16:07:21 +01:00
Mike Jolley de068d2fc3 Rest API - Namespace error handling (https://github.com/woocommerce/woocommerce-blocks/pull/5319)
* get_routes_from_namespace needs to handle WP_Error responses

* is_request_to_store_api is not static
2021-12-07 15:03:58 +00:00
Tung Du 185f1d5bd9 Fix: Mini Cart block button should be disabled in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/5308) 2021-12-07 21:29:56 +07:00
Tung Du 90a54b6cf0 Mini Cart Contents block: implement view switcher in editor (https://github.com/woocommerce/woocommerce-blocks/pull/5304) 2021-12-07 21:07:53 +07:00
Mike Jolley 587e3b98d4 Add missing Exception use statement in RoutesController (https://github.com/woocommerce/woocommerce-blocks/pull/5330) 2021-12-07 13:13:48 +00:00
Mike Jolley 7fd25d4b37 Typedefs and cartData for `usePaymentMethodInterface` (https://github.com/woocommerce/woocommerce-blocks/pull/5177)
* Typedefs and cartData for the payment interface

* fix case on noticeContexts

* typeof for enums

* immutable note

* Add cartData to docs table

* Rebase docs
2021-12-07 13:02:57 +00:00
Tom Cafferkey 44aaf67caa Updated version numbers for the next release 2021-12-07 11:51:42 +00:00
github-actions[bot] 212085bbd8 Release: 6.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5321)
* Empty commit for release pull request

* Update readme.txt and add 6.5.0 testing notes

* Update build link

* Update CSV link

* Testing instruction titles.

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2021-12-07 11:47:28 +00:00
Albert Juhé Lluveras b927ca6a9f Convert renderFrontend to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/5238)
* Rename render-frontend file to tsx

* Add types to renderFrontend

* Reorder code

* Use PascalCase for types

* add generics

* fix TS error

* restore interface

Co-authored-by: Luigi <gigitux@gmail.com>
2021-12-07 11:07:32 +01:00
Tung Du 66a3ac1d33 Refactor: use StyleAttributesUtils to generate classes and styles (https://github.com/woocommerce/woocommerce-blocks/pull/5307) 2021-12-07 12:21:40 +07:00
Tung Du e3620307df Fix: Mini Cart: don't allow users to create extra template parts in the Mini Cart template part area (https://github.com/woocommerce/woocommerce-blocks/pull/5306) 2021-12-07 12:20:37 +07:00
renovate[bot] 5565b3030a Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/5313)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-07 01:23:20 +01:00
M. L. Giannotta 4651f64341 Storybook and TS migration of ReadMore component (https://github.com/woocommerce/woocommerce-blocks/pull/5300)
* Update packages to latest Storybook deps

* Migrate `ReadMore` component and its utils to TypeScript

* Add type definitions for `trim-html` package

* Migrate `ReadMore` stories to newest Storybook

Fixes woocommerce/woocommerce-blocks#5254
2021-12-06 18:00:33 +01:00
Luigi Teschio 4a134c7fb5 Set WooCommerce like source of WC templates woocommerce/woocommerce-blocks#5271 (https://github.com/woocommerce/woocommerce-blocks/pull/5320)
Set WooCommerce like source of WC templates woocommerce/woocommerce-blocks#5271
2021-12-06 15:41:00 +01:00
Albert Juhé Lluveras b7051c8cd0 Fix JS error in Filter Products by Attribute block (https://github.com/woocommerce/woocommerce-blocks/pull/5301) 2021-12-06 11:03:18 +01:00
Alex Florisca 0a8415e3a6 More ts conversions (https://github.com/woocommerce/woocommerce-blocks/pull/5263)
* WIP

* Converted block-error-boundary to TS

* Convert CheckboxList to TS

* Converted Chip and Removable Chip components to TS

* Change type to React.FC<T>

* Fix tests

* Implement Lucio feedback
2021-12-03 17:23:25 +00:00
Albert Juhé Lluveras 48a29c5bba Refactor Mini Cart contents block unmount to fix ESLint warning (https://github.com/woocommerce/woocommerce-blocks/pull/5216) 2021-12-03 11:37:15 +01:00
Luigi Teschio 2358c0c90b Mini Cart block: Add label for tax when it should be visible in accordance with WC settings (https://github.com/woocommerce/woocommerce-blocks/pull/5184)
* Mini Cart block: Add label for tax when it should be visible in accordance with WC settings woocommerce/woocommerce-blocks#4849

Mini Cart block: Add label for tax when it should be visible in accordance with WC settings

* improve the tax label handling

* fix code after conflict

* fix tax label handling when it is added the first product

* add another check for avoid PHP error

* rename variables; add test for the function getSettingWithCoercion

* add margin-right for tax-label; add test to check if type guard works correctly
2021-12-03 10:45:06 +01:00
Luigi Teschio c2ebf26c1c Enable stylelint for the entire project woocommerce/woocommerce-blocks#5262 (https://github.com/woocommerce/woocommerce-blocks/pull/5298)
Enable stylelint for the entire project
2021-12-03 10:07:51 +01:00
Alex Florisca e8b4b3467c Fix Featured Product Search not working for large stores (https://github.com/woocommerce/woocommerce-blocks/pull/5156)
* Remove the dependency from the getProducts useEffect

* using ref instead of empty dependency array for useEffect
2021-12-02 18:51:46 +00:00
M. L. Giannotta 12bb68d970 Storybook and TS migration of `Icon` component (https://github.com/woocommerce/woocommerce-blocks/pull/5291)
* Migrate icons to TypeScript

* Fix `Icons` stories (https://github.com/woocommerce/woocommerce-blocks/pull/5257)

* Enable the correct controls
* Include a base story with a default icon and all controls
* Include a second story with the filterable icons library (no controls)

Fix woocommerce/woocommerce-blocks#5257
2021-12-02 17:56:53 +01:00
M. L. Giannotta bee06b6005 Storybook and TS migration of `ErrorPlaceholder` component (https://github.com/woocommerce/woocommerce-blocks/pull/5294)
* Convert `ErrorPlaceholder` and `ErrorMessage` to TypeScript

* Add stories for `ErrorPlaceholder` and `ErrorMessage` (https://github.com/woocommerce/woocommerce-blocks/pull/5255)

Stories include:

* Default generic error
* API error
* Unknown error
* Error without possibility to retry
* Base Error atom

Where applicable, the **Retry** button will not only trigger the appropriate
action, but also simulate the loading state of the error component.

* Update references to `ErrorMessage` component to leave the file extension out

Fix woocommerce/woocommerce-blocks#5255
Refs woocommerce/woocommerce-blocks#5249
2021-12-02 17:56:03 +01:00
M. L. Giannotta 66454293c1 Fix `ExternalLinkCard` story (https://github.com/woocommerce/woocommerce-blocks/pull/5256) (https://github.com/woocommerce/woocommerce-blocks/pull/5292) 2021-12-02 17:38:39 +01:00
Tom Cafferkey d3f4223510 Refactor BlockTemplateController (https://github.com/woocommerce/woocommerce-blocks/pull/5200)
* Move template slug creation to utility method

* Move theme_has_template to BlockTemplateUtils method
2021-12-02 10:35:39 +00:00
Néstor Soriano 79722aec00 Fix code that causes PHP 8.1 deprecation in BlockTypesController (https://github.com/woocommerce/woocommerce-blocks/pull/5287) 2021-12-01 12:58:56 +00:00
M. L. Giannotta 7e9f8c822d Migrate Storybook to 6.4.0 and enable auto-detection of controls (https://github.com/woocommerce/woocommerce-blocks/pull/5249) (https://github.com/woocommerce/woocommerce-blocks/pull/5264)
* Migrate Storybook to 6.4.0 and enable auto-detection of controls (https://github.com/woocommerce/woocommerce-blocks/pull/5249)

Previously our Babel configuration conflicted with the one provided by
default by Storybook, making us unable to leverage the automatic
detection of properties from both JS and TS components to create
controls (formerly known as knobs).

Upgrading to 6.4.0 fixes a bug that makes it easier to work with
Babel configurations. Also done here:

* Removed a few deprecated addons in favor of the replacement ones
bundled within Storybook Essentials.
* Add auto-detection of certain control types depending on the property names
* Add support for TS stories

More context: https://github.com/storybookjs/storybook/issues/12292

* Use `react-docgen` only in development environments

This should reduce production bundle size dramatically. The only
problem here is that Storybook runs its `build` command with the
`NODE_ENV` set to `production`. For this reason, we change the
script to provide `BABEL_ENV` set to `development` to still make sure
the correct configuration is loaded, while trying to reduce any
side-effects on changing the whole `NODE_ENV`.
2021-12-01 12:28:27 +01:00
Luigi Teschio 1aca1eaa7c Add recommended extensions for VSCode woocommerce/woocommerce-blocks#5233 (https://github.com/woocommerce/woocommerce-blocks/pull/5237)
* Add recommended extension for vs code woocommerce/woocommerce-blocks#5233

Add recommended extension for vs code

* replace PHP extensions

* add editor config extension

* update gitignore
2021-12-01 09:50:28 +01:00
renovate[bot] 302807474a Update dependency @storybook/addon-knobs to v6.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5283)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-01 03:09:42 +00:00
renovate[bot] 3f7c17553b Update dependency jest-environment-puppeteer to v6.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/5282)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-01 03:07:03 +00:00
Luigi Teschio dfef363e15 Add global style for Product Categories List block (https://github.com/woocommerce/woocommerce-blocks/pull/5133)
* Add global style for product categories list block woocommerce/woocommerce-blocks#4965

Add global style for product categories list block

* add support for link color

* add feature flag

* fix code style and PHP warning

* update doc comment

* remove empty space

* refactor StyleAttributesUtils (https://github.com/woocommerce/woocommerce-blocks/pull/5277)

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2021-11-30 16:28:45 +01:00
renovate[bot] 2e4a303fed Update dependency json-schema to 0.4.0 [SECURITY] (https://github.com/woocommerce/woocommerce-blocks/pull/5275)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-30 10:01:52 +00:00
Luigi Teschio 67ad9e4f27 Mini Cart Block: add link to edit template part from sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/5201)
* Mini Cart Block: add link to edit template part from sidebar woocommerce/woocommerce-blocks#5186

Mini Cart Block: add link to edit template part from sidebar

* fix e2e tests
2021-11-30 10:42:07 +01:00
Alex Florisca a9fbc828c0 Product details component accepts `key` or `name` as props (https://github.com/woocommerce/woocommerce-blocks/pull/5165)
* Product details metadata now accepts  as a default prop, with  as an optional alternative

* Updated product details test snapshot

* Don't overwrite key prop

* One of key or value must be entered in ProductItemResponseData type
2021-11-30 09:39:55 +00:00
Niels Lange c9bfd5bbbd Remove obsolete files and folders from deploy zip (https://github.com/woocommerce/woocommerce-blocks/pull/5234) 2021-11-30 14:56:47 +07:00
Albert Juhé Lluveras 98d9dbdcf0 Don't run enqueue_assets on REST requests (https://github.com/woocommerce/woocommerce-blocks/pull/5260) 2021-11-29 10:45:53 +01:00
Albert Juhé Lluveras 76f2ff32d5 Create dev packages with a blocks.ini file (https://github.com/woocommerce/woocommerce-blocks/pull/5261) 2021-11-28 19:37:26 +01:00
Alex Florisca d9bf1ba94c Convert components to Typescript (https://github.com/woocommerce/woocommerce-blocks/pull/5241)
* Convert ReturnToCartButton component to TS

* Convert FormStep component to TS

* Remoe proptypes from FormStep and AddressFormn components

* Converted order-summary component to TS

* Convert product-price component to TS

* alias path to type-defs

* Fix errors

* Changes from Thomas feedback

* Change minPrice maxPrice logic to be more robust

* Changed types from inline to interface in ReturnToCartButton component

* Check for string type in order-summary-item

* add missing isString check
2021-11-26 17:03:12 +00:00
Mike Jolley c067e990b4 Introduce `<Noninteractive>` component to disable form elements non-visually (https://github.com/woocommerce/woocommerce-blocks/pull/5157)
* Noninteractive component based on Disabled

* Implement in cart/checkout

* Pass down props

* Update 'use-debounce' library

* aria disabled
2021-11-26 14:47:37 +00:00
Tom Cafferkey cbdbc6c7a1 Change source value on WooCommerce block templates to be plugin instead of woocommerce (https://github.com/woocommerce/woocommerce-blocks/pull/5215) 2021-11-26 12:40:41 +00:00
Albert Juhé Lluveras 9803b51d1f Revert "Create dev packages with a blocks.ini file"
This reverts commit cc3b77c256.
2021-11-26 12:54:45 +01:00
Albert Juhé Lluveras cc3b77c256 Create dev packages with a blocks.ini file 2021-11-26 12:51:51 +01:00
M. L. Giannotta 57fcb28720 Checkbox Control: Fix squished checkboxes when label text wraps (https://github.com/woocommerce/woocommerce-blocks/pull/5192) (https://github.com/woocommerce/woocommerce-blocks/pull/5206)
On the front-end, checkboxes with labels would look squished when the labels wrapped
on a second line. That was due to the flex container taking too much space for the label
as the checkbox minimum dimensions was set in `px` rather than `em`, making it work
differently depending on the relative font size.
2021-11-25 15:31:47 +01:00
Albert Juhé Lluveras 6e079b9a4b Add 6.3.3 testing steps 2021-11-25 13:26:12 +01:00
Albert Juhé Lluveras cd95ca5a9f Add 6.3.3 changelog 2021-11-25 13:25:48 +01:00
Tung Du 0875884304 Fix: When creating a template part for the Mini Cart area, it should be created already containing the Mini Cart Contents block (https://github.com/woocommerce/woocommerce-blocks/pull/5231)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-11-25 00:33:57 +07:00
Alex Florisca 3aa9655e8c Update folder structure doc (https://github.com/woocommerce/woocommerce-blocks/pull/5235) 2021-11-24 14:19:32 +00:00
Niels Lange 29d0cd0b64 Display decimals if intended by the merchant (https://github.com/woocommerce/woocommerce-blocks/pull/5219) 2021-11-24 20:21:40 +07:00
Raluca Stan b6b92b5908 Update payment-method-integration.md 2021-11-24 12:14:33 +01:00
renovate[bot] bb97273115 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/5209)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-24 11:36:49 +01:00
Tung Du cdddf48184 Add: Mini Cart template part area (https://github.com/woocommerce/woocommerce-blocks/pull/5221) 2021-11-24 17:36:39 +07:00
Albert Juhé Lluveras 2778e62812 Fix Mini Cart block when Gutenberg is not enabled (https://github.com/woocommerce/woocommerce-blocks/pull/5220)
* Fix Mini Cart block when Gutenberg is not enabled

* Escape Mini Cart template part

* Avoid creating $part variable

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

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2021-11-24 11:08:59 +01:00
renovate[bot] 5542abba97 Update dependency @stripe/react-stripe-js to v1.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5228)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-24 04:52:40 +00:00
renovate[bot] bb5d23a4e9 Update dependency @octokit/graphql to v4.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5227)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-24 04:49:55 +00:00
renovate[bot] 667da6ee02 Update dependency reakit to v1.3.11 (https://github.com/woocommerce/woocommerce-blocks/pull/5226)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-24 02:14:41 +00:00
renovate[bot] 8ea8d9cedf Update dependency @types/jquery to v3.5.9 (https://github.com/woocommerce/woocommerce-blocks/pull/5225)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-24 02:01:04 +00:00
Mike Jolley ed0a9a2d91 Implement `@wordpress/babel-preset-default` (drops IE11 support) (https://github.com/woocommerce/woocommerce-blocks/pull/5212)
* Implement @wordpress/babel-preset-default

* remove alraedy included libs

* remove other deps

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-11-23 14:49:35 +00:00
Albert Juhé Lluveras a9487b9ade Fix WooCommerce blog links in release checklist (https://github.com/woocommerce/woocommerce-blocks/pull/5218) 2021-11-23 15:01:18 +01:00
Albert Juhé Lluveras ddc8fcccd1 Bump version to 6.5.0-dev 2021-11-23 09:03:08 +01:00
github-actions[bot] e7bb6fef28 Release: 6.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5211)
* Empty commit for release pull request

* Add 6.4.0 changelog

* Update supported WC versions

* Add 6.4.0 testing steps

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-11-23 09:00:23 +01:00
Tung Du 1225b2680b Mini Cart block: allow left, right and center alignment (https://github.com/woocommerce/woocommerce-blocks/pull/5171) 2021-11-23 06:40:24 +07:00
Seghir Nadir d345a0004a replace synchronizeBlocksWithTemplate with createBlocksFromInnerBlocksTemplate (https://github.com/woocommerce/woocommerce-blocks/pull/5040) 2021-11-22 12:45:48 +00:00
Mike Jolley 128ef97010 Fix manual entry within Quantity Inputs (https://github.com/woocommerce/woocommerce-blocks/pull/5197)
* Use Number.isNaN to cast strings

* Avoid changing type function
2021-11-22 12:09:00 +00:00
Tom Cafferkey 91008a6492 Gate block templates feature for WC 6.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/5210) 2021-11-22 11:25:53 +00:00
M. L. Giannotta 06f635bcf7 Checkout Terms Block: Fix Terms and Conditions checkbox position in editor (https://github.com/woocommerce/woocommerce-blocks/pull/5150) (https://github.com/woocommerce/woocommerce-blocks/pull/5191)
Within the editor, the checkbox appeared aligned at the bottom of the paragraph, while
on the front-end it would appear aligned at the top. The alignment was actually correct
but a top margin was assigned to checkboxes in the backend.

Instead of removing that globally, this commit resets it for checkboxes within the checkout
block.
2021-11-22 11:12:13 +01:00
Niels Lange 62e88757ed Lazy load missing translation files (https://github.com/woocommerce/woocommerce-blocks/pull/5112)
* Lazo load missing translation files

* Lazy load cart translation files
2021-11-22 16:43:13 +07:00
Raluca Stan edbef32a6f Pass to registered payments a wrapper component to handle the loading state (https://github.com/woocommerce/woocommerce-blocks/pull/5135) 2021-11-22 10:41:54 +01:00
Mike Jolley 3b1bedd15f Checkbox Component Styling Fix (https://github.com/woocommerce/woocommerce-blocks/pull/5164)
* Wrap label in div to prevent clickable area growing too large

* Prevent pointer events on svg

* Double gap in editor
2021-11-22 09:52:43 +01:00
Tung Du 84039af8b3 Fix: use custom compatibility notice style (https://github.com/woocommerce/woocommerce-blocks/pull/5147) 2021-11-22 08:48:27 +07:00
Darren Ethier 620cf8aebc In `@woocommerce/blocks-checkout` package documentation - reference WCDEWP instead of WPDEWP (https://github.com/woocommerce/woocommerce-blocks/pull/5154)
* Reference the WooCommerce DEWP instead of WPDEWP

* Apply suggestions from code review

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

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2021-11-20 07:08:58 -05:00
Mike Jolley c2fb8751be Add support for decimal and thousand separators in the `formatPrice` function (https://github.com/woocommerce/woocommerce-blocks/pull/5188)
* Format with decimal and thousands, with tests

* Update packages/prices/utils/price.ts

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

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-11-19 12:32:37 +00:00
Thomas Roberts c35819272d Switch variables round in mustContain error (https://github.com/woocommerce/woocommerce-blocks/pull/5155)
This is because the error messaged printed to the user  was incorrect.
2021-11-19 12:31:16 +00:00
Albert Juhé Lluveras bbaa4d8798 Mini Cart as template part (https://github.com/woocommerce/woocommerce-blocks/pull/5025)
* Fix wrong event prefix in doc comment

* Make className prop in CartLineItemsTableProps optional

* Mini Cart as template part

* Remove BlockTemplatePartsController and instead use BlockTemplatesController

* Remove old code

* Clean up frontend rendering

* Update tests

* Improve if clause

* Fix wrong tests title

* Fix wrong variable name

* Make sure Mini Cart contents block is unmounted whem mini cart closes or unmounts

* Remove unnecessary waitFor

* Fix PaymentMethodDataProvider wrong children type

* TypeScript fixes

* Make comment shorter

* Remove test code

* Fix contant unmounts of Mini Cart contents block

* Fix wrong template_type passed

* Set Template part area to 'uncategorized'

* Set Template part area to the correct value

* Move template dir check outside loop
2021-11-19 12:47:48 +01:00
Seghir Nadir 65233c4e86 Move Checkout i1 -> i2 migration code to registerBlockType (https://github.com/woocommerce/woocommerce-blocks/pull/5140)
* move migration code to registerBlockType

* fix name and account for default value

* check for isset
2021-11-19 11:49:33 +01:00
Mike Jolley 947927eded Add version to doing it wrong calls (https://github.com/woocommerce/woocommerce-blocks/pull/5134) 2021-11-19 10:27:14 +01:00
Tom Cafferkey 51b61552cf Check that functions gutenberg_supports_block_templates and gutenberg_get_block_template exist before usages (https://github.com/woocommerce/woocommerce-blocks/pull/5183) 2021-11-19 08:33:53 +00:00