Commit Graph

2253 Commits

Author SHA1 Message Date
Thomas Roberts 7bd167b03d Add/GitHub status badges (https://github.com/woocommerce/woocommerce-blocks/pull/3585)
* Add status badges for linting and PHP Code quality

* Add PHP, JavaScript, and E2E Testing badge

* Reorder badges

* Remove travis badge

* Break PHP Unit tests on purpose

This is for testing the GitHub actions badges

* Revert "Break PHP Unit tests on purpose"

This reverts commit 3af4d83d151f59ca8a13d12ba48d69565e8c26c5.

* Break JS/CSS/PHP Linting

* Revert "Break JS/CSS/PHP Linting"

This reverts commit 6b105535933c36f340a364ead57bf3cbc9947dbf.

* Specify trunk branch name on badges
2021-01-05 11:51:52 +00:00
Albert Juhé Lluveras de2796ca4e Convert saved payment methods token to a string (https://github.com/woocommerce/woocommerce-blocks/pull/3627)
* Allow integers in payment_data values

* Revert "Allow integers in payment_data values"

This reverts commit b7f2ca4a5b696091afe796f47e84f584a0b27d9e.

* Enforce payment tokens to be strings
2021-01-05 10:51:23 +01:00
Thomas Roberts 9a537fdab5 Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544)
* Create end-to-end-tests.yml for E2E testing action

* Change actions to run on push instead of PR

* Install libstdc++-4.9-dev on E2E tests action

* Add correct apt repository for libstc++

* Reconfigure apt-get commands for installing libstdc++

* Remove accidental inclusion of Travis config from E2E tests action

* Install libkrb5-dev as part of e2e test action

* Run apt commands as sudo

* Install gutenberg plugin and e2e testutils

* Add environment variables to E2E tests

* Rename action and add further config for composer and wp-env

* Rename workflow

* Add jobs for WP 5.6, 5.5, and 5.4

* Fix YML indentation

* Apply 767 permissions to wp-env directory

* Run chmod as sudo

* Comment 5.6 and 5.6 with GB out to test 5.4 more easily

* Remove WP install job, since it should run on each step

* Change order of wp-env start and chmod

* Reorder commands for 5.4 job

* Try running 5.4 tests in isolation

* Reenable tests for all WP versions

* Move commands out of bash script into a series of commands

* Fix indentation on 5.5 job

* Re-enable libkrb5-dev install

* Clean wp-env before each run & upgrade wp-env to 3.0.0

* Update lock file for wp-env@3.0.0

* Reorder wp-env start and clean commands

* Reorder wp-env permissions commands

* Reorder wp-env permissions setup for all jobs

* Reorder wp-env permissions setup for 5.5 and 5.4

* Ensure correct order for env setup and flush permalinks twice

* Update jest snapshots

* Remove rewrite flush command from yml

* Remove npm build from every step and try it just at the start

* Set correct e2e build script

* Add jobs for PHP 8

* Specify PHP 8 minor version

* Run PHP 8 jobs first

* Remove PHP 8 jobs

* Add JS Unit tests job

* Remove js-unit-tests.js workflow

* Remove composer install from every step, add it to its own step

* Cache composer files

* Bust npm cache to test nodegit

* Rename npm cache

* Renove npm cache entirely

* Revert "Renove npm cache entirely"

This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e.

* Rename npm cache back to how it was

* Fix yml indentation

* Remove echo from composer cache step

* Revert back to composer example

* Add PHP Unit tests to workflow

* Add PHP Unit tests to workflow

* Rename E2E tests workflow and file

* deliberately break e2e and unit tests to test workflow 👺

* fix php test, should see e2e fail

* revert broken e2e test

* Change steps into jobs, rename workflow

* Remove Travis workflow file

* Add all necessary setup steps to each job

* Rename Setup job and remove dependency

* Add individual jobs for each E2E test environment

* Add npm install and build to setup job

* YML syntax fix

* Remove error-causing chmod

* Rename blocks.ini setup step

Fixes a typographical error.

* Get the latest stable version of WooCommerce for PHPUnit testing

* Add PHP8.0 and PHP5.6 Unit tests

* Run composer update for PHP 5.6 and PHP 8.0

* Revert "Run composer update for PHP 5.6 and PHP 8.0"

This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399.

* Revert "Add PHP8.0 and PHP5.6 Unit tests"

This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e.

Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
Albert Juhé Lluveras 1e2bc1ee72 SearchListControl styles cleanup (https://github.com/woocommerce/woocommerce-blocks/pull/3604)
* Update comment about styles that have been upstreamed

* Remove code that has been upstreamed long time ago

* Fix wrong PR number in comment
2020-12-29 17:02:09 +01:00
Mike Jolley 8763965019 Add the "Fix package lock" script (https://github.com/woocommerce/woocommerce-blocks/pull/3465)
* Add package lock script

* remove -e

* tweak error handling

* more tweaks

* use fetch

* --no-keep-empty

* rebase test

* auto resolve rebase

* git add .

* try checking out

* rm

* remove problematic rebase

* Feedback/instructions

* dupe
2020-12-28 11:41:46 +01:00
github-actions[bot] a8977ac8fd Release: 4.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3600)
* update readme

* add testing notes

* fix typo

* update readme

* add zip

* fix title version

* Bumping version strings to new version.

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-12-24 15:40:58 +01:00
Mohammed Faragallah 35363c8595 fix: shipping_address/billing_address use properties instead on items (https://github.com/woocommerce/woocommerce-blocks/pull/3599) 2020-12-24 15:10:44 +01:00
Seghir Nadir 3d92a61102 Fix nonce issues when adding product to cart from All Products (https://github.com/woocommerce/woocommerce-blocks/pull/3598)
* Products extend cart route

* load cart in products
2020-12-24 12:00:51 +01:00
Thomas Roberts 84f83f840c Get the latest stable version of WooCommerce for PHPUnit testing (https://github.com/woocommerce/woocommerce-blocks/pull/3594) 2020-12-23 16:10:25 +01:00
Seghir Nadir 863275bf6b sync shipping with billing when shipping is disabled (https://github.com/woocommerce/woocommerce-blocks/pull/3593)
* sync shipping with billing when shipping is disabled

* default to billing data if shipping is disabled
2020-12-23 16:10:13 +01:00
Rua Haszard 34f364e708 respect merchant setting for Stripe CC `title`: (https://github.com/woocommerce/woocommerce-blocks/pull/3568)
- expose title setting to client and use in UI
2020-12-23 08:52:37 +13:00
Rua Haszard 0783108d19 use consistent product name `WooCommerce Blocks` (https://github.com/woocommerce/woocommerce-blocks/pull/3567)
* use consistent product name `WooCommerce Blocks:
- readme.md title
  + update product vision paragraph
- update references in readme.txt preamble
- update in tests bootstrap message

* add WCCOM/docs links front & centre in readme for convenience
2020-12-23 08:49:45 +13:00
Albert Juhé Lluveras 257c970726 Don't add the hidden class name to elements with the hidden attribute (https://github.com/woocommerce/woocommerce-blocks/pull/3582)
* Revert "Add 'hidden' class name when using the 'hidden' attribute"

This reverts commit 0332e33a60a516506718e8ed4659e45d32dc80a4.

* Add styles for hidden panel content

* Add docs about account for the hidden attribute in styles

* Update docs/theming/README.md

Co-authored-by: Rua Haszard <rua.haszard@automattic.com>

Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-12-22 10:26:59 +01:00
Seghir Nadir a713e56c7a use ReplaceMediaFlow in featured category and feature product (https://github.com/woocommerce/woocommerce-blocks/pull/3579)
* use ReplaceMediaFlow in featured category

* use ReplaceMediaFlow in featured product

* remove redudant prop
2020-12-21 17:09:10 +01:00
Seghir Nadir 94d8d580a2 Fix isDefault on Buttons and switch Toolbar with ToolbarGroup (https://github.com/woocommerce/woocommerce-blocks/pull/3577)
* Fix isDefault notice

* fix Toolbar to ToolbarGroup
2020-12-21 17:03:54 +01:00
Seghir Nadir 800f3c9624 Fix direct call to setState in EditProductSearch body (https://github.com/woocommerce/woocommerce-blocks/pull/3578) 2020-12-21 16:56:58 +01:00
Bartosz Budzanowski 9cfa54579d Fix data type used for paymentData.paymentMethods handling. (https://github.com/woocommerce/woocommerce-blocks/pull/3576)
* Fix data type for used paymentData.paymentMethods.

* This check is no longer necessary.
2020-12-21 16:32:59 +01:00
Albert Juhé Lluveras 7ea0aa4fbc Use em for coupon code button height (https://github.com/woocommerce/woocommerce-blocks/pull/3575) 2020-12-21 14:49:43 +01:00
Albert Juhé Lluveras 4197cfdb2d Add 'hidden' class name when using the 'hidden' attribute (https://github.com/woocommerce/woocommerce-blocks/pull/3569) 2020-12-21 14:47:51 +01:00
Albert Juhé Lluveras 5d01c8d781 Merge markup from Product Title atomic block and ProductName component (https://github.com/woocommerce/woocommerce-blocks/pull/3562)
* Merge markup from ProductTitle atomic block and ProductName component

* Add test

* Remove duplicate decodeEntities call

* Minor improvements
2020-12-21 14:45:27 +01:00
Albert Juhé Lluveras e169929c89 Fix product list images skewed in Widgets editor (https://github.com/woocommerce/woocommerce-blocks/pull/3553) 2020-12-21 14:40:39 +01:00
Albert Juhé Lluveras e3d97d7387 Fix Fees not visible in Cart & Checkout blocks when order doesn't need shipping (https://github.com/woocommerce/woocommerce-blocks/pull/3521) 2020-12-21 14:15:27 +01:00
Albert Juhé Lluveras 28ffe1be49 Replace IconButton component with Button (https://github.com/woocommerce/woocommerce-blocks/pull/3547)
* Replace IconButton component with Button

* Fix All Products editor.scss file not included by Webpack
2020-12-21 14:11:13 +01:00
Bartosz Budzanowski e2e934ec46 Remove customer saved payment methods from context if they are not enabled. (https://github.com/woocommerce/woocommerce-blocks/pull/3551)
* For gateways with disabled saved payment metods, don't show saved items in context.

* Fix style.

* Update name.

* Simplify and fix.

* Whitespace.

* Revert for another PR.

* Formatting fix.
2020-12-21 12:07:31 +01:00
Rua Haszard ceff92b4b8 add fallback screen reader styles (https://github.com/woocommerce/woocommerce-blocks/pull/3557)
* add fallback screen reader styles

* use shared blocks screen-reader styles from mixin:
- tweak mixin to align with focus-reveal style
- add new mixin for focus-reveal style, since it is coupled to
visually-hidden mixin
2020-12-18 08:05:17 +13:00
Mike Jolley 55f0bc73a6 Fix Address Validation in the Store API and client (https://github.com/woocommerce/woocommerce-blocks/pull/3552)
* Trim input values before validation on Checkout

* Fixes required field checking at schema level

* Require country during checkout and ensure values are formatted

* Add handling for rest_invalid_param messages

* Remove prepare_address_fields - handled by schema

* Add address validation to OrderController

* Implement address validation

* Error errors from all endpoints more gracefully

* update non-true description

* required prop

* Update tests

* Fix equalityFn so updates are triggered when address changes

* Remove debounce so fields update if context changes

* Update src/StoreApi/Schemas/AbstractAddressSchema.php

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

* Add missing wp_unslash

* Validate allowed countries should block checkout if no countries are allowed

* Type in locale variable

* Update assets/js/base/utils/errors.js

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

* Fix validator calls

* Remove refererence

* Restore onChange order

* eslint fix

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-12-17 14:52:44 +00:00
Darren Ethier e6a4354777 Update close-stale-issues.yml
Fix heading spacing
2020-12-17 06:04:56 -05:00
Darren Ethier 2443e9082f Update close-stale-issues.yml
Fix quotes in yml
2020-12-16 16:12:40 -05:00
Darren Ethier 2369006de5 Update 390.md 2020-12-16 13:26:35 -05:00
Darren Ethier 796c101675 Update 390.md
clarify some testing notes.
2020-12-16 11:05:50 -05:00
Thomas Roberts ef081ef8a2 Fix select inputs when dark mode is enabled in Twenty Twenty-One (https://github.com/woocommerce/woocommerce-blocks/pull/3554)
* Add CSS rules for dark mode theme setting in Twenty Twenty-One

This is required because the theme may be set to dark mode independently of the browser. The reason we need two rules for this is because the checkout block can be set to have dark mode inputs too, so this rule doesn't need to apply then.

* Add theme-specific class for Twenty Twenty-One
2020-12-16 16:01:46 +00:00
renovate[bot] 0e12c88bf2 chore(deps): update dependency commander to v6.2.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3558)
* chore(deps): update dependency commander to v6.2.1

* Lockfile maintenance

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-12-16 15:09:11 +00:00
renovate[bot] 7fc6fcc5f4 chore(deps): update dependency @types/jest to v26.0.19 (https://github.com/woocommerce/woocommerce-blocks/pull/3556)
* chore(deps): update dependency @types/jest to v26.0.19

* Lockfile maintenance

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-12-16 13:57:26 +00:00
renovate[bot] 0821550c5a chore(deps): update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/3555)
* chore(deps): update babel monorepo

* Lockfile maintenance

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-12-16 12:59:25 +00:00
renovate[bot] 553f8e6da6 chore(deps): update dependency postcss to v8.2.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3559)
* chore(deps): update dependency postcss to v8.2.1

* Lockfile maintenance

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-12-16 11:00:58 +00:00
Albert Juhé Lluveras 56485d6da5 Rename version compare functions to isWpVersion and isWcVersion and add docblocks (https://github.com/woocommerce/woocommerce-blocks/pull/3548)
* Add docblocks to compareWithWpVersion and compareWithWooVersion

* Rename functions to isWpVersion and isWcVersion
2020-12-15 16:10:24 +01:00
Darren Ethier 9071cc3a80 GitHub Stale Action: Tweak message for stale activity and bump close boundary (https://github.com/woocommerce/woocommerce-blocks/pull/3550)
* Tweak message for stale activity and bump close boundary

Temporarily, bump the close boundary to 20 days to cover the holiday period.

* revert bump to 90 days
2020-12-15 06:01:44 -05:00
renovate[bot] e1c5ec4020 fix(deps): pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/3526)
* fix(deps): pin dependencies

* Lockfile maintenance

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-12-14 16:33:41 +00:00
renovate[bot] 863c07d105 chore(deps): update dependency mini-css-extract-plugin to v1.3.3 (https://github.com/woocommerce/woocommerce-blocks/pull/3531)
* chore(deps): update dependency mini-css-extract-plugin to v1.3.3

* Lockfile maintenance

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-12-14 15:52:45 +00:00
renovate[bot] 7705a87f76 chore(deps): update dependency autoprefixer to v10.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3528)
* Update dependency autoprefixer to v10.1.0

* Lockfile maintenance

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-12-14 14:41:49 +00:00
dependabot[bot] 710343e6d2 Bump ini from 1.3.5 to 1.3.7 (https://github.com/woocommerce/woocommerce-blocks/pull/3545)
* Bump ini from 1.3.5 to 1.3.7

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

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

* Lockfile maintenance

* Lockfile maintenance

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-12-14 13:40:16 +00:00
Mike Jolley 6e66799414 Update usage of legacy packages (inc. ServerSideRender) (https://github.com/woocommerce/woocommerce-blocks/pull/3541)
* Use the @wordpress/server-side-render package

* Add @wordpress/server-side-render dependency

* Update requiredPackagesInWPLegacy for 5.4 support

* Update package lock
2020-12-14 11:55:05 +00:00
Mike Jolley f459ad664c Switch to Fragment Short Syntax (`<>`) (https://github.com/woocommerce/woocommerce-blocks/pull/3536)
* Replace Fragment with shorthand

* Update eslint rules for short fragment syntax
2020-12-14 11:54:34 +00:00
Albert Juhé Lluveras 02174c5431 Add stories to Cart & Checkout totals components (https://github.com/woocommerce/woocommerce-blocks/pull/3533)
* Add stories to Cart & Checkout totals components

* Create @woocommerce/knobs alias

* Update TotalsFooterItem default values so they are in line with other stories
2020-12-14 09:15:50 +01:00
Albert Juhé Lluveras baa97e528f Update minimum required WP version to 5.4 (https://github.com/woocommerce/woocommerce-blocks/pull/3537)
* Update minimum required WP version to 5.4

* Remove WP legacy version check in blocks registration

* Remove no longer needed version check
2020-12-10 15:39:04 +01:00
Mike Jolley dc0220a98c Add Close stale issues workflow (https://github.com/woocommerce/woocommerce-blocks/pull/3540) 2020-12-10 12:45:17 +00:00
Rua Haszard 87d9b01dfb Add storybook demo for CheckboxControl (https://github.com/woocommerce/woocommerce-blocks/pull/3030)
* story for CheckboxControl aka Checkbox

* Rename exported story to Default and use correct component name

This keeps our stories more consistent
2020-12-10 10:38:26 +00:00
renovate[bot] 09009e4f8e Update dependency core-js to v3.8.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3529)
* Update dependency core-js to v3.8.1

* manual refresh lock file

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-12-10 16:10:57 +13:00
Rua Haszard f8208f8c63 Revert "experiment: remove core-js dependency, suspect unused 🧐"
This reverts commit f1794c334f.
2020-12-10 15:21:19 +13:00
Rua Haszard f1794c334f experiment: remove core-js dependency, suspect unused 🧐 2020-12-10 15:19:34 +13:00
renovate[bot] 3109ce7483 Update dependency @types/jest to v26.0.18 (https://github.com/woocommerce/woocommerce-blocks/pull/3527)
* Update dependency @types/jest to v26.0.18

* manual refresh lock file

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-12-10 15:08:11 +13:00
renovate[bot] baa0fce79c Update dependency eslint to v7.15.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3530)
* Update dependency eslint to v7.15.0

* manual refresh lock file

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-12-10 14:18:19 +13:00
Albert Juhé Lluveras 01c1ce8ffb Update WP versions used in Travis e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/3535)
* Update WP versions used in Travis e2e tests

* Remove WP 5.3 tests

* Remove legacy WP version checks in e2e tests
2020-12-09 17:09:45 +01:00
Albert Juhé Lluveras 8d9d98d8e9 Add missing experimental functions to the feature flags page (https://github.com/woocommerce/woocommerce-blocks/pull/3522)
* Remove no longer used __experimentalPersistItemToCollection function

* Add __experimentalDeRegisterPaymentMethod and __experimentalDeRegisterExpressPaymentMethod to feature flags doc
2020-12-09 15:10:57 +01:00
Mike Jolley 7bbe4926f5 Update Release Template and Docs (https://github.com/woocommerce/woocommerce-blocks/pull/3524)
* Remove release docs from plugin

* Clarify text in release checklists
2020-12-09 11:32:16 +00:00
Albert Juhé Lluveras bc40247d70 Rename Cart & Checkout totals components (https://github.com/woocommerce/woocommerce-blocks/pull/3520)
* Rename TotalsCouponCodeInput to TotalsCoupon

* Rename SubtotalsItem to Subtotal

* Rename TotalsDiscountItem to TotalsDiscount

* Rename TotalsFeesItem to TotalsFess

* Rename TotalsFooterItem folder

* Rename TotalsItem folder

* Rename TotalsShippingItem to TotalsShipping

* Rename TotalsTaxesItem to TotalsTaxes
2020-12-09 08:29:34 +01:00
Mike Jolley 58a65ec6e5 4.1.0-dev 2020-12-08 14:18:42 +00:00
github-actions[bot] dc5ad5701d Release: 4.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3509)
* generating changeset for pull request

* generating changeset for pull request

* Update readme changelog

* Update requirements

* Testing instructions

* Update zip file

* Update nonce outside of json parse

* Set logged in cookie on store api requests

* Update zip

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-12-08 13:40:40 +00:00
renovate[bot] be0b17c8d6 Update dependency @woocommerce/components to v5 (https://github.com/woocommerce/woocommerce-blocks/pull/3156)
* Update dependency @woocommerce/components to v5

* Fix lock file.

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: budzanowski <bartosz.budzanowski@gmail.com>
2020-12-07 16:49:41 +01:00
Albert Juhé Lluveras 85e3e8df2f Add missing experimental hook to docs (https://github.com/woocommerce/woocommerce-blocks/pull/3508) 2020-12-07 11:46:22 +00:00
renovate[bot] cb7cf6ab73 Update dependency autoprefixer to v10 (https://github.com/woocommerce/woocommerce-blocks/pull/3216)
* Update dependency autoprefixer to v10

* pin postcss & postcss-loader versions (Renovate will manage updates)

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-12-07 14:09:23 +13:00
Seghir Nadir 231d49406a Introduce pluginArea in Cart and Checkout (https://github.com/woocommerce/woocommerce-blocks/pull/3498)
* add plugin area

* add invisible errorBoundary

* move PluginArea to CheckoutProvider
2020-12-04 10:52:52 +01:00
Bartosz Budzanowski 2293e41f1d Fix:3501 Omit keys in `customerPaymentMethods` that have an empty list as a value. (https://github.com/woocommerce/woocommerce-blocks/pull/3502)
* Don't add empty methods key.
2020-12-03 19:33:33 +01:00
Mike Jolley 6825dc909f Add Formatter Classes to the Store API for Extensions to Consume (https://github.com/woocommerce/woocommerce-blocks/pull/3503)
* Create and register formatter classes

* Update Schema to use formatter classes

* Update tests

* Currency formatter

* Fix tests

* Use wc_get_price_decimals() as default

* Exception on non existing formatter call

* Feedback

* remove setter
2020-12-03 19:17:03 +01:00
Ettore Del Negro daa6454138 CartItems must extend AbastractCartRoute otherwise the cart is not loaded from the session (https://github.com/woocommerce/woocommerce-blocks/pull/3488) 2020-12-03 16:51:23 +01:00
Albert Juhé Lluveras 2e5bcca7c6 Update @wordpress/components to v. 11.1.1 and @wordpress/base-styles to v. 3.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3457)
* Update @wordpress/components and @wordpress/base-styles

* Fix JS warning in Select/downshift

* Remove color definitions that are now imported from @wordpress/base-styles. Fixes woocommerce/woocommerce-blocks#3311

* Use -unit values from @wordpress/base-styles. Fixes woocommerce/woocommerce-blocks#3313

* Update snapshots

* Fix payment methods test

* Don't extract dependencies that are not available in WP 5.3

* Avoid extracting @wordpress/compose since last version doesn't have resize observer

* Remove unnecessary uses of @wordpress/compose in a frontend scripts

* Add missing spaces
2020-12-03 14:04:25 +01:00
Mike Jolley ea52a2a2d5 Drop stock reservation when removing item from cart via the Store API (https://github.com/woocommerce/woocommerce-blocks/pull/3468)
* Remove Blocks version of ReserveStock Class

* When a cart item is removed, remove holds on stock

* Move maybe_release_stock to abstract

* Update ReserveStockException usage
2020-12-02 16:03:24 +00:00
renovate[bot] 7e656711b4 Update dependency html-react-parser to v0.14.2 (https://github.com/woocommerce/woocommerce-blocks/pull/3494)
* Update dependency html-react-parser to v0.14.2

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-12-02 16:08:02 +01:00
renovate[bot] 4ae3cd5555 Update dependency core-js to v3.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3493)
* Update dependency core-js to v3.8.0

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-12-02 15:57:34 +01:00
renovate[bot] 01df3ea8ca Update dependency config to v3.3.3 (https://github.com/woocommerce/woocommerce-blocks/pull/3492)
* Update dependency config to v3.3.3

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-12-02 15:45:31 +01:00
Rua Haszard ce6dd93e7b Handle change to logged-in status in checkout API AJAX requests (https://github.com/woocommerce/woocommerce-blocks/pull/3429)
* refactor and reorder checkout processing

* improve handling of checkout POST with mixed success:
- return coupon errors in a property
- don't throw from coupon validation:
  - return info about errors to route handler
  - tweak logic in route handler to prevent subsequent processing
  - default payment result to fail to avoid accidental successful checkout
- in client, catch errors and new customer id:
  - render any errors as notices - i.e. coupon error
  - if a customer ID is included, push into store (so UI updates)

* fix linter whitespace issue from rebase merge

* fix MIA order validation/errors (due to rebase):
- reinstate thrown exception when validating order
- return exception was an experiment, now solved in woocommerce/woocommerce-blocks#3454

* hide "Create account" checkbox if account is created during an error response:
- update store with new user id
- remove stale response.errors handling;
  - current approach (https://github.com/woocommerce/woocommerce-blocks/pull/3454) is to add data to error response

* show a notice informing user that they have signed up

* white space

* Handle header and update typedef

* Remove "errors" schema

* remove errors

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-12-02 14:27:28 +00:00
renovate[bot] b4919b0356 Update dependency @types/jest to v26.0.16 (https://github.com/woocommerce/woocommerce-blocks/pull/3491)
* Update dependency @types/jest to v26.0.16

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-12-02 14:28:52 +01:00
renovate[bot] 1ddff6ea05 Update dependency @octokit/graphql to v4.5.8 (https://github.com/woocommerce/woocommerce-blocks/pull/3490)
* Update dependency @octokit/graphql to v4.5.8

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-12-02 14:28:44 +01:00
renovate[bot] 5bd216baa0 Pin dependency github-label-sync to 2.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3489)
* Pin dependency github-label-sync to 2.0.0

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-12-02 14:28:24 +01:00
Rua Haszard 0cb3b3d9a8 refactor and reorder checkout processing (https://github.com/woocommerce/woocommerce-blocks/pull/3454)
* refactor and reorder checkout processing

* move experimental order_processed hook as last step before payment:
+ flesh out docs - intention/purpose, introduced version, link to PR,
relationship to legacy hook

* return current user_id with checkout error responses, so UI can update

* clarify user id comment

* Add store API nonce to all responses

* catch new nonce & update store for POST /checkout errors

* ensure $order hook param and database are in sync

* fetchResponse->errorResponse

* Move payment method ID validation to schema

* Add the nonce inline

* Simplify error method

* Add todo for injection

* Hook docs

* Return user ID as a header instead of in error response

* Default to private methods

* Tidied processing logic/order save placement

* White space removal

* Remove duplicate comment

* Remove root slash

* Remove unused created variable

* Remove woocommerce_registration_error_email_exists filter in error message from API

* Move payment validation

* Moved comments

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-12-02 12:22:42 +00:00
Albert Juhé Lluveras 5683ed1e54 Fix c notice close button color in Twenty Twenty One dark mode (https://github.com/woocommerce/woocommerce-blocks/pull/3472) 2020-12-02 13:09:57 +01:00
Albert Juhé Lluveras 281cc99291 Create IE11 SCSS mixin (https://github.com/woocommerce/woocommerce-blocks/pull/3473) 2020-12-01 09:04:52 +01:00
renovate[bot] ca26289ece Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/3484)
* Lock file maintenance

* Lock file maintenance

* Lock file maintenance

* Lock file maintenance

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2020-11-30 15:21:22 +00:00
Seghir Nadir 8c2c0f73ad Change register_endpoint_data to use an array of params instead of individual params. (https://github.com/woocommerce/woocommerce-blocks/pull/3478)
* use an array args

* allow schema to be empty if nothing was registred
2020-11-30 15:38:10 +01:00
Darren Ethier f4e4bdd1e7 update label sync json 2020-11-27 15:52:06 -05:00
Darren Ethier 8e7a168c9a add label-sync script and config 2020-11-27 15:41:36 -05:00
Albert Juhé Lluveras 4a03e88b45 Typo 2020-11-27 11:55:26 +01:00
renovate[bot] 389f82c53a Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/3460)
* Update babel monorepo

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-11-26 12:16:53 +00:00
renovate[bot] cd39759844 Update Node.js to v12.20.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3459)
* Update Node.js to v12.20.0

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-11-26 11:51:42 +00:00
Darren Ethier dcef9838ef bump version to dev after release 2020-11-25 15:36:58 -05:00
github-actions[bot] 671976907e Release: 3.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3453)
* generating changeset for pull request

* generating changeset for pull request

* add changelog for version 3.9

* clear vendor folder before doing deploy script

* start testing docs

* more build script improvements

* Finish testing notes

* update testing docs

* Prevent exclude drafts filter being tree shaken (https://github.com/woocommerce/woocommerce-blocks/pull/3463)

* Reverse logic for hiding product name in checkout sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/3464)

The hasLink prop was removed from ProductName and disabled is used instead, this change makes the variable name more descriptive, and uses disabled to signal if the ProductName should link or not.

* update zip file

* tweak changelog

* add link to release post in changelog

* fix release date in readme.txt

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: opr <5656702+opr@users.noreply.github.com>
2020-11-25 15:33:23 -05:00
renovate[bot] cdfe3e851e Update dependency @types/react to v16.14.2 (https://github.com/woocommerce/woocommerce-blocks/pull/3461)
* Update dependency @types/react to v16.14.2

* update package-lock.json

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-11-25 16:17:06 +00:00
renovate[bot] 364df26e2d Update dependency @testing-library/react to v11.2.2 (https://github.com/woocommerce/woocommerce-blocks/pull/3419)
* Update dependency @testing-library/react to v11.2.2

* update package-lock.json

* update package-lock.json

* restore package-lock.json

* update package-lock.json

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-11-25 15:58:09 +00:00
renovate[bot] d7d5b89af0 Update dependency chalk to v4 (https://github.com/woocommerce/woocommerce-blocks/pull/3217)
* Update dependency chalk to v4

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-11-25 15:02:58 +00:00
Albert Juhé Lluveras 0b2112c3d5 Prevent exclude drafts filter being tree shaken (https://github.com/woocommerce/woocommerce-blocks/pull/3463) 2020-11-25 13:46:13 +01:00
opr 704fab02d6 Reverse logic for hiding product name in checkout sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/3464)
The hasLink prop was removed from ProductName and disabled is used instead, this change makes the variable name more descriptive, and uses disabled to signal if the ProductName should link or not.
2020-11-25 12:39:02 +00:00
Seghir Nadir bc54dce0c8 make cart endpoint extensible (https://github.com/woocommerce/woocommerce-blocks/pull/3445) 2020-11-25 13:18:44 +01:00
opr 404e669f72 Change left margin of notice's dismiss icon to auto (https://github.com/woocommerce/woocommerce-blocks/pull/3455)
This is needed to ensure the dismiss icon in notices will always be as far over to the right of the parent container as possible.
2020-11-25 11:50:59 +00:00
renovate[bot] 6df3a7e2e0 Update dependency eslint to v7.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3462)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-11-25 11:38:26 +00:00
renovate[bot] 4e2b78135b Update dependency mini-css-extract-plugin to v1.3.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3420)
* Update dependency mini-css-extract-plugin to v1.3.1

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-11-25 11:30:09 +00:00
Darren Ethier 0b09a5a906 fix deploy script not doing tags for patch releases not deployed to wp.org (https://github.com/woocommerce/woocommerce-blocks/pull/3451) 2020-11-23 16:51:10 -05:00
Albert Juhé Lluveras 94064c1597 Fix checkbox and textarea styles in Twenty Twenty One when it has dark controls (https://github.com/woocommerce/woocommerce-blocks/pull/3450)
* Fix textarea styles in Twenty Twenty One when has dark controls

* Fix checkbox styles in Twenty Twenty One when has dark controls
2020-11-23 15:20:31 -05:00
Albert Juhé Lluveras e125dfd97b Fix radio controls and checkboxes in Twenty Twenty One dark theme (https://github.com/woocommerce/woocommerce-blocks/pull/3446)
* Fix radio controls in Twenty Twenty One dark theme

* Fix checkbox control in Twenty Twenty One dark theme
2020-11-23 14:43:36 -05:00
Mike Jolley cf9dc1b6bf Fix Twenty Twenty One Button and Placeholder Styling (https://github.com/woocommerce/woocommerce-blocks/pull/3443)
* Reset product list padding

* Adjust placeholder color if css variable exists

This is 2021 specific but may become more prominant.

* FIx editor button styles in 2021

* Adjust button sizes based on columns

* Adjust padding
2020-11-23 14:21:36 -05:00
Albert Juhé Lluveras 5a38fca235 Fix Twenty Twenty One Price filter, Active filters and radio control styling (https://github.com/woocommerce/woocommerce-blocks/pull/3444)
* Fix price slider styling in Twenty Twenty One

* Fix price slider styling in Twenty Twenty One

* Fix radio control styling in Twenty Twenty One and remove usage of mixin

* Force 0 padding on active filters list
2020-11-23 17:30:27 +01:00
opr a7461de3b3 Hide spinner on cart block's "Proceed to Checkout" link when page unloads (https://github.com/woocommerce/woocommerce-blocks/pull/3436)
* Hide spinner on cart's "proceed to checkout" button when page unloads

This is required because of a feature of Safari where the page state is saved, including all class names, when a transition occurs. Navigating using the back button restores the page to that cached state, so the spinner class remains on the button. Resetting the state just before the page gets cached stops this from happening.

* Change comment case to sentence case.
2020-11-23 13:20:04 +00:00
opr fcfe5ee7dc Stop hidden products from being linked in cart and checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/3415)
* Add catalog_visibility to CartItemSchema.php

This is used to get whether the product is visible in the catalogue, visible in the shop only, visible in search results only, or visible everywhere. We need to know this so we can pass it to the ProductImage and ProductName components.

* Remove links from CartLineItemRow if not visible in catalogue

Added catalog_visibility to lineItems prop, and when the product is not visible in the catalogue do not wrap product image in a link. Also pass down the hasLink prop to ProductName.

* Add hasLink prop to ProductName

When this prop is false we should not output the link around the product name. This is for when the product is hidden from the catalogue but we still want to show its name somewhere.

* Add tests and storybook for ProductName

* Add catalog_visibility check to OrderSummaryItem

When the catalogue visibility of a product is set to hidden or search, then the product name in the checkout sidebar should not be hyperlinked.

* Reverse logic for hiding link on product image & disabling link on name

Following a point from @budzanowski we do not need the hasLink prop, making use of disabled is probably a better idea.

* Remove tabindex from a in ProductName & output span if name is disabled

This change removes the need to pass a tabindex to the a in ProductName. This is because a disabled ProductName will now never output an a tag. When the ProductName is disabled a span is output instead, which has no tabindex by default.

This change also reverses the logic to decide whether the a or span should be output so as to make the code more readable and flow better.

* Update storybook and tests/snapshots for ProductName
2020-11-23 13:03:08 +00:00
renovate[bot] f6c8d91b9d Update dependency @testing-library/jest-dom to v5.11.6 (https://github.com/woocommerce/woocommerce-blocks/pull/3418)
* Update dependency @testing-library/jest-dom to v5.11.6

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-11-20 14:24:01 -05:00
renovate[bot] 756aae0be2 Update Node.js to v12.19.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3417)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-11-20 14:03:53 -05:00
Darren Ethier 36d4123ba2 if express payment is active, don’t show payment method options (https://github.com/woocommerce/woocommerce-blocks/pull/3432) 2020-11-20 12:45:12 -05:00
Mike Jolley 76b62f514c Refresh PaymentRequest after cancelling payment to prevent addresses remaining populated on repeat attempts (https://github.com/woocommerce/woocommerce-blocks/pull/3430)
* Re-init after a cancelation

* Remove empty data when normalising

* combine conditonals

* Move callbacks within effect
2020-11-20 11:40:58 -05:00
Mike Jolley 849e351a0e Sync shipping address with billing address when shipping address fields are disabled (https://github.com/woocommerce/woocommerce-blocks/pull/3358)
* Correct docblock description

* Sync shipping address changes with billing data

* Update inline documentation

* Revert address sync because it fails when shipping is disabled explicitely

* Avoid loading shipping address from customer is shipping is disabled

* Rather than update order from the wc/store/checkout request, update the customer object

This is turn is synced to order, but also allows the cart calcultions to use the posted data. This means that taxes will be updated based on address data even if not displayed on the checkout.

* Add action that combines billing and shipping updates

* Add route for updating billing and shipping address

* Sync billing data to server on change

* Shared constants for billing data

* Skip address update if missing country

* Allow null values to skip formatting

* Add billing to cart schema

* Removed unwanted hooks from previous commit

* Decoding is handled in useStoreCart

* Remove hook

* Make shipping context hold state

* Make billing context hold state

* Add address processors

* Cart does not have billing

* Update tests, remove some unrelated changes affecting the diff

* Revert "Update inline documentation"

This reverts commit 0393f49316de3152c6dcf6fda1192c06a74f1b55.

* Make shippingRatesAreResolving conditonal based on API request

* Shared address processor in cart and checkout

* Rename REST endpoint

* CustomerDataProvider and hook

* Update shipping address type defs

* Rename customer address endpoint, and remove update-shipping

* Update tests

* Fix tests by restoring country validation

* typo

* Update assets/js/base/hooks/cart/use-store-cart.js

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

* Simplify debounce and request handling

* Remove state from address sync

This will mean billing is "forgotten" if using the checbox, but this greatly simplifies logic.

* Rename shipping rates loading to customer data loading

* Sync based on useStoreCart data

* Made cart API less strict on addresses

* Fix useCheckoutAddress sync

* Add note on currentShippingAsBilling

* Use incoming isCart

* Add more detailed inline comment for shippingAsBilling toggle event

* Combine customer billing and shipping ref

* Update address docblock

* Error handling in pluckAddress

* Fix cart response after rebase

* Update customer tests

* Update src/StoreApi/Routes/CartUpdateCustomer.php

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

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-11-20 15:13:35 +00:00
opr 5ded3a9058 Ensure "Add a note to your order" section is styled correctly when disabled (https://github.com/woocommerce/woocommerce-blocks/pull/3427)
* Pass disabled prop to FormStep in order-notes-step.js

This way we can add the disabled class to the div or fieldset rendered by FormStep.

* Add disabled class & style for disabled FormStep components

Allows us to style disabled elements that cannot have the disabled attribute (divs) the same way as disabled fieldsets are.

* Update test snapshot for FormStep

This is because we added a class to the div/fieldset element when it is disabled.

* Remove redundant selector from form-step styles

Because we now add the --disabled modifier to the class, we no longer need the disabled selector. The new class-name based selector covers both fieldsets and divs.
2020-11-20 10:48:26 +00:00
opr 897abcb73a Prevent checkout step heading text overlapping actual heading on small viewports (https://github.com/woocommerce/woocommerce-blocks/pull/3425)
* Change style rules for checkout step headings

This is required because when the checkout heading text is too long it collided and overlapped the heading content due to its absolute position. In this commit we add a grey line to the left of the checkout step heading to ensure consistency with the checkout step container's styling.

* Remove position rule from checkout-step heading content

This was no longer needed as it nothing relied on the position of this element.
2020-11-20 10:44:24 +00:00
Mike Jolley caaf9e14c2 Improve Stripe (chrome pay) express payment method availability (https://github.com/woocommerce/woocommerce-blocks/pull/3424)
* Check price >= 30

* Force payment methods to react to order totals change

* Fix express payments reducer so it overwrites

* Fallback to 0 if undefined
2020-11-20 10:10:04 +00:00
Bartosz Budzanowski 4cf3bf214b Use latest ( tracked ) patch releases. (https://github.com/woocommerce/woocommerce-blocks/pull/3406) 2020-11-19 12:23:38 +01:00
Rua Haszard 8395954c7a Support a plain js config argument to payment method registration APIs (https://github.com/woocommerce/woocommerce-blocks/pull/3404)
* handle plain options passed to registerPaymentMethod:
- no need for a callback dance
- support the previous API: if a function is passed, call it as before

* update Stripe for new registerPaymentMethod interface

* update docs & all built-in payment methods to simpler API

* handle plain options arg to registerExpressPaymentMethod:
- add legacy fallback if passed a function
- update stripe express payment method
- update docs
- remove unused `assertValidPaymentMethodCreator` util

* use correct case for `JavaScript`

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

* typedefs for payment registration options + tidies for regular methods

* typedef express payment options arg & tidy stripe/payment-request:
- use camelCase for config instance (not a constructor/type)

* mention typedefs in payment method dev docs

* use @wordpress/deprecated to warn if callback passed to payment register

* update unit tests for new payment method API

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-11-19 11:06:33 +13:00
renovate[bot] adea8e33e4 Update dependency reakit to v1.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3421)
* Update dependency reakit to v1.3.0

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-11-18 16:38:29 +01:00
Albert Juhé Lluveras 3f01676d16 Exclude checkout-draft orders from WC Admin reports and My Account > Orders (https://github.com/woocommerce/woocommerce-blocks/pull/3379)
* Exclude checkout-draft orders from WC Admin reports

* Hook into order query args

* Add comments before applying filters

* Revert "Add comments before applying filters"

This reverts commit 83b695665c05a3a9e7669e8777080c6ff10d8421.

* Revert "Hook into order query args"

This reverts commit 94cec6c83cf5b5ce05cd106daf217c0b08f13a03.

* Hide draft orders from My Account > Orders

* Move filter to its own file

* Use custom plugin namespace for filter
2020-11-18 10:11:37 +01:00
Albert Juhé Lluveras e3163dc00d Add FeatureGating parameter to Package in tests (https://github.com/woocommerce/woocommerce-blocks/pull/3413) 2020-11-17 12:25:38 +00:00
Mike Jolley ec22a5c6c4 Cart and checkout should respect the global "Hide shipping costs until an address is entered" setting (https://github.com/woocommerce/woocommerce-blocks/pull/3383)
* Remove custom fieldconfig for shipping calculator so required fields for shipping are collected

* If the store config requires an address before shipping, do not return rates or totals

Totals, calculated by the cart, would be set to 0 in this scenario which could lead to customer confusion (why is the rate $10 but shipping shown as $0?)

* The shipping total row is missing a border

* Revert "If the store config requires an address before shipping, do not return rates or totals"

This reverts commit f3a4f24f5785392eb43bfc69a5548d398c47d8bb.

* Add hasCalculatedShipping to schema and hooks

* Show shipping notices with updated wording based on if shipping has calculated yet or not

* Refactor shipping row display to use new API props

* Remove block level isShippingCostHidden

* fix test

* Correct the math in the shipping preview in cart

* Document null

* Remove test—this option no longer exists

* Remove unused settings/constants
2020-11-17 11:58:38 +00:00
Mike Jolley 7b9898deeb Fix cart block isLarge console error in the editor when running WordPress 5.6 beta (https://github.com/woocommerce/woocommerce-blocks/pull/3408)
* Remove isLarge prop from Button component

* More isLarge button
2020-11-17 11:07:26 +00:00
Mike Jolley 582d9e87fc Show Express Payment Method Error Notices after Payment Failure (https://github.com/woocommerce/woocommerce-blocks/pull/3410)
* Strip tags from stripe error notices

* Revise abortPayment - this does not need to provide or handle responses

* Decode entities in responseData

* Correctly handle checkoutResponse props

* Show one error at a time from express methods

* Set ID to context to avoid need to manually define it
2020-11-17 10:51:27 +00:00
Albert Juhé Lluveras 6753023e08 Move feature flag PHP logic to a service class (https://github.com/woocommerce/woocommerce-blocks/pull/3343)
* Move feature flag PHP logic to a service class

* Add legacy methods

* Inject a FeatureGating class instance into Package

* Make is_experimental_build and is_feature_plugin_build methods non static
2020-11-17 08:46:12 +01:00
Albert Juhé Lluveras 624a8601bc Fix: orders not being placed when paying with an Express payment method from the Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/3403)
* Fix Express payment methods in Cart block

* Create a draft order inside get_draft_order_object() if the ID doesn't match a draft order
2020-11-16 13:12:56 +00:00
Seghir Nadir a576ba8d67 Introduce ExtendRestApi (https://github.com/woocommerce/woocommerce-blocks/pull/3356)
* initial prototype for ExtendRestApi

* return before assign

* fix phplint errors

* declare Throwable

* remove empty init

* return initial data if shape is not correct

* Add IDENTIFIER to schema classes

* refactor ExtendRestApi to not use filters

* remove extra check

* implement ExtendRestAPI injected into StoreAPI schemas

* use $extend instead of $extend_schema

* fix phpcs issues

* update schema

* fix data type

* address review

* fix object cast

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-11-16 13:31:27 +01:00
Rua Haszard 32b7d31c63 Expose `discount_type` in Store API coupon endpoints (https://github.com/woocommerce/woocommerce-blocks/pull/3399)
* add `discount_type` to store api coupons endpoints

* add `discount_type` field to coupon API docs

* add comment documenting when discount_type appeared in API response
2020-11-16 10:30:08 +13:00
Darren Ethier 4a488efb56 Fix incorrect usage of static method in Stripe payment method integration (https://github.com/woocommerce/woocommerce-blocks/pull/3400)
* bump phpcs compat check to php 7

* implement order_meta adjustment directly.
2020-11-14 11:04:48 -05:00
Bartosz Budzanowski ca8fe37e89 Print wordpress version in e2e tests. (https://github.com/woocommerce/woocommerce-blocks/pull/3401) 2020-11-14 14:52:30 +01:00
Darren Ethier 5d4fde02f1 fix package-lock.json 2020-11-13 10:37:19 -05:00
Darren Ethier 0363856256 update package-lock (needed after all recent renovate updates). 2020-11-13 08:26:45 -05:00
renovate[bot] 663bdcddbf Update dependency react-test-renderer to v17 (https://github.com/woocommerce/woocommerce-blocks/pull/3393)
* Update dependency react-test-renderer to v17

* Update package-lock.json

* Update dependencies order.

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: budzanowski <bartosz.budzanowski@gmail.com>
2020-11-11 20:08:29 +01:00
renovate[bot] dcb90c1a26 Update dependency mini-css-extract-plugin to v1 (https://github.com/woocommerce/woocommerce-blocks/pull/3392)
* Update dependency mini-css-extract-plugin to v1

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: budzanowski <bartosz.budzanowski@gmail.com>
2020-11-11 19:08:40 +01:00
renovate[bot] ffc76ddbdf Update dependency promptly to v3.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3391)
* Update dependency promptly to v3.2.0

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: budzanowski <bartosz.budzanowski@gmail.com>
2020-11-11 19:02:29 +01:00
renovate[bot] d83f2c37e0 Update dependency core-js to v3.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3389)
* Update dependency core-js to v3.7.0

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: budzanowski <bartosz.budzanowski@gmail.com>
2020-11-11 18:56:27 +01:00
renovate[bot] 2b64c0eaec Update dependency eslint to v7.13.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3390)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-11-11 18:52:41 +01:00
renovate[bot] 9059525d3c Update dependency @types/react to v16.9.56 (https://github.com/woocommerce/woocommerce-blocks/pull/3388)
* Update dependency @types/react to v16.9.56

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: budzanowski <bartosz.budzanowski@gmail.com>
2020-11-11 18:51:53 +01:00
Darren Ethier e1b3bae4b4 Add note about internal notifications of release and fix smoke test link. 2020-11-11 09:39:26 -05:00
Darren Ethier 28d38890d3 add note about posting to internal slack and fix smoke testing link. 2020-11-11 09:37:40 -05:00
budzanowski 3f9aed0fb0 Update to 3.9.0-dev version. 2020-11-10 17:30:55 +01:00
github-actions[bot] 062e0b0226 Release: 3.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3384)
* generating changeset for pull request

* Update changelog for the 3.8.0 release.

* Update testing instructions.

* Update testing documentation.
2020-11-10 17:12:25 +01:00
Darren Ethier 2727acc6b9 Fix PHP8 Unsupported Types with Operators warnings for PHP8 (https://github.com/woocommerce/woocommerce-blocks/pull/3381)
* fix unsupported types with operators warning for PHP 8 with cart item conditional checks

* verify draft order object instance before using

* ensure per_page value is cast to integer

* correctly account for categories value and type in conditional

* add more instanceof checks

* Correct variable name in array check

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-11-09 15:55:31 -05:00
Darren Ethier 07e9e679cf update checklists to include reference to `#woo-core-releases` slack channel. 2020-11-09 15:50:54 -05:00
Gerhard Potgieter c770098cd6 Add WordPress.org assets folder and add latest assets. (https://github.com/woocommerce/woocommerce-blocks/pull/3377) 2020-11-09 08:07:15 -05:00
Mike Jolley f1df45ddd2 Show the phone number field in the billing section when shipping is disabled in settings (https://github.com/woocommerce/woocommerce-blocks/pull/3376)
* Add missing context docs for shouldCreateAccount

* shouldCreateAccount context docs

* No need to handle showOrderNotes in component—just don't render it

* Only render notes if needed

* Create PhoneNumber component to insert when needed
2020-11-09 11:00:31 +00:00
Mike Jolley 5a450fc142 Change delimiter used for spltChunks from tilde to hyphens (https://github.com/woocommerce/woocommerce-blocks/pull/3360)
* Change delimiter used for chunks to hyphens

* Add automaticNameDelimiter to all configs
2020-11-09 10:44:58 +00:00
Darren Ethier e09444c525 Force node 12 for action (https://github.com/woocommerce/woocommerce-blocks/pull/3380)
Currently our repository doesn't support node 14.x and this branch of node recently became LTS so GitHub actions now default to that version. This is an attempt to force a specific version of node for the action.
2020-11-06 10:49:19 -05:00
Darren Ethier ea4cd86c69 Release 3.7.1 2020-11-05 08:16:05 -05:00
Darren Ethier f3fdbd7b59 Fix account creation bugs (https://github.com/woocommerce/woocommerce-blocks/pull/3371)
* account for registration enabled setting when creating accounts

* default to false instead of global setting for initial allowCreateAccount attribute

* consider global allows signup value for whether account creation checkbox shows

* include existing hook when determining if checkout signup is available:
- woocommerce_checkout_registration_enabled hook

* use public api for registration settings (via WC_Checkout)

* initial round of test fixes

* fix logic flaw exposed by tests and align tests with actual values in real use

* return early if WC_Checkout is not available

* remove temporary test group and uncomment new test.

* improve test method name

* fix comment to match new routine name

* ensure block shows login prompt when store disables checkout signup

* fix incorrect conditional order and cover with tests

Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-11-05 15:22:43 +13:00
renovate[bot] f11cd7a50f Update dependency @stripe/stripe-js to v1.11.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3365)
* Update dependency @stripe/stripe-js to v1.11.0

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-11-04 17:36:45 +01:00
renovate[bot] f50f510f63 Update storybook monorepo to v6.0.28 (https://github.com/woocommerce/woocommerce-blocks/pull/3369)
* Update storybook monorepo to v6.0.28

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-11-04 15:10:06 +01:00
renovate[bot] ebe7023a75 Update dependency html-react-parser to v0.14.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3368)
* Update dependency html-react-parser to v0.14.1

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-11-04 15:09:55 +01:00
renovate[bot] bd98a5b30e Update dependency @types/react to v16.9.55 (https://github.com/woocommerce/woocommerce-blocks/pull/3367)
* Update dependency @types/react to v16.9.55

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-11-04 15:09:48 +01:00
renovate[bot] c8ac09bceb Update dependency @testing-library/react to v11.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3366)
* Update dependency @testing-library/react to v11.1.1

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-11-04 12:47:35 +01:00
renovate[bot] 6d87a3f1f6 Update dependency @octokit/graphql to v4.5.7 (https://github.com/woocommerce/woocommerce-blocks/pull/3364)
* Update dependency @octokit/graphql to v4.5.7

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-11-04 11:24:59 +01:00