Commit Graph

2256 Commits

Author SHA1 Message Date
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
Darren Ethier 6f08922ea0 Improve smoke testing docs (https://github.com/woocommerce/woocommerce-blocks/pull/3351)
* Improve smoke testing docs and change location in docs

* add smoke testing to release pull request checklists
2020-11-03 11:40:26 -05:00
Seghir Nadir 4d82f1c14c Add __experimental_woocommerce_blocks_checkout_order_processed action (https://github.com/woocommerce/woocommerce-blocks/pull/3238)
* Add woocommerce_blocks_checkout_order_processed action

* pass order object as well

* remove empty post data

* add prefix and docs

* pass order object
2020-11-03 15:41:42 +01:00
Darren Ethier 49894c1f42 Fix approved-with-labels workflow
So apparently the action expects different encoding for the different label options (!)
2020-11-02 15:41:22 -05:00
Darren Ethier 16a0b02cba Create approved-with-labels.yml
Adds `status: ready to merge` and removes `status: needs review` labels from approved pull requests.
2020-11-02 13:46:50 -05:00
Darren Ethier 64210fab1b Add new doc referencing feature flags and experimental interfaces. (https://github.com/woocommerce/woocommerce-blocks/pull/3348)
* add doc for feature flag and experimental interfaces

* add new doc to TOC

* update pull request template to include checklist item for experimental/feature flag items

* tweak wording for experimental prefix

* fix bad formatting of bold for lines

* fix double slash in url

* add missing sentence case

* remove account signup as that is not included in Cart and Checkout block logic.

* Fix typo
2020-10-30 10:35:50 -04:00
Albert Juhé Lluveras 9069a8d509 Update composer.lock to v. 2 (https://github.com/woocommerce/woocommerce-blocks/pull/3335) 2020-10-30 09:37:33 +01:00
Rua Haszard 330d91f4b6 3.8.0-dev version bump 2020-10-30 09:42:48 +13:00
github-actions[bot] f4eeb5d0c6 Release: 3.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3339)
* generating changeset for pull request

* generating changeset for pull request

* tweak wording - testing instructions are focused on new features

* testing instructions (tbc) for 3.7.0

* link in 3.7.0

* add instructions for checkout signup

* 3.7.0 changelog

* Add missing doc links to TOC for release testing notes.

* fix typo in "replace"

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

* add testing instructions for various issues fixed in 3.7

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-10-30 09:38:18 +13:00
Rua Haszard 01132107a4 Allow shoppers to sign-up for an account from the Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/3331)
* expose checkout signup feature to release build (feature plugin):
- remove isExperimental from block/editor js (the block is already gated
  to plugin only)
- gate entire service class to feature plugin && Woo >= 4.7
  - this ensures our custom email and set password flow are only active
    for supported woo version, if blocks plugin is active
  - also refactored the gating logic so the woo version check is used to
    gate all code

* eslint action told me to delete comment `.` ... ?

* remove experimental feature flag for checkout signup front-end:
- "Create Account?" checkbox in address/contact component
- logged-out prompt logic - handle case when signup is enabled and guest
checkout is not enabled, i.e. checkout requires automatic signup

* fix formatting issues

* add allowCreateAccount to proptypes for CheckoutForm and AddressStep
2020-10-29 10:42:49 +13:00
renovate[bot] 814b84f973 Update dependency wordpress-compose to v3.22.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3330)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-28 13:32:13 -04:00
renovate[bot] a6047110f4 Update storybook monorepo to v6.0.27 (https://github.com/woocommerce/woocommerce-blocks/pull/3332)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-28 13:15:36 -04:00
renovate[bot] e49e306940 Update dependency commander to v6.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3329)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-28 12:49:26 -04:00
renovate[bot] a5e6dd4d3d Update dependency eslint to v7 (https://github.com/woocommerce/woocommerce-blocks/pull/3333)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-28 12:07:34 -04:00
renovate[bot] ee092f2d3d Update dependency @testing-library/jest-dom to v5.11.5 (https://github.com/woocommerce/woocommerce-blocks/pull/3327)
* Update dependency @testing-library/jest-dom to v5.11.5

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-10-28 16:29:42 +01:00
renovate[bot] 10304dbc5e Update dependency axios to v0.21.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3328)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-28 11:29:21 -04:00
renovate[bot] 9a58cd8c7f Update dependency @types/react to v16.9.54 (https://github.com/woocommerce/woocommerce-blocks/pull/3306)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-28 11:04:56 -04:00
Seghir Nadir 2482e307e0 Save order after creating an account (https://github.com/woocommerce/woocommerce-blocks/pull/3260)
* Save order after creating an account

* create account before saving

* fix tests

* remove order from createOrder

* rename variable

* fix tests
2020-10-28 15:18:22 +01:00
Albert Juhé Lluveras 55007b4601 Enable react-hooks/exhaustive-deps ESLint flag (https://github.com/woocommerce/woocommerce-blocks/pull/3325) 2020-10-28 10:14:46 +01:00
Albert Juhé Lluveras 109a7c3f54 Fix React hook dependency warnings in filter an All Products blocks (https://github.com/woocommerce/woocommerce-blocks/pull/3285)
* Fix wrong JSDocs

* Fix React hook dependency warnings in usePrevious hook

* Fix React hook dependency warnings in Filter an All Products blocks
2020-10-27 16:39:08 +01:00
Albert Juhé Lluveras 55e1a15149 Fix React hook dependency warnings in Cart & Checkout blocks + withAttributes HOC (https://github.com/woocommerce/woocommerce-blocks/pull/3314)
* Fix React hook dependency warnings in Cart & Checkout blocks

* Fix React hook dependency warnings in withAttributes HOC

* Fix select validation

* Fix test

* Remove unnecessary optional chaining

* Undo merge of two useEffects
2020-10-27 15:37:18 +01:00
Bartosz Budzanowski f66aa18e43 Change items organisation on smaller viewports. (https://github.com/woocommerce/woocommerce-blocks/pull/3299)
* Change items organisation on smaller viewports.

* Justify and gap.

* Align cost to quantity.
2020-10-27 15:23:27 +01:00
Bartosz Budzanowski 58734be009 Fix Gutenberg e2e tests failures. (https://github.com/woocommerce/woocommerce-blocks/pull/3324)
* Add e2e utils file.

* Update tests to use new utils.

* Remove allow failures.
2020-10-27 13:24:53 +01:00
renovate[bot] 7323392746 Update dependency @types/jest to v26.0.15 (https://github.com/woocommerce/woocommerce-blocks/pull/3305)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-26 14:26:35 -04:00
renovate[bot] 643a7ceace Update dependency @testing-library/react to v11.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3304)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-26 13:53:13 -04:00
Darren Ethier d288daa6f5 Fix PHP 8 error when argument is not invocable in AssetsDataRegistry::add_data (https://github.com/woocommerce/woocommerce-blocks/pull/3315)
* fix php 8 error when $data is not invocable

`is_callable` is the preferred way for checking whether a variable value is invocable or not.

* use is_callable in AbstractDependencyType
2020-10-26 13:28:25 -04:00
Darren Ethier 552981899c convert `composer/installers` to range instead of pinned dependency (https://github.com/woocommerce/woocommerce-blocks/pull/3323) 2020-10-26 09:17:28 -04:00
Bartosz Budzanowski abed796bd6 Respect Enable Taxes setting for checkout block taxe display. (https://github.com/woocommerce/woocommerce-blocks/pull/3291)
* Respect Enable Taxes setting for checkout block taxes display.

* Refactor logic into a named const.
2020-10-26 11:34:30 +01:00
renovate[bot] e1bfb747f9 Update dependency react-test-renderer to v16.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3307)
* Update dependency react-test-renderer to v16.14.0

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-10-23 11:38:22 +02:00
renovate[bot] e6fc57748d Update dependency @stripe/stripe-js to v1.10.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3303)
* Update dependency @stripe/stripe-js to v1.10.0

* Update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-10-23 11:30:04 +02:00
Remi Corson 181797906a E2E WC Core Terms Consistency (https://github.com/woocommerce/woocommerce-blocks/pull/3310)
* E2E WC Core Terms Consistency

fixes 3309

* fix test text

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-10-22 09:49:55 -04:00
Albert Juhé Lluveras 10ceda5851 Use @wordpress/base-styles and @automattic/color-studio as a base for our styles (https://github.com/woocommerce/woocommerce-blocks/pull/3300)
* Use colors variables instead of hardcoded values when possible

* Update WC colors from @automattic/color-studio

* Decrease specificity of price-slider CSS selectors

* Update colors to WC purple

* Update bright colors

* Update grays

* Update blacks and whites

* Add @todo comment

* Remove unnecessary blank line

* Remove purple color from price slider handle

* Fix colors not shown in SVG background

* Remove unnecessary box-shadow declaration

* Add theming docs

* Refactor/remove SCSS variables

* Add @todo comment to breakpoints

* Update package-lock.json
2020-10-22 12:40:32 +02:00
Seghir Nadir 9b5e436cc7 add draft order to woocommerce_valid_order_statuses_for_payment_complete (https://github.com/woocommerce/woocommerce-blocks/pull/3298) 2020-10-22 11:29:10 +01:00
renovate[bot] 8dfcad481f Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/3302)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-21 09:30:00 -04:00
Albert Juhé Lluveras 4f60b6367e Fix 3D secure payment errors (https://github.com/woocommerce/woocommerce-blocks/pull/3272)
* Add errors to UI in onCheckoutAfterProcessingWithError

* Fix missing useEffect dependency

* Typo

* Reset source id if Stripe intent fails

* Remove default error on onCheckoutAfterProcessingWithError

* Add missing useEffect dependency

* Only add default error message if there is no errors in any other context

* Fix useEffect running too many times

* Add type-defs and minor improvements

* Only count error notices
2020-10-20 11:50:33 +02:00
Darren Ethier b28c2f56e8 Update js-css-linting.yml (https://github.com/woocommerce/woocommerce-blocks/pull/3297) 2020-10-19 10:08:23 -04:00
Seghir Nadir b488c4a1c7 Document how to update E2E WP versions. (https://github.com/woocommerce/woocommerce-blocks/pull/3284)
* add guide to update WP version

* typo
2020-10-19 14:37:21 +01:00
Darren Ethier 884442bc27 Add a php coding standards action (https://github.com/woocommerce/woocommerce-blocks/pull/3292)
* add a php coding standards action

* add temporary php coding standards error to test action

* fix php standards error

* remove php linting check from travis run

* update woocommerce sniffs package

* try php 8 for linting

* revert back to php 7.4
2020-10-19 06:52:24 -04:00
Darren Ethier 6add52ccb7 Add workflow for linting js and css (https://github.com/woocommerce/woocommerce-blocks/pull/3294)
* Add workflow for linting js and css

* try alternative action to see if we get annotations

* add deliberate linting errors to validate new workflow behaviour

* try to fix annotations?

* maybe invalid check-name?

* try a different eslint action

* fix eslint fails

* remove js/css linting from travis

* remove unnecessary build execution
2020-10-18 12:49:59 -04:00
Bartosz Budzanowski 4e322d99cc Escape basename paths with spaces correctly. (https://github.com/woocommerce/woocommerce-blocks/pull/3290) 2020-10-16 15:36:34 +02:00
Albert Juhé Lluveras e4225dd54d Some changes/additions to the release checklist (https://github.com/woocommerce/woocommerce-blocks/pull/3269)
* Create ZIP before writing testing steps

* Add a note to restore the release branch

* Add a link to the milestones page

* Revert "Add a note to restore the release branch"

This reverts commit 362bf8779be2023c8015bb71a1328eca9bab4997.
2020-10-15 12:24:35 +02:00
renovate[bot] 02d6cea895 Update dependency downshift to v6 (https://github.com/woocommerce/woocommerce-blocks/pull/3281)
* Update dependency downshift to v6

* regenerate package-lock for downshift v6

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-10-15 14:49:00 +13:00
Rua Haszard c7b4e3aa76 Use store-themed set password form for checkout signup (https://github.com/woocommerce/woocommerce-blocks/pull/3236)
* use my-account/lost-password endpoint url for set password (tbd):
- companion for working on https://github.com/woocommerce/woocommerce/issues/27754

* use more appropriate (new) set-password endpoint

* add version check - use new woo core endpoint if woo version is new enough

* use my-account/lost-password for setting password in checkout signup:
- this has been available forever - no need for a version check
- page will show `Lost password`; looking at options for overriding that

* use more explicit `newaccount` action for set password url if available

* tweak feature gating for checkout signup:
- only available in dev builds (will change soon)
- only available if Woo core 4.7 or newer
- checkout signup relies on fixes in 4.7+ (tbc) to
  my-account/lost-password endpoint for setting initial password
- standardise feature gate logic so is consistent, ensure feature is
  disabled in API/backend, hide editor option, and disable front end
- add new setting `wcVersion` to allow feature gating on woo version

* fix woo-version feature gate of checkout signup:
- fixed version logic, explicit 4.7.0 reference version
- refactor version compare routine so can be used for woo or WP version

* revamp Woo 4.7+ logic so PHPunit tests aren't dependent on Woo version:
- Woo-version feature gating is implemented at integration layer:
  - checkout REST API
  - register/override new account email handler
2020-10-15 14:13:49 +13:00
renovate[bot] 2aa507fef5 Update dependency commander to v6 (https://github.com/woocommerce/woocommerce-blocks/pull/3280)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-14 17:57:01 -04:00
renovate[bot] dd3ea82fe0 Update storybook monorepo to v6.0.26 (https://github.com/woocommerce/woocommerce-blocks/pull/3278)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-14 17:38:04 -04:00
renovate[bot] fcf034ced4 Update dependency wordpress-element to v2.18.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3277)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-14 17:20:05 -04:00
renovate[bot] cb02884c2b Update dependency @types/react to v16.9.52 (https://github.com/woocommerce/woocommerce-blocks/pull/3275)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-14 16:45:35 -04:00
Farook Ibrahim b98dac6c62 Fixed: woocommerce/woocommerce-blocks#3084 (https://github.com/woocommerce/woocommerce-blocks/pull/3185) 2020-10-14 18:07:01 +01:00
renovate[bot] 47fe198d49 Update dependency promptly to v3.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3276)
* Update dependency promptly to v3.1.0

* regenerate package-lock

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-10-14 18:06:41 +13:00
Albert Juhé Lluveras ef734c9fbe Update version to 3.7.0-dev 2020-10-12 17:48:08 +02:00
github-actions[bot] c62a43043d Release: 3.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3266)
* generating changeset for pull request

* generating changeset for pull request

* Add 3.6.0 changelog

* Update 'WC tested up to' version

* Add 3.6 testing instructions

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-10-12 17:44:48 +02:00
Albert Juhé Lluveras 89a1ec7206 Ensure new payment methods are only displayed when no saved payment method is selected (https://github.com/woocommerce/woocommerce-blocks/pull/3247)
* Ensure new payment methods are only displayed when no saved payment method is selected

* Simplify logic

* Add tests

* Fix wrong props definition in JSDoc

* Use default parameter instead of default prop for functional component (Label)

* Remove usePaymentMethods mock

* Remove NoPaymentMethods mock

* Fix tests
2020-10-12 14:43:52 +02:00
Albert Juhé Lluveras e04e5d8033 Make 'retry' property on errors from checkoutAfterProcessingWithSuccess/Error observers default to true if it's undefined (https://github.com/woocommerce/woocommerce-blocks/pull/3261)
* Make 'retry' property default to true if it's undefined

* Create new shouldRetry method in useEmitResponse
2020-10-12 10:19:30 +02:00
Albert Juhé Lluveras b98ecd8116 Simplify emitEventWithAbort logic (https://github.com/woocommerce/woocommerce-blocks/pull/3256) 2020-10-09 10:52:04 +02:00
renovate[bot] d9c0d20129 Update dependency mini-css-extract-plugin to v0.12.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3250)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-08 16:45:15 -04:00
renovate[bot] cbedc5bbe4 Update dependency wordpress-compose to v3.21.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3251)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-08 16:24:17 -04:00
renovate[bot] 7e29f5ccee Update dependency @types/react to v16.9.51 (https://github.com/woocommerce/woocommerce-blocks/pull/3249)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-08 16:04:34 -04:00
renovate[bot] 68289f7fff Update Node.js to v12.19.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3248)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-08 15:30:37 -04:00
Albert Juhé Lluveras d90d7428bd Restore saved payment method data after closing an express payment method (https://github.com/woocommerce/woocommerce-blocks/pull/3210)
* Restore saved payment method data after closing an exprss payment method

* Fix wrong JSDoc props

* Add tests
2020-10-08 11:21:47 +02:00
Albert Juhé Lluveras e01e191397 Fix wrong propType introduced in woocommerce/woocommerce-blocks#3226 (https://github.com/woocommerce/woocommerce-blocks/pull/3242) 2020-10-06 15:58:41 +02:00
Darren Ethier cec452ee88 Create codeql-analysis.yml
Add codeql scanning to the repo.
2020-10-05 19:29:21 -04:00
Albert Juhé Lluveras 2f7b0ba3b4 Don't load contents of payment method hidden tabs (https://github.com/woocommerce/woocommerce-blocks/pull/3227) 2020-10-05 15:25:40 +02:00
Albert Juhé Lluveras e486b8b906 Refactor payment methods components (https://github.com/woocommerce/woocommerce-blocks/pull/3226)
* Move 'renderedTabs' to its own component

* Move getRenderedTab to its own component

* Remove 'getPaymentMethod' function

* Fix wrong typedef

* Remove unnecessary useRef

* Simplify NewPaymentMethodTab

* Drop 'New' prefix from components name

* Add JSDocs to new components

* Add propTypes to new components
2020-10-05 13:59:20 +02:00
Darren Ethier a3cb613330 Update SECURITY.md 2020-10-01 16:53:34 -04:00
Albert Juhé Lluveras 2ce885c6b7 Load WC Blocks CSS after editor CSS (https://github.com/woocommerce/woocommerce-blocks/pull/3219)
* Load WC Blocks CSS after editor CSS

* Add @todo tag to comment
2020-10-01 11:11:41 +02:00
Rua Haszard f000fb4f7a Support "create account" option in checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2851)
* prototype 'create account' checkbox in checkout block

* expose store config for generating password/username  to blocks:
+ use FILTER_VALIDATE_BOOLEAN instead of hard-coded `yes`

* stub out signup form in checkout block

* context / provider to store checkout signup form data

* revert signup form - checkout block will always generate username etc

* persist signup checkbox in checkout state & pass to checkout API

* add `create_account` param to order API, fix name in client POST

* handle creating user account as part of order (first cut)

* ensure the order is associated with the new customer

* only show 'create account' checkbox when appropriate (guest checkout)

* remove unnecessary username/password variables

* refactor account-creation logic into functions:
- clarify inputs and outputs
- use RouteException for error handling
- use woo options directly, avoid dependency on WC_Checkout

* update "email exists" error message to use existing error message text

* handle all known errors from wc_create_new_customer + use core message

* only show "create account" checkbox to shopper when necessary:
- if guest checkout is disabled, user must create account - not optional

* only show "create account" if account creation is optional:
- fixes incorrect logic in previous commit
- add some comments to clarify

* fix create account logic in API when checkout requires account:
- use correct woo setting option name
- reverse logic to match option = allow guest false means registration required

* strip html tags from create account error messages

* temporarily force enable autogenerate user/pass in new account API

* fix rebase errors

* add new allowCreateAccount attribute in checkout block

* show/hide `Create account` checkbox dependent on block attribute:
- previously was dependent on store setting

* new create user API, with set initial password email (first cut):
- use core register_new_user for creating the user
  - this triggers core "set new password" email
- generate username using logic lifted from WC core
- rough cut, lots to tidy/polish here

* remove alternative/unused create account function

* set `Customer` role for signups during checkout

* eslint fix - switch case break

* remove comments that mirror code & might go stale

* tidy func comment

* remove unused function

* use store setting `allow signup` for default value of new block option

* refactor order signup logic to service class first cut:
- new CreateAccount service
- hook up via custom action (for now at least)
- paste over existing create account logic (temporary - will be replaced)

* adapt wc_create_new_customer logic in CreateAccount service (WIP)

* set default_password_nag on new account + throw instead of WP_Error

* rename `createAccount` => `shouldCreateAccount` to clarify meaning

* fix checkout block - renamed `shouldCreateAccount` (missed in prev commit)

* prototype sending alternative email template for checkout signup

* add magic link to set password to blocks new account html email

* tidy up new account email templates - set password link, subject/heading

* use same id so merchant setting tweaks apply to our new improved email

* remove logging

* code tidies in CreateAccount service:
- remove unnecessary constructor
- type-hint in should_create_customer_account
- streamline logic in should_create_customer_account - remove
unnecessary `empty` check
- add comments to illuminate different use-cases handled by should_create_customer_account

* don't provide password to new account email templates (no longer used)

* declare dependencies in root namespace

* code tidies on new account email class:
- correct namespace and camelcase name
- declare class in file, don't instantiate; instantiate in client code
(CreateAccount service) when used
- no require/file import, use `use`

* move CustomerNewEmail to folder matching namespace

* use Package->get_path for email template paths:
- CreateAccount service now depends on Package
- CreateAccount passes Package to email class so it can use `get_path`
- note: CustomerNewAccount is not registered with DI container as it
needs to be instantiated after Woo init (for `WC_Email`)
- shift email templates to {plugin}/templates, consistent with WP
convention

* call CreateAccount::from_order_request directly, no custom hook:
- custom hook is not appropriate as we may not want to allow
extensibility in this way - TBD

* add appropriate margin above create account checkbox

* remove unnecessary direct-access protection

* generalise name of error-handling method

* simplify CustomerNewAccount - instantiate directly, when needed

* remove unused new_account_email member - now instantiated on demand

* numerous fixes and updates due to rebase changes

* fix typo in name of CustomerNewAccount php file (missing `n`)

* experiment - link to lost-password form in my-account (prototype branded screen)

* Revert "experiment - link to lost-password form in my-account (prototype branded screen)"

This reverts commit e1dc6dd5e9f0218ede81da92188d813c2d0856d9.

* feature gate CreateAccount service init to dev build only +
+ remove stale comment

* feature gate front end "Create account" checkbox to feature plugin only

* feature gate editor "allow signup" option to dev build only

* feature gate checkout api create account - dev build only

* tweak feature gating PHP logic so it's robust:
- all PHP feature gating is in the service class
- all publicly-available methods return early if feature gate off
- Checkout rest API transparently calls service - no explicit feature
gate at API level

* ensure frontend/editor features are feature gated (isExperimentalBuild is a function)

* feature gate value of checkoutAllowsSignup - can only be true in feature plugin

* fix a / an typo in comment

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

* remove commented code

* hello world unit test (doesn't test anything yet)

* add a command for running unit tests when container already up:
- this should probably move to another PR/branch

* basic tests of core logic in CreateAccount service

* import isExperimentalBuild direct:
- import from alias package was causing an issue, likely a dependency cycle

* refactor from_order_request to return new user ID so it's easier to test

* test creating a customer from an order + rest request:
- i.e. a full end-to-end integration test

* delete redundant test and tidy comments

* generalise test to provider format

* refactor create-dup-user err test to use same approach as success test

* add test for when user should not be created

* don't hard-code options in "create" test, remove redundant provider in no-account-requested test

* de-generalise "user already signed up" test

* add test for malformed email

* flesh out & comment successful signup tests

* flesh out "invalid email" tests

* clarify no account requested test comment

* remove phpunit:quick - I don't think it's needed

* add comment explaining this is an integration test

* experiment – disable feature flag, is this why the tests are failing?

* revert test commit - restore feature gate (experimental flag)

* skip all tests if CreateAccount is disabled due to feature flag

* d'oh - expose CreateAccount:is_feature_enabled so can be used in tests

* add jsdoc for checkout-state shouldCreateAccount field

* remove unnecessary comment + fix whitespace/indentation

* simulate logged-out user for createaccount signup tests

* use a single, compound if statement for early return (review nitpick)

* don't hide `checkoutAllowsSignup` store setting behind feature flag:
- the feature flag should be used to enable/disable behaviour
- it's dangerous to adjust store settings/options based on feature flag

* rejig tests so they require woocommerce_blocks_phase==3:
- make feature gate method private to avoid exposing
- remove feature flag check & test skip for other builds
- set blocks phase in travis config

* remove redundant user-logout in test setup - cleaner to just require this

* use WP function bracket style (same line)

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-10-01 15:07:16 +13:00
renovate[bot] 4102594de0 Update storybook monorepo to v6.0.22 (https://github.com/woocommerce/woocommerce-blocks/pull/3214)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-30 17:08:10 -04:00
renovate[bot] d389382669 Update dependency config to v3.3.2 (https://github.com/woocommerce/woocommerce-blocks/pull/3213)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-30 16:35:05 -04:00
renovate[bot] cb4f01b6a6 Update dependency @types/wordpress__data to v4.6.9 (https://github.com/woocommerce/woocommerce-blocks/pull/3212)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-30 16:14:10 -04:00
Seghir Nadir 1e1f399837 update version to next one 2020-09-29 16:48:47 +01:00
github-actions[bot] f3cfd711fb Release: 3.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3208)
* generating changeset for pull request

* generating changeset for pull request

* add changelog

* add testing notes

* update php and wc versions

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-09-29 16:43:19 +01:00
Albert Juhé Lluveras 1f8ea4f494 Remove selectedToken state from PaymentMethods (https://github.com/woocommerce/woocommerce-blocks/pull/3135) 2020-09-29 10:15:45 +02:00
Rua Haszard 7441ce6eec use the "light" bg colour for dropdown list by default (https://github.com/woocommerce/woocommerce-blocks/pull/3189) 2020-09-28 11:25:22 +02:00
Darren Ethier c844b41d6a enable testing-library/no-await-sync-query rule and fix rule violations (https://github.com/woocommerce/woocommerce-blocks/pull/3203) 2020-09-26 17:59:51 -04:00
Darren Ethier 1e6abded42 re-enable @wordpress/no-unused-vars-before-return eslint rule and fix violations (https://github.com/woocommerce/woocommerce-blocks/pull/3202) 2020-09-26 17:00:54 -04:00
Darren Ethier ba6a2e2ace re-enable @wordpress/valid-sprintf eslint rule and fix violations (https://github.com/woocommerce/woocommerce-blocks/pull/3201) 2020-09-26 16:05:00 -04:00
Darren Ethier a6750e0388 Fix esLint rule violations for @wordpress/i18n-translator-comments rule. (https://github.com/woocommerce/woocommerce-blocks/pull/3200)
* re-enable linting for @wordpress/i18n-translator-comments rule

* fix violations for the `@wordpress/i18n-translator-comments` eslint rule
2020-09-26 15:38:17 -04:00
Darren Ethier bb2acf726a Change default branch name to trunk (https://github.com/woocommerce/woocommerce-blocks/pull/3199)
* replace references to main branch with references to trunk

* update travis config to point to trunk not main branch

* more branch name changes
2020-09-26 13:28:16 -04:00
Darren Ethier 70baf77238 Update project-management-automations.yml
Update branch used for workflow
2020-09-26 13:09:54 -04:00
renovate[bot] bc348fe42a Update dependency webpack to v4.44.2 (https://github.com/woocommerce/woocommerce-blocks/pull/3184)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-26 11:30:43 -04:00
renovate[bot] 6e2cb83fcf Update dependency html-react-parser to v0.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3153)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-26 10:43:09 -04:00
renovate[bot] 454882453f Update dependency react-test-renderer to v16.13.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3127)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-26 10:23:37 -04:00
renovate[bot] 4bc1172348 Pin dependency @woocommerce/eslint-plugin to 1.0.0-beta.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3126)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-26 10:10:00 -04:00
renovate[bot] 1dc8442a31 Update dependency wordpress-element to v2.17.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3104)
* Update dependency wordpress-element to v2.17.1

* update experimental function to stable version

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-09-26 09:51:21 -04:00
renovate[bot] cede8c6999 Update dependency wordpress-compose to v3.20.1 (https://github.com/woocommerce/woocommerce-blocks/pull/3101)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-26 09:16:46 -04:00
renovate[bot] 685c474581 Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/3098)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-25 18:54:36 -04:00
renovate[bot] 646dfdbb45 Update dependency mini-css-extract-plugin to v0.11.2 and revert `@wordpress/base-styles` update. (https://github.com/woocommerce/woocommerce-blocks/pull/3099)
* Update dependency mini-css-extract-plugin to v0.11.2

* revert @wordpress/base-styles update

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-09-25 18:40:06 -04:00
Darren Ethier 7f68bc2ebe Update bundle-size.yml
Fix configuration for bundle-size
2020-09-25 17:58:15 -04:00
renovate[bot] 8bcadda1af Update dependency axios to v0.20.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3056)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-25 17:56:16 -04:00
renovate[bot] d9e835899d Update dependency reakit to v1.2.5 (https://github.com/woocommerce/woocommerce-blocks/pull/3022)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-25 15:16:09 -04:00
renovate[bot] c62b614970 Update wordpress monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/3130)
* Update wordpress monorepo

* rollback `@wordpress/e2e-utils` update

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-09-25 14:26:38 -04:00
renovate[bot] 989d9c1e73 Update dependency @testing-library/react to v11 (https://github.com/woocommerce/woocommerce-blocks/pull/3154)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-25 11:44:06 -04:00
renovate[bot] 8c80bc2803 Update npm to v6.14.8 (https://github.com/woocommerce/woocommerce-blocks/pull/3128)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-25 11:12:26 -04:00
renovate[bot] 7928973ebb Update Node.js to v12.18.4 (https://github.com/woocommerce/woocommerce-blocks/pull/3151)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-25 10:43:40 -04:00
renovate[bot] 07a8ae01b9 Update dependency @types/jest to v26 (https://github.com/woocommerce/woocommerce-blocks/pull/3155)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-25 10:20:45 -04:00
renovate[bot] 70cc671f4f Update dependency @testing-library/jest-dom to v5.11.4 (https://github.com/woocommerce/woocommerce-blocks/pull/3052)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-25 10:03:39 -04:00
renovate[bot] 313dfebcc7 Update dependency @types/react to v16.9.49 (https://github.com/woocommerce/woocommerce-blocks/pull/3054)
* Update dependency @types/react to v16.9.49

* update package-lock.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-09-24 19:01:53 -04:00
renovate[bot] a90f2a8bb1 Update dependency @stripe/stripe-js to v1.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3021)
* Update dependency @stripe/stripe-js to v1.9.0

* update package-lock for stripe update

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-09-24 18:41:21 -04:00
Darren Ethier eea4ba60af Add puppeteer-core as dev-dependency (https://github.com/woocommerce/woocommerce-blocks/pull/3193)
* add puppeteer-core as dev-dependency

* tweak .travis.yml to hopefully fix e2e test runs on travis

* revert previous changes and configure renovate to only rebase on conflicts
2020-09-24 18:23:27 -04:00
Darren Ethier bfe850445e update wp-scripts to latest version (https://github.com/woocommerce/woocommerce-blocks/pull/3192) 2020-09-24 13:33:02 -04:00
Darren Ethier be66dc35fa Fix broken Express Payment Method use in the Checkout block for logged out or incognito users. (https://github.com/woocommerce/woocommerce-blocks/pull/3165)
* add experimental api for deregistering payment methods

Not going to promote this api just yet.

* fix for express payment method bug

Removes incorrect condition for the purpose of this effect. The Effect is expressly for setting a default active payment method if none is set. Since active payment methods might be either a registered express payment method or a registered payment method, the check for whether the payment method is included or not is breaking express payment method behaviour.

* add test for express active state and deactive state transition

* account for possibilitiy active payment method might not be currently registered.
2020-09-24 10:45:40 -04:00
Darren Ethier f915c7c8a3 re-enable dependency grouping linting and fix errors (https://github.com/woocommerce/woocommerce-blocks/pull/3167) 2020-09-21 09:43:10 -04:00
Darren Ethier 9115160c2f Enable and fix all jsdoc rule violations (https://github.com/woocommerce/woocommerce-blocks/pull/3168)
* add param jsdocs to satisfy jsdoc require-param rule

* Fix jsdoc-checktypes rule violations

* fix jsdoc/require-param-type rule violations

* fix jsdoc/check-param-names violations

* fix jsdoc/require-property-description rule violations

* fix rule violations for jsdoc/valid-types rule

* fix rule violations for jsdoc/require-property rule

* fix jsdoc/no-undefined-types rule violations

* fix jsdoc/check-types rule violations

* fix jsdoc/require-returns-description rule violation

* enable jsdoc/require-returns-type rule

* fix jsdoc/newline-after-description rule violations
2020-09-20 19:54:08 -04:00
Albert Juhé Lluveras f5b18f6fe1 Add useStoreNotices tests (https://github.com/woocommerce/woocommerce-blocks/pull/3162)
* Fix wrong type def

* Add useStoreNotices tests

* Use forEach instead of map
2020-09-18 14:50:45 -04:00
Albert Juhé Lluveras 261844d05b Use noticeContexts from useEmitResponse instead of hardcoded values (https://github.com/woocommerce/woocommerce-blocks/pull/3161) 2020-09-18 14:39:32 -04:00
Albert Juhé Lluveras d641d2e1a4 Don't throw an error when registering a payment method fails (https://github.com/woocommerce/woocommerce-blocks/pull/3134)
* Show all payment methods when it's an admin and let the error boundary handle errors

* Use StoreNoticesContainer in Payment method error boundary so notices have styling

* Filter out saved payment methods for admin users if they don't accept payments

* Simplify update options logic

* For admins, only show payment methods that errored but canPay was not false

* Simplify how new payment method option is appended

* Wrap canMakePayment in a try catch block to handle payment methods that throw an error

* Add an id to payment method error boundary errors

* Add an error boundary to express payment methods

* Hardcode failing content and savePaymentInfo to false if the payment method failed

* Add some new comments

* Add a notice instead of registering the payment method if it fails and user is admin

* Throw error early if stripe failed to load

* Split express and standard payment method error notices

* Don't add payment methods in the editor and instead add a notice

* Fix error id

* Use noticeContext constant

* Add missing JSdoc param

* Remove unnecessary removeNotice
2020-09-18 12:27:54 +02:00
renovate[bot] 1871b4e573 Update dependency @octokit/graphql to v4.5.6 (https://github.com/woocommerce/woocommerce-blocks/pull/3152)
* Update dependency @octokit/graphql to v4.5.6

* Update package-lock locally

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-09-16 14:14:14 +02:00
Albert Juhé Lluveras a285376e96 Fix State label for Spain (https://github.com/woocommerce/woocommerce-blocks/pull/3147) 2020-09-16 10:50:24 +02:00
Darren Ethier e1c5d8a92d Update patch-initial-checklist.md
Update pull request example link for WooCommerce core.
2020-09-15 15:19:13 -04:00
Darren Ethier 1ea441a201 Update release-initial-checklist.md
Update pull request example link for WooCommerce core.
2020-09-15 15:18:35 -04:00
Darren Ethier a71d7374d2 bump dev versions 2020-09-15 09:21:57 -04:00
github-actions[bot] ca2049255d Release: 3.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3144)
* generating changeset for pull request

* generating changeset for pull request

* add changelog to readme.txt

* typo fixes to release checklists

* change tested up to for WooCommerce core

* add testing notes for release

* bump version referenced for WP

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-09-15 08:54:17 -04:00
Darren Ethier 7fb3c23c15 Update handling-releases.md
Add a step around reviewing pull request titles and labels.
2020-09-14 12:37:57 -04:00
Darren Ethier 74c8dce1a8 update release doc
Add example query to use for helping determine what merged pulls since the last release are missing in the current release milestone.
2020-09-14 12:26:55 -04:00
Darren Ethier 1e8207ffdd update .gitattributes ans add comment blocks (https://github.com/woocommerce/woocommerce-blocks/pull/3143) 2020-09-14 12:18:00 -04:00
Darren Ethier db876cd69d Update release docs (including release pull request templates) (https://github.com/woocommerce/woocommerce-blocks/pull/3124)
* Update release docs (simplify)

* update templates for releases

* fix grammar

* Add clarification around versioning.

* simplify versioning section

* add clarification around patch release branch creation

* fix typos/improve text

* more improvements to docs
2020-09-14 11:24:34 -04:00
Seghir Nadir 62de2eb6fc Fix an issue with COD not showing when first enabled (https://github.com/woocommerce/woocommerce-blocks/pull/3088)
* Fix issue with COD not showing when first set

* generating changeset for pull request

* generating changeset for pull request

* change condition to arrays only

Co-authored-by: github-actions <github-actions@github.com>
2020-09-14 10:36:14 -04:00
Albert Juhé Lluveras 76ebf9c860 Merge ProductPrice atomic block and component (https://github.com/woocommerce/woocommerce-blocks/pull/3065)
* Merge ProductPrice atomic block and component

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

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

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

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

* If product price component has alignment, make it a block

* Make ProductPrice propTypes more specific

* Add align prop to loading product price

* Add stories to ProductPrice component

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-09-14 12:56:10 +02:00
Albert Juhé Lluveras 727935f04c Add several tests to Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/3058)
* Add several tests to Checkout block in the editor

* Avoid 'visibility' word for toToggleElement rule

* Refactor matchers so they receives the label instead of the text

* Make initial 'isRequired' optional

* Refactor code that produces two clicks to DRY

* Unify error messages
2020-09-14 09:46:58 +02:00
Albert Juhé Lluveras 62f7d6a061 Update package-lock.json (https://github.com/woocommerce/woocommerce-blocks/pull/3139) 2020-09-11 15:56:36 +02:00
Rua Haszard e5c9243f73 Ensure shopper saved card is used as default payment method (default was being overwritten in some circumstances) (https://github.com/woocommerce/woocommerce-blocks/pull/3131)
* bail out of setting a default payment method if shopper has saved card

* ensure default payment method is only set as active if necessary:
- use functional form of setState; previous state (current payment
  method) is not potentially stale value
- so the default is only set if there really is no active payment method

* remove unnecessary remnant hook dependency 🧟‍♀️
2020-09-11 08:48:23 +12:00
renovate[bot] ceb83c2a03 Update storybook monorepo to v6.0.21 (https://github.com/woocommerce/woocommerce-blocks/pull/3129)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-09 09:23:52 +02:00
Claudio Sanches 71c2b5ba21 Remove "package" tag from files inside "src" and "tests/php" (https://github.com/woocommerce/woocommerce-blocks/pull/2972)
* Don't require package tag or file comment inside src

* Removed package from file headers

* Fixed coding standards

* fix doc blocks for REST API

* update root classes

* update phpdoc blocks for Assets and Block classes

* Domain classes

* update phpdocs for payment classes

* update phpdocs for registry classes

* update utils classes phpdocs

* missed saving one file

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-09-07 14:01:07 -04:00
Darren Ethier 69ba8161b6 Add @woocommerce/eslint-plugin dependency (https://github.com/woocommerce/woocommerce-blocks/pull/3115)
* convert eslint config to use @woocommerce/eslint-plugin

- removes unnecessary dependencies
- adds e2e-tests/specs to eslint ignore (they are automatically generated)
- turns off rules that will be handled in subsequent pulls (to avoid a mammoth changeset for review).
- NOTE: prettier config needs left in because of a bug with the existing version of `@wordpress/eslint-plugin` pulled in (fixed in https://github.com/WordPress/gutenberg/pull/25068) so I left the file for now.

* prettier fixes.

* remove obsolete plugin and fixes for eslint update

This branch brings an update to eslint which also changes some syntax with plugins. So this commit:

- fixes featuer-flag plugin syntax.
- removed obsolete dependency-group plugin (which is now in the `@woocommerce/eslint-plugin` configuration.

* add to-do comment

* fixes for test runs

- this also converts our e2e test scripts to use `wp-script test:e2e`, an advantage of this is it will load CHROMIUM on demand for the e2e test run.

* fixes for test runs

- this also converts our e2e test scripts to use `wp-script test:e2e`, an advantage of this is it will load CHROMIUM on demand for the e2e test run.

* include prettier alias as a dependency

This has to be done because prettier is installed with storybook and thus the alias setup in `@wordpress/scripts` is over-ridden by the storybook import.

* another attempt at e2e-test-fix

* add some debugging and temporarily just add one e2e config test for travis

* more debugging

* try installing full puppeteer and see if fixes

* fix package-lock?

* setupSettings separately from other fixture loading

* add debugging of files

* add another console.log (hopefully trigger travis)

* split out blockPage creation to it’s own as well

* fixed! remove debugging and re-enable travis configs for entire test suite

* fix config and rename e2e-tests to e2e

- fixes the failing product-search test
- tests/e2e-tests was redundant, I changed to `tests/e2e` (this follows a file pattern change made in woocommerce core as well).

* add todo for some eslint properties

* remove unnecessary early function execution

* revert earlier commit and remove duplicate call to createBlockPages
2020-09-07 13:31:10 -04:00
Albert Juhé Lluveras a9bcdb7d08 Create DebouncedValidatedTextInput component (https://github.com/woocommerce/woocommerce-blocks/pull/3108)
* Fix wrong Form component name

* Split CheckoutForm into smaller components for each step

* Centralize call to useCheckoutAddress

* Create DebouncedValidatedTextInput component

* Rename some variables
2020-09-07 19:03:04 +02:00
Albert Juhé Lluveras 1e75a866d8 Split Checkout form component into smaller files (II) (https://github.com/woocommerce/woocommerce-blocks/pull/3106)
* Fix wrong Form component name

* Split CheckoutForm into smaller components for each step

* Centralize call to useCheckoutAddress
2020-09-07 17:43:05 +02:00
Albert Juhé Lluveras fa593359bf Fix Cart&Checkout layout broken in some themes (https://github.com/woocommerce/woocommerce-blocks/pull/3111) 2020-09-07 17:39:53 +02:00
Rua Haszard 2edbd03080 Fix product reviews schema date fields to use new (WP 5.5) `date-time` format (https://github.com/woocommerce/woocommerce-blocks/pull/3109)
* update dates in ProductReviewSchema to 5.5 date-time format:
- https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/#format

* fix formatted date schema - is human readable, not 'date-time'
2020-09-04 08:23:10 +12:00
Albert Juhé Lluveras dfd57b0ee8 useMemo for complex computations in Country/State inputs (https://github.com/woocommerce/woocommerce-blocks/pull/3107) 2020-09-03 10:02:26 +02:00
renovate[bot] 04cbd80b60 Update dependency source-map-explorer to v2.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3100)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-02 11:08:57 +02:00
Rua Haszard 5c7447f434 Rename js/components to js/editor-components (https://github.com/woocommerce/woocommerce-blocks/pull/3069)
* mass-rename js/components => js/editor-components & update webpack

* mass-change import '@woocommerce/editor-components' +
+ jsprettier quotes fix

* more mass-rename @woocommerce/editor-components

* fix up references to js/editor-components in various places:
- docs/readmes
- jest config
- typescritp config

* fix story path to match new folder/alias 'editor-components'

* fix jest tests: use new alias for editor-components

* include renamed `editor-components` in editor stylesheet cache group
2020-09-02 10:21:46 +02:00
Rua Haszard 62aeb29031 update next-dev version number manually (cc @nerrad) 2020-09-02 14:16:45 +12:00
github-actions[bot] 51e48f43b1 Release: 3.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3077)
* generating changeset for pull request

* generating changeset for pull request

* 3.3.0 changelog + add woocommerce contributor (https://github.com/woocommerce/woocommerce-blocks/pull/3067)

* update min required WooCommerce - 4.2 (out of date!)

* require Woo 4.2+ min (L-2 policy)

* draft test instructions for new feature in 3.3.0

* add testing instructions for 3.3.0 bug fixes

* update TOC for testing instructions and add MIA 3.0-3.2 (!)

* add convenient zip file download to testing instructions

* update zip file - missed `composer install --no-dev` step

* clarify testing instructions for product price block +
+ remove mention of MIA screenshots

* retroactively add release notes for all products child block customization options

* add testing instructions for all products child block changes (3.1.0) +
+ use changelog note for testing headings

* Fix product element styling class names (https://github.com/woocommerce/woocommerce-blocks/pull/3095)

* Update sale badge align class names to match other element blocks

* Update product price align class names to match other element blocks

* Fix Product title alignment class names. Fixes woocommerce/woocommerce-blocks#3094

* Make styling attributes apply to Product title block when it's not a link. Fixes woocommerce/woocommerce-blocks#3093

* Linting fixes

* add changelog note for woocommerce/woocommerce-blocks#3095 + use standard changelog prefixes

* update release date

* update zip file link (new test build ft. woocommerce/woocommerce-blocks#3095)

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-09-02 14:04:27 +12:00
Albert Juhé Lluveras 4de3a0447b Fix product element styling class names (https://github.com/woocommerce/woocommerce-blocks/pull/3095)
* Update sale badge align class names to match other element blocks

* Update product price align class names to match other element blocks

* Fix Product title alignment class names. Fixes woocommerce/woocommerce-blocks#3094

* Make styling attributes apply to Product title block when it's not a link. Fixes woocommerce/woocommerce-blocks#3093

* Linting fixes
2020-09-01 16:52:25 +02:00
Seghir Nadir 4c371e064c Use wp_login_url instead of hardcoding login path (https://github.com/woocommerce/woocommerce-blocks/pull/3090)
* use wp_login_url instead of hardcoding login path

* generating changeset for pull request

* generating changeset for pull request

Co-authored-by: github-actions <github-actions@github.com>
2020-09-01 10:56:11 +01:00
Darren Ethier 4adb9d553e update release pull request workflow
fix improper indentation for expression.
2020-08-31 14:42:54 -04:00
Darren Ethier 06a952fb93 update wordpress deploy workflow
fix incorrect syntax for conditional expression in slack notification steps.
2020-08-31 14:39:30 -04:00
Darren Ethier 7858137b0b Update release pull request workflow
- improve conditional on whether job runs to only run on branches containing 'release/'.
- fix syntax on if conditionals in slack notifications
2020-08-31 14:38:20 -04:00
Seghir Nadir d7a8328528 Fix JS console error when COD is enabled and no shipping method is available. (https://github.com/woocommerce/woocommerce-blocks/pull/3086)
* only return selected shipping methods from useSelectShippingRate

* add docs
2020-08-31 17:15:56 +01:00
Albert Juhé Lluveras 80400e50da Split Checkout block component into smaller files (https://github.com/woocommerce/woocommerce-blocks/pull/3062)
* Rename CheckoutForm to Form

* Create CheckoutForm component

* Simplify directory structure

* Add docs about class name changes

* Add PropTypes to CheckoutForm

* Update skeleton class name

* Extract LoginPrompt

* Move loginToCheckoutUrl to a constant

* Move replaced class name docs to 3.4.0 specific file
2020-08-31 12:17:42 +02:00
Darren Ethier 93e493bef9 Change location of if notification 2020-08-30 20:21:46 -04:00
Darren Ethier a71503ccf9 Add slack notifications to release-pull-request workflow 2020-08-30 12:49:42 -04:00
Darren Ethier 03a7765c8c Create release pull request automation workflow 2020-08-30 12:35:42 -04:00
Darren Ethier b8932cc7bd Update project-management-automations.yml
Update the version used for existing workflow
2020-08-30 12:32:51 -04:00
Darren Ethier 493436ca0f Add templates for release pull request automation (https://github.com/woocommerce/woocommerce-blocks/pull/3073)
* add templates for release pull request automation

* add configuration
2020-08-30 12:31:52 -04:00
renovate[bot] 567d4b7c6b Update dependency @testing-library/react to v10.4.9 (https://github.com/woocommerce/woocommerce-blocks/pull/3053)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-30 11:53:47 +01:00
renovate[bot] 95f4c9dee7 Update dependency @octokit/graphql to v4.5.4 (https://github.com/woocommerce/woocommerce-blocks/pull/3020)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-30 11:53:36 +01:00
Darren Ethier 0244bd5327 Fix deploy scripts for handling composer.json version and version string validation (https://github.com/woocommerce/woocommerce-blocks/pull/3027)
* improve patch version detection and automatically fix incorrect format for version

* don’t include composer.json version update in commit

* update build-plugin zip to account for autoloader generation

* for zip-only do composer dump-autoload command

* regenerate classmap after composer version change reverted in composer.json and/or deployed

* fix condition

* improve/fix version string splitting

* remove lingering debugging

* Add some more info around the question on whether this is deployed to WordPress.org or not

* update release doc about main branch version bumping

* tweak wording in release docs

* fix grammar in user instructions
2020-08-27 09:17:52 -04:00
Rua Haszard 0a1a14f5db upgrade Storybook to 6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/3039)
* upgrade Storybook and add core-js:
- core-js is needed for Storybook, at least as a workaround for an issue
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#core-js-dependency-errors

* rejig package-lock after merge
2020-08-27 12:02:20 +12:00
Rua Haszard 77aa2a33a3 clarify intentions / purpose of different component folders in docs (https://github.com/woocommerce/woocommerce-blocks/pull/3025)
* add high-level docs about our components & remove stale detail info

* use current collection/folder naming in docs:
- let's rename js/components in a separate PR
- split paragraphs on to separate lines to improve future diffs

* rename storybook.md => components.md and update link/summary

* tweak component collection docs:
- base have more stringent requirements, since they can be used anywhere
- editor components are less strict and can assume editor context

* clarify js/base/components readme in line with main doc

* remove line about editor components being specialised to woo blocks
2020-08-27 08:15:16 +12:00
renovate[bot] 96836fa117 Update dependency @types/wordpress__data to v4.6.8 (https://github.com/woocommerce/woocommerce-blocks/pull/3055)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-26 11:26:39 +02:00
renovate[bot] 8f91667b86 Update dependency @babel/core to v7.11.4 (https://github.com/woocommerce/woocommerce-blocks/pull/3051)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-26 11:26:18 +02:00
Albert Juhé Lluveras 8d9de5c11c Fix discounted price misalignment in Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/3047)
* Fix discounted price misalignment in Cart block

* Fix Product Price block alignment
2020-08-25 15:10:11 +02:00
Albert Juhé Lluveras ff6382f0c8 Add Webpack config docs (https://github.com/woocommerce/woocommerce-blocks/pull/3043)
* Add Webpack config docs

* Typo

* Add note that aliases make refactors easier

* Rewrite 'Relevant files' section of the build system docs
2020-08-25 12:01:19 +02:00
Albert Juhé Lluveras 7ba25d63c1 Fix CartItems unit tests (https://github.com/woocommerce/woocommerce-blocks/pull/3044) 2020-08-25 10:33:41 +02:00
renovate[bot] 1bcaa5f5e5 Update dependency webpack-cli to v3.3.12 (https://github.com/woocommerce/woocommerce-blocks/pull/3023)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-24 10:33:41 +02:00
Albert Juhé Lluveras 58788acf0b Exclude storybook from released ZIP (https://github.com/woocommerce/woocommerce-blocks/pull/3036)
* Create copy plugin files bash script so logic is not duplicated

* Exclude storybook from ZIP. Fixes woocommerce/woocommerce-blocks#2671
2020-08-24 10:27:58 +02:00
renovate[bot] 96263cb029 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/3040)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-24 10:27:01 +02:00
Albert Juhé Lluveras a6178359bb Display Checkout block with a notice when adding a product sold individually that was already in the cart (https://github.com/woocommerce/woocommerce-blocks/pull/2854)
* Rename component to match directory

* Typo

* Checkout API: return cart errors as 'notice' property instead of throwing

* Checkout block: display server errors as notices

* Strip tags content

* Use same strings as in Core

* Add support for several notices

* Rename variables and allow all kind of notices

* Strip HTML tags and content in frontend

* Fix Checkout block in editor

* Add stripTagsAndContents tests

* Print notices before running blocks logic
2020-08-21 09:34:29 +02:00
Albert Juhé Lluveras 8bb217cec6 Show express payment methods in the Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/3004)
* Shown express payment methods in Cart block

* Fixes

* Create usePositionRelativeToViewport hook

* Typo

* Style fixes

* Remove footer push div

* Styling fixes

* Improve code clarity

* Split ExpressCheckoutFormControl into two components

* Rename visibilityObserver to referenceElement

* Replace 'useEffect' with 'useLayoutEffect'

* Add tests for usePositionRelativeToViewport

* Self-closing div

* Add explanatory comment

* Create a shim for IntersectionObserver

* Update express payment components class names

* Add todo comment to remove IntersectionObserver shim when we drop IE11 support
2020-08-20 16:14:12 +02:00
Seghir Nadir 996925dab8 update versions 2020-08-19 16:03:20 +01:00
Seghir Nadir ab99e7d19e Release 3.2 (https://github.com/woocommerce/woocommerce-blocks/pull/3016)
* add testing checklist

* add zip to file

* add changelog

* Bumping version strings to new version.

* remove version from composer

* fix version number in package.json

* pin wc to 4.3.3

* add jetpack constant to travis
2020-08-19 15:50:12 +01:00
renovate[bot] 2f6dd1e5cd Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2984)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-18 10:55:08 -04:00
renovate[bot] 1f6a3f651d Update dependency autoprefixer to v9.8.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2967)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-18 10:51:16 -04:00
renovate[bot] 18bc3b37b9 Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/2964)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-18 10:41:34 -04:00
Seghir Nadir 28d3bd7dda remove suspense polyfill (https://github.com/woocommerce/woocommerce-blocks/pull/3015) 2020-08-18 12:32:40 +01:00
Darren Ethier fad8c06b23 Add defensive checks for cart instance (https://github.com/woocommerce/woocommerce-blocks/pull/3009) 2020-08-18 07:30:28 -04:00
Seghir Nadir 69ff731b4e use TextControl instead of PlainText (https://github.com/woocommerce/woocommerce-blocks/pull/3014)
* use TextControl instead of PlainText

* update e2e test

* revert changes for label

* update test
2020-08-18 12:25:48 +01:00
Darren Ethier c0dbb08ef9 Deprecate wc.wcSettings.setSetting function. (https://github.com/woocommerce/woocommerce-blocks/pull/3010)
* Add deprecation notice for setSettings

* add todo for followup issue to actually remove the function

* update todo

* fix tests

* fix todo

* Update assets/js/settings/shared/set-setting.js

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-08-18 10:40:08 +01:00
Rua Haszard 0fbc366746 update minimum required version of WordPress core to 5.3 (https://github.com/woocommerce/woocommerce-blocks/pull/3013)
* update min version of WordPress core to 5.3 in readmes

* update min WP version to 5.3 - main plugin file & admin compat notice

* remove WordPress 5.2 travis e2e test build

* disable legacy (WP <5.3) webpack entry points

* add "update user docs" step to release process, incl min WP/Woo reqs

* add 5.5 test

* allow test to fail

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-08-17 15:20:51 +01:00
Rua Haszard 506806065f rename `ProductQueryFilters` file to match class name (PSR4 compatible) (https://github.com/woocommerce/woocommerce-blocks/pull/3012) 2020-08-17 13:07:23 +01:00
Seghir Nadir 85ed96b58e Add dark colors support to Cart & Checkout controls (https://github.com/woocommerce/woocommerce-blocks/pull/2981)
* add dark styles setting

* add attributes to blocks

* add colors to input and select

* cover rest of items

* tweak select contrast

* fix ie11 issue

* fix focus

* include checkbox styles

* fix extra spacing after phone number

* add styling to quantity selector

* remove extra rule

* remove editor styles for radio control

* use border-color

* rename variables and classes and wording

* adjust colors

* provide tighter control over colors

* remove redudant outline rule

* add more variables

* add support for order note

* use variables for textarea

* move dark mode panel to last
2020-08-14 12:08:16 +01:00
Seghir Nadir 1fddb9451d Use real previews for the Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2992)
* Use real previews for the cart and checkout

* remove extra files and css
2020-08-13 14:24:51 +01:00
renovate[bot] 44591f2db5 Update dependency mini-css-extract-plugin to v0.10.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2999)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-13 08:02:42 +02:00
renovate[bot] 4e2917fa69 Update dependency eslint-plugin-jest to v23.20.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2998)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-13 08:02:36 +02:00
renovate[bot] dbfda4df8b Update dependency @types/react to v16.9.46 (https://github.com/woocommerce/woocommerce-blocks/pull/2997)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-13 08:02:27 +02:00
renovate[bot] 5c480f91db Update dependency @testing-library/jest-dom to v5.11.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2996)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-13 08:02:18 +02:00
Darren Ethier 3078b97534 Fix phpunit test config (https://github.com/woocommerce/woocommerce-blocks/pull/3001)
* set path for WP install on unit tests to ensure latest is always installed.

* fix tests using deprecated method
2020-08-12 10:54:02 -04:00
Rua Haszard 39270f5657 Remove generic payment method icons (Stripe CC + Cheque) (https://github.com/woocommerce/woocommerce-blocks/pull/2968)
* remove generic icons from Cheque & Stripe CC payment methods

* remove icon prop from PaymentMethodLabel - no longer supported:
- icons should only be used for recognisable brands
- generic icons (e.g. credit card) are not recommended

* Revert "remove icon prop from PaymentMethodLabel - no longer supported:"

This reverts commit 1990028a6c98b82750fb917ff3086dbe022ef41d.
2020-08-12 08:44:19 +12:00
Seghir Nadir 66876c4216 allow wp 5.4 + GB to fail (https://github.com/woocommerce/woocommerce-blocks/pull/2990) 2020-08-11 16:13:03 +01:00
Albert Juhé Lluveras a16af68975 Hide saved payment methods if their gateway is disabled (https://github.com/woocommerce/woocommerce-blocks/pull/2975)
* Hide saved payment methods if their gateway is disabled

* Fix wrong type-def

* Remove extra blank line

* Rename var

* Use FILTER_VALIDATE_BOOLEAN instead of comparing to 'yes'

* Use data from Payment Method context instead of reading setting from the server

* Use data from Payment Method context instead of reading setting from the server
2020-08-11 15:43:03 +02:00
Albert Juhé Lluveras 339c0532f1 Fix text input and select error styles on focus (https://github.com/woocommerce/woocommerce-blocks/pull/2974) 2020-08-11 11:55:26 +02:00
Seghir Nadir 145db3ff5d fix issue with no margins on phone input (https://github.com/woocommerce/woocommerce-blocks/pull/2989)
* fix issue with overlapping margins

* move styles out of select

* remove extra spacing

* remove extra spacing from cart

* move styles to state input and remove extra position.
2020-08-11 10:00:53 +01:00
Seghir Nadir fc9f6fe71a Use SVG for checkbox (https://github.com/woocommerce/woocommerce-blocks/pull/2320)
* use svg for checkbox

* update borders

* switch to rems

* define a rem function

* fix ie11 issue

* fix focus

* add ie hack

* fix spacing and switch to em

* switch to rem
2020-08-11 09:59:59 +01:00
David Levin 4a8026623e It's its not it's unless it's it's. (https://github.com/woocommerce/woocommerce-blocks/pull/2988)
Co-authored-by: David Levin <davidlevin@Davids-MacBook-Pro-2.local>
2020-08-10 16:33:17 +01:00
Rua Haszard b8137587c3 Link cart/checkout merchant (editor) feedback prompt to special GitHub issue type (https://github.com/woocommerce/woocommerce-blocks/pull/2976)
* issue template for cart & checkout feedback

* fix example desktop OS (not iOS!)

* delete `withFeedbackPrompt` - not used

* link cart/checkout editor feedback to GitHub issue:
- add new CartCheckoutFeedbackPrompt with specialised text & url
- use in cart/checkout blocks
- tweaked wording of feedback prompt text

* use speech bubble icon to represent feedbackiness

* simplify cart/checkout feedback prompts

* add default labels to all issue templates

* use markdown heading syntax for headings (was basic bold previously)

* tweak wording (remove hint of frustration) and use new "feedback" label
2020-08-10 08:18:36 +12:00
Darren Ethier a74ca7ddeb Update handling-releases.md 2020-08-07 21:36:48 -04:00
Darren Ethier dcdc5c48ce Improve behaviour of draft order cleanup to account for clobbered custom shop order status. (https://github.com/woocommerce/woocommerce-blocks/pull/2912)
* improve behaviour of draft order cleanup with tests

* hide error logging output from tests

* fix doc

* fix status check and test setup/teardown
2020-08-07 15:36:55 -04:00
Seghir Nadir 0dd2dce09a Fix undefined variable in php closure (https://github.com/woocommerce/woocommerce-blocks/pull/2962) 2020-08-07 14:10:35 -04:00
Albert Juhé Lluveras cbf6ee3e7e Add docs about CSS build system (https://github.com/woocommerce/woocommerce-blocks/pull/2953)
* Add docs to CSS build system

* Add docs to CSS build system (II)
2020-08-07 13:57:57 -04:00
Albert Juhé Lluveras dfec03202d Fix JS-rendered blocks inside Empty Cart (https://github.com/woocommerce/woocommerce-blocks/pull/2904)
* Fix JS-rendered blocks inside Empty Cart

* Add deprecation rules

* Performance improvements

* Typo

* Remove 'is-loading' class requirement

* Undo changes moved to woocommerce/woocommerce-blocks#2952

* Improve some comments

* Improve code

* IE 11 fix

* Minor fixes

* Assign default value in arguments destructuring

* Refacot renderFrontend code to make it easier to understand

* Revert "Assign default value in arguments destructuring"

This reverts commit 04ae943c675b94e599a1d1700075a79ef8be5004.
2020-08-07 13:33:32 -04:00
renovate[bot] 20b0f5aaf0 Update dependency @testing-library/react to v10.4.8 (https://github.com/woocommerce/woocommerce-blocks/pull/2966)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-07 09:06:39 +12:00
Rua Haszard e18c036f5e use static pos for payment errors so they push out other content: (https://github.com/woocommerce/woocommerce-blocks/pull/2977)
- default styling for validation errors is absolute
- this requires the layout provides appropriate space for errors
- payment form is too compact to provide room for errors,
  - especially when checkout is narrow due to window or theme
2020-08-07 07:30:27 +12:00
Mike Jolley b680686c34 Add inspector notice for unsupported product types (https://github.com/woocommerce/woocommerce-blocks/pull/2944)
* Add notice for unsupported product types

* Simple products can be added to cart, not others
2020-08-06 10:28:20 -04:00
renovate[bot] bdb7044830 Update dependency @types/react to v16.9.44 (https://github.com/woocommerce/woocommerce-blocks/pull/2965)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-05 15:24:32 +02:00
Darren Ethier 733d29c3b9 Add section on configuring WordPress site
Includes required and recommended constants to define in wp-config.php for developing Woo Blocks.
2020-08-05 08:37:49 -04:00
Albert Juhé Lluveras d21a8950f4 Add missing class dot in theming docs (https://github.com/woocommerce/woocommerce-blocks/pull/2946) 2020-08-05 11:38:43 +01:00
Seghir Nadir 9ea9d0afd2 Add JETPACK_AUTOLOAD_DEV to wp-env instances (https://github.com/woocommerce/woocommerce-blocks/pull/2960) 2020-08-05 11:28:11 +01:00
Seghir Nadir 96819fc2d2 account for negative sale values (https://github.com/woocommerce/woocommerce-blocks/pull/2955) 2020-08-05 11:27:59 +01:00
Albert Juhé Lluveras fcf8f5c51f Show Checkout block in editor also when guest checkout is not allowed (https://github.com/woocommerce/woocommerce-blocks/pull/2958) 2020-08-05 10:35:38 +02:00
Albert Juhé Lluveras 5a300b91c2 Fix All Products block 'No products' placeholder link (https://github.com/woocommerce/woocommerce-blocks/pull/2961) 2020-08-05 10:35:08 +02:00
Rua Haszard afe77fb1e3 Show payment gateways in correct (merchant-configured) order (https://github.com/woocommerce/woocommerce-blocks/pull/2934)
* enqueue order of payment gateways as script data

* use configured gateway order for payment method tabs

* clarify name of payment gateway sort order setting

* fix formatting

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

* fix bug - express payment methods not working due to ordering logic:
- move ordering code to payment methods in usePaymentMethods hook;
  - this only applies to standard (non express) payment methods
- also any code that uses payment methods will get them in correct order

* why did this formatting not happen pre-commit?

* move method ordering into refreshPaymentMethods to avoid infinite loop:
- pass keys of express payment methods so they work correctly (show up)
- refreshPaymentMethods dispatches availablePaymentMethods to redux
  store; I suspect this was causing infinite loop as the callback
  depends on registeredPaymentMethods
- handle case when a payment method is not in PAYMENT_GATEWAY_SORT_ORDER
  - this happens with COD when dependent on shipping

* fix formatting

* use shallow equal to prevent refreshCanMakePayments infinite loop

* use native Set instead of lodash.union for unique gateway names

* code formatting

* check to ensure we register paymentGatewaySortOrder asset once only

* fix COD tab showing out of order if not available at page load:
- return ALL gateways in sort order array
  - note this includes gateways that are not enabled by merchant

* reinstate return bool from usePaymentMethods hook (broken in refactor)

* add basic typedefs for payment methods hooks

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-08-05 13:56:33 +12:00
renovate[bot] f70268b9ee Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2951)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-04 10:51:41 +02:00
Albert Juhé Lluveras e73e5ba3fe Simplify reviews render method (https://github.com/woocommerce/woocommerce-blocks/pull/2952) 2020-08-04 10:29:02 +02:00
Darren Ethier aebedc9930 Fixes related to Jetpack Autoloader 2.0 package bump (https://github.com/woocommerce/woocommerce-blocks/pull/2949)
* regenerate auto load maps after version change.

* make sure composer.json is updated with version change for deploys (also necessary for correct auto-load map regeneration)

* update WC tested up to string

* Detect if `JETPACK_AUTOLOAD_DEV` is defined in `wp-config.php` when developing the plugin.
2020-08-03 12:11:46 +02:00
Albert Juhé Lluveras 3d0d6cab87 Add autocapitalize attribute to Address Form fields (https://github.com/woocommerce/woocommerce-blocks/pull/2884)
* Add autocapitalize attribute to Address Form fields

* Set autocapitalize attribute to 'sentences' in address form
2020-08-03 10:53:42 +02:00
Darren Ethier 84e3cabcbf Update handling-releases.md
Clarify when package version bumps happen in WooCommerce core.
2020-07-31 14:55:19 -04:00
Albert Juhé Lluveras 311d8ddf12 Add 'Order notes' to Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2877)
* Add Checkout Order notes (UI)

* Add Checkout Order notes (context)

* Add missing useEffect dependencies

* Remove duplicate toggle in editor

* Minor fixes

* Check whether orderNotes have changed before creating a new state object

* Rename showCounter to showStepNumber

* Rename 'onChange' with 'onTextChange'

* Add comment and tests to FormStep component

* Rename 'with-counter' to 'with-step-number'

* Fix wrong prop

* Make it so order notes are persisted when toggling the checkbox

* Update type-defs

* Set showStepNumber default value to true
2020-07-31 17:17:01 +02:00
Mike Jolley 36c1bb7361 Add to cart context provider (https://github.com/woocommerce/woocommerce-blocks/pull/2903)
* Provider progress

* Revert nonce change for debugging

* Working emitters

* Fix dismiss link alignment in notices

* Fix button state and double adds

* Remove old context file

* Add type defs

* Fix context name

* Leftovers from merge

* Hooks up the variation picker to cart context

* Group event emitters in context

* Fix external product display

* Pass product through to VariationAttributes

* Pass around dispatchers

* Update assets/js/base/context/add-to-cart-form/form-state/reducer.js

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

* Update assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/attribute-select-control.js

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

* Update assets/js/base/context/add-to-cart-form/form-state/reducer.js

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

* remove placeholder comment

* content->container

* Clarify variation method comment

* update comment

* Switch nesting of providers

* Variation attribute utils test coverage

* If nothing is selected yet, just return all variations.

* Comments to explain loops

* Use refs to avoid recalculation of attributes on every render

* Update memo usage

* typo

* move mock data to test file

* Switch to useShallowEqual

* trigger cart fragment refresh after add to cart

* Decode option entities

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-30 11:57:22 +01:00
renovate[bot] fc3735564a Update dependency @octokit/graphql to v4.5.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2930)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 10:07:01 +01:00
renovate[bot] aa5bd62c93 Pin dependency glob to 7.1.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2927)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 10:06:49 +01:00
renovate[bot] 047f2d4323 Update dependency webpack to v4.44.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2933)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 10:06:20 +01:00
renovate[bot] bd3178b62e Update dependency eslint-plugin-jest to v23.19.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2932)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 10:04:52 +01:00
Albert Juhé Lluveras b29f5d4e86 Fix WP_CONTENT_DIR path in PHP unit tests (https://github.com/woocommerce/woocommerce-blocks/pull/2935) 2020-07-30 10:41:13 +02:00
Rua Haszard e2b82561bd enqueue and respect merchant option for disabling stripe express pay (https://github.com/woocommerce/woocommerce-blocks/pull/2920)
* enqueue and respect merchant option for disabling stripe express pay

* don't even register express payment method if merchant has disabled it

* add StripeServerData.allowPaymentRequest to typedef
2020-07-30 10:29:58 +12:00
Albert Juhé Lluveras de65c2ff8e Update version numbers to 3.2.0-dev 2020-07-29 18:20:17 +02:00
Albert Juhé Lluveras 2f2aa6280c Release: 3.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2938)
* Fix  missing permissions_callback arg in StoreApi route definitions (https://github.com/woocommerce/woocommerce-blocks/pull/2926)

* make sure permission_callback is set correctly for all public routes

* add permission_callback definition to all routes

* add hover style to ensure consistent margin/padding for order summary so it doesn't jump on mouseover (https://github.com/woocommerce/woocommerce-blocks/pull/2921)

* add hover style to ensure consistent margin/padding for order summary

* decrease specificity of panel__button hover/active etc styles

* Add 3.1.0 testing instructions

* Update WP tested up to version to 5.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2937)

* Fix typo in state property for idle status in checkout state reducer (https://github.com/woocommerce/woocommerce-blocks/pull/2925)

* fix typo in state property for idle status in checkout state reducer

* remove arg causing failure in phpunit tests on travis

* Add 3.1.0 changelog

* Added ZIP file to 3.1.0 testing docs

* Update wp.deploy workflow adding slack hook (https://github.com/woocommerce/woocommerce-blocks/pull/2939)

This will notify rubik's slack channel when this workflow starts and finishes.

* Add testing docs for regressions

* Update 310.md

* Update 310.md

* Add more details to testing doc

* Fix reviews blocks in WP 5.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2940)

* Fix Reviews editor styles (https://github.com/woocommerce/woocommerce-blocks/pull/2941)

* Update ZIP link

* Fix testing doc title hirerarchy

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-07-29 18:01:01 +02:00
Albert Juhé Lluveras 7e6968e68e Fix Reviews editor styles (https://github.com/woocommerce/woocommerce-blocks/pull/2941) 2020-07-29 16:07:21 +02:00
Albert Juhé Lluveras 8d21c7257e Fix reviews blocks in WP 5.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2940) 2020-07-29 16:06:44 +02:00
Albert Juhé Lluveras 8ace5dbcf8 Add attributes and view toggle tests to the Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/2883)
* Add more tests to the Cart block

* Add page settings

* Cleanup
2020-07-29 14:39:15 +01:00
Darren Ethier ae1e2c3dcd Update wp.deploy workflow adding slack hook (https://github.com/woocommerce/woocommerce-blocks/pull/2939)
This will notify rubik's slack channel when this workflow starts and finishes.
2020-07-29 13:36:33 +02:00
Darren Ethier a0b28f2a06 Fix typo in state property for idle status in checkout state reducer (https://github.com/woocommerce/woocommerce-blocks/pull/2925)
* fix typo in state property for idle status in checkout state reducer

* remove arg causing failure in phpunit tests on travis
2020-07-29 13:00:26 +02:00
Albert Juhé Lluveras 9e79b0cbf3 Update WP tested up to version to 5.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2937) 2020-07-29 12:59:32 +02:00
renovate[bot] f8366be2c9 Update Node.js to v12.18.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2928)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-29 11:20:34 +01:00
Rua Haszard 2cc98391a0 add hover style to ensure consistent margin/padding for order summary so it doesn't jump on mouseover (https://github.com/woocommerce/woocommerce-blocks/pull/2921)
* add hover style to ensure consistent margin/padding for order summary

* decrease specificity of panel__button hover/active etc styles
2020-07-29 11:50:06 +02:00
Darren Ethier 92985bd201 Fix missing permissions_callback arg in StoreApi route definitions (https://github.com/woocommerce/woocommerce-blocks/pull/2926)
* make sure permission_callback is set correctly for all public routes

* add permission_callback definition to all routes
2020-07-29 10:39:54 +02:00
renovate[bot] afe86d53b6 Update dependency @testing-library/jest-dom to v5.11.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2931)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-29 14:25:21 +12:00
Darren Ethier b091ef151f fix build:deploy script. 2020-07-28 12:03:43 -04:00
renovate[bot] 1a21b1e6ca Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2916)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-28 11:48:38 +01:00
Darren Ethier e6d4b58828 update package-lock with dev version 2020-07-27 10:57:51 -04:00
Darren Ethier c9b88620a1 bump dev version 2020-07-27 10:56:35 -04:00
renovate[bot] ab8e30e41c Update dependency reakit to v1.1.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2865)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 16:35:13 +01:00
renovate[bot] 7fbfcd56c2 Update dependency autoprefixer to v9.8.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2863)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 15:06:24 +00:00
renovate[bot] 00e97d92a1 Update dependency webpack to v4.43.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2902)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 15:31:46 +01:00
renovate[bot] 9becff0ae0 Update dependency eslint-plugin-jest to v23.18.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2830)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 15:05:01 +01:00
renovate[bot] f05057a666 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2790)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 14:44:47 +01:00
renovate[bot] f082e1f60c Update dependency request-promise to v4.2.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2901)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 14:42:26 +01:00
renovate[bot] 7f9fb19e9e Update dependency @testing-library/jest-dom to v5.11.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2898)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 14:39:41 +01:00
renovate[bot] ce53bb908f Update dependency @octokit/graphql to v4.5.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2897)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 14:23:17 +01:00
renovate[bot] ed28e8252b Update dependency typescript to v3.9.7 (https://github.com/woocommerce/woocommerce-blocks/pull/2866)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 13:51:25 +01:00
renovate[bot] 1a8e270fe4 Update dependency html-react-parser to v0.13.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2864)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 13:44:45 +01:00
renovate[bot] 0fb10a6396 Update dependency @types/react to v16.9.43 (https://github.com/woocommerce/woocommerce-blocks/pull/2862)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 13:28:48 +01:00
renovate[bot] 229afc281e Update babel monorepo to v7.10.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2861)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 13:23:47 +01:00
Phellipe K Ribeiro 2db08a1383 Add query filter when searching for a table (https://github.com/woocommerce/woocommerce-blocks/pull/2886)
* Add query filter when searching for a table

* Fix lint errors
2020-07-22 15:50:46 -04:00
Darren Ethier 59ca5ad19c Release: 3.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2887)
* add changelog to readme.txt

* Add testing docs for release

* add some new commands to help with release testing phase

* Add testing notes for 3.0.0

* fix testing note typo

* updae notest to reference the new package-plugin:deploy script for use as part of the release process

* Add note about creating manual tag for the release.

* automate creation of dev tag for release.

* remove release branch from travis branches because we now do pull requests for releases

* remove duplicate back order badge for cart (https://github.com/woocommerce/woocommerce-blocks/pull/2890)

* update zip link in testing notes

* only update stable version in readme.txt if not a pre-release

* Add handling for conditional github release creation based on WP deploy question

* add distignore fir wp deploy builds

* Cart & Checkout: fix '0' visible when product stock was 0 and it allowed backorders (https://github.com/woocommerce/woocommerce-blocks/pull/2891)

* Create wordpress-deploy.yml

* fix cod not accounting for global rate values (https://github.com/woocommerce/woocommerce-blocks/pull/2894)

* ensure we’re only running checks for `wc_reserved_stock` table when necessary (https://github.com/woocommerce/woocommerce-blocks/pull/2895)

* update readme.txt changelog

* remove unnecesary variable definitions

* update github deploy script

* Bumping version strings to new version.

* add missing step for checking out code from tag

* fix exclusion for docker-compose.yml

* fix zip name (it differs from repository name)

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-07-22 12:36:55 -04:00
Darren Ethier 34de45c6fe update release docs to include details on new automation 2020-07-22 10:11:55 -04:00
Darren Ethier 29db167a38 Update wordpress-deploy.yml
Add missing step for checking out code from tag
2020-07-22 09:32:28 -04:00
Darren Ethier 7e206c9481 Create .distignore
Add .distignore file that will be used for wp-deploy action.
2020-07-22 09:14:45 -04:00
Mike Jolley cd9f7e0ccb ⚛️ Introduce Product Element Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2871)
* Product selection when out of context for price and title blocks

* Move product element name/description/icons to constant files

* Add attributes and hocs to all elements

* Standalone block rendering

* Add a placeholder if title has no content

* Revert "Add a placeholder if title has no content"

This reverts commit 29115154b33eedc661ccd3cc758acdbc5041ffbc.

* parentClassName is not always present

* Loading state

* Wrap description in P

* Fixed loading styles when nested

* Maintain product shape in useProductData

* feature gate elements from showing in inserter

* fix feature flag

* include price PR

* edit withProductSelector to be a hoc

* fix lint issue

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-07-22 13:20:54 +01:00
Albert Juhé Lluveras ff2f135e7e Make stylesheets order consistent between build and dev (https://github.com/woocommerce/woocommerce-blocks/pull/2818)
* Add specific webpack config for styles

* Remove style.scss file from story

* Fix storybook

* Extract progressbarplugin config

* Add back ignore-loader

* Fix styling entries

* Cleanup

* Simplify webpack-entries.js

* Add appropiate exclude handles to styling config

* Add back MergeExtractFilesPlugin

* Unify style entries suffix

* Fix experimental flag

* Replace MergeExtractFiles plugin with RemoveFiles

* Prevent duplicate reviews frontend scripts

* Fix unnecessary files being created

* Remove editor.js file generate by MiniCssExtractPlugin

* Remove CSS generation from payment methods config

* Remove unnecessary config

* Simplify styling entries name

* Cleanup

* Refactor webpack-entries
2020-07-22 14:05:56 +02:00
renovate[bot] a59529c719 Update dependency @testing-library/react to v10.4.7 (https://github.com/woocommerce/woocommerce-blocks/pull/2899)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-22 11:39:58 +02:00
renovate[bot] 02a9851a28 Update dependency use-debounce to v3.4.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2900)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-22 10:16:09 +01:00
Darren Ethier aef46f57e8 ensure we’re only running checks for `wc_reserved_stock` table when necessary (https://github.com/woocommerce/woocommerce-blocks/pull/2895) 2020-07-21 16:27:58 -04:00
Darren Ethier 21b7637ef5 fix cod not accounting for global rate values (https://github.com/woocommerce/woocommerce-blocks/pull/2894) 2020-07-21 15:57:21 -04:00
Darren Ethier ebf3b6a61a Create wordpress-deploy.yml 2020-07-21 13:56:43 -04:00
Albert Juhé Lluveras a69a50856a Cart & Checkout: fix '0' visible when product stock was 0 and it allowed backorders (https://github.com/woocommerce/woocommerce-blocks/pull/2891) 2020-07-21 17:41:14 +02:00
Seghir Nadir 9eabf73a65 Update ⚛️ Product Price (https://github.com/woocommerce/woocommerce-blocks/pull/2881)
* use currency as block symbol

* add color and font size support for price block

* support align

* revert to two options

* fix feature gating
2020-07-21 14:28:59 +01:00
Seghir Nadir 5299d7267b Update ⚛️ ‎‎‏‏‎ Product Title (https://github.com/woocommerce/woocommerce-blocks/pull/2860)
* rename heading-toolbar to heading-switcher

* update icon

* add controls to title block

* fix typos in css rules

* feature gate changes in Product Title

* fix jsdoc types

* fix onChange param

* fix missing textDomain

* fix modifier prefix

* move styling to util

* hardcode line height

* move settings near color
2020-07-21 14:27:41 +01:00
Albert Juhé Lluveras 4ef64a4453 Fix Credit Card input font size in some themes (https://github.com/woocommerce/woocommerce-blocks/pull/2869)
* Fix Credit Card input font size in some themes

* Fix spacing between credit card icon and input label

* Fix min-width of credit card input fields

* Improvements to the way credit card input fields are resized

* Simplify min-width
2020-07-20 13:56:22 +02:00
Mike Jolley fca4598866 Fix undefined index 'enabled' for multiple payment method registrations (https://github.com/woocommerce/woocommerce-blocks/pull/2878)
* get settiing helper

* Make use of helper when getting settings
2020-07-20 11:50:22 +01:00
Darren Ethier 4cc3990af1 Update CODEOWNERS
fix incorrect team assignment
2020-07-17 11:14:31 -04:00
Albert Juhé Lluveras c11b7e5dc5 Extract progressbarplugin config (https://github.com/woocommerce/woocommerce-blocks/pull/2875) 2020-07-17 10:55:55 -04:00
Darren Ethier cc5fef8994 release docs for 2.7.2 2020-07-16 14:12:22 -04:00
Darren Ethier 60b1422cf6 Move Draft order logic behind feature flag. (https://github.com/woocommerce/woocommerce-blocks/pull/2874)
* refactor all draft order functionality to be in it’s own class and feature gate it.

* move and fix tests for draft order deletes

* add test to ensure only draft orders are deleted

* implement review feedback and assert valid results before deleting

* update tests

* doh method can’t be protected

* fix conditional for removing scheduled action

* switch to use Woo Core function for catching the exception

* add tests for error handling.

* use `$wpdb->prepare` and remove temp group on test
2020-07-16 12:19:31 -04:00
Rua Haszard aee97ceb3f Support cash on delivery payment method in checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2831)
* stub out COD payment method for checkout block

* consistently use sentence case for (default) payment tab labels

* expose COD `enable_for_virtual` option to client

* correct docblock return value comment Stripe::get_inline_cc_form()

* allow merchant to disable COD payment for virtual/downloadable orders

* tweak canMakePayment dev docs - add cart-dependent example use case

* only allow (show) COD if initially-selected shipping method(s) allow

* tweak `canMakePayment` payment extension API docs

* use $VID:$ substitution for `@since` version in new payment methods

* use FILTER_VALIDATE_BOOLEAN for payment method boolean options

* use more semantic `some` when hunting for COD-unsupported shipping

* clarify `canMakePayment` API docs

* re-select payment method if selected method disappears (e.g. COD) +
+ factor out early return into separate if at top for clarity
2020-07-15 10:14:41 -04:00
renovate[bot] 08969b7fb8 Update dependency @testing-library/react to v10.4.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2829)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-15 10:33:10 +01:00
Albert Juhé Lluveras 8bfb95c808 Deregister core cart/checkout scripts and styles when rendering the blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2842)
* Deregister core cart/checkout scripts and styles when rendering the blocks

* Fix regression: redirect to full cart when adding a product from empty cart

* Make it so it scrolls to the top

* Update assets/js/base/utils/legacy-events.js

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

* Add check for jQuery availability

* Listen to removed from cart event too

* Remove unnecessary useEffect dependency

* Remove jQuery event subscriptions on component unmount

* Fix tests

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-14 15:46:44 -04:00
Albert Juhé Lluveras d894fed1df Cart block: show products on backorder (https://github.com/woocommerce/woocommerce-blocks/pull/2833)
* Show backorder notice in the Cart block

* Don't render variation <div> if empty

* Create ProductBackorderNotification component

* Add product backorder notification to the checkout block

* Fix classname and comment

* Rename notification->badge and don't show low stock badge if backorder is shown

* Use ternary to dispaly backorder/low stock badge
2020-07-14 17:25:53 +02:00
Mike Jolley be513c8875 Lazy Loading Atomic Components (https://github.com/woocommerce/woocommerce-blocks/pull/2777)
* Implement lazy loading with basics spinner

* Add chunkFilename

* chunkFilename breaks render

* Suspense at inner block level

* Suspense for all products block

* Update assets/js/atomic/blocks/component-init.js

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

* Handle lazy components in registerBlockComponent

* update tests

* Update locks

* Update assets/js/blocks-registry/block-components/register-block-component.js

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

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-14 12:35:15 +01:00
Rua Haszard 1df11f5461 allow payment methods to disable based on shipping (API change) (https://github.com/woocommerce/woocommerce-blocks/pull/2840)
* allow payment methods to disable based on shipping or other factors:
- renamed 'initialized' array 'available' to match primary purpose of
  `canMakePayment` api - whether payment method should be available
- trigger refresh of available payment methods when shopper chooses
  different shipping method
- rename resolveCanMakePayments => refreshCanMakePayments
- tweaked some variable names and scope for clarity
- added comments to clarify things

Note this should not affect behaviour yet - no existing payment methods
use this new feature. COD payment method will need this - woocommerce/woocommerce-blocks#2831

* optimise refreshCanMakePayments:
- useShallowEqual to avoid unnecessary call when shipping methods have
not actually changed (but object value has)

* replace ("set") payment methods in store, was appending:
- payment methods may come and go depending on cart/checkout state
- the previous SET action appended provided payment methods to the
  collection
- this prevents dynamic payment methods e.g. COD from being able to hide
  i.e. disable

* cache test payment request to avoid unnecessary stripe API calls:
- in the canMakePayment callback there's a test payment to determine if
  chrome pay/apple pay is set up and available
- canMakePayment is now called multiple times as checkout state changes
- now the results of the test payment are stored in variable, and
  returned on subsequent calls

* set init flag to avoid additional attempts to init stripe API:
+ tweak naming of init flag
2020-07-14 10:52:13 +12:00
renovate[bot] ea1435457a Update dependency @stripe/stripe-js to v1.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2828)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-13 15:20:23 +02:00
Albert Juhé Lluveras 0f43c3af0f Remove classes from dashicons (https://github.com/woocommerce/woocommerce-blocks/pull/2848) 2020-07-10 14:20:57 -04:00
Albert Juhé Lluveras 8c06276b00 Unify Chip styles (https://github.com/woocommerce/woocommerce-blocks/pull/2765)
* Improve cross character used in dropdown selector

* Add is-open and has-checked classes to dropdown selector so we stop relying on complex pseudoselector combinations

* Update Chip component with new props

* Update Chip styles

* Update dropdown selector selected chip with the Chip component

* Update active filters chip with the Chip component

* Style fixes

* Update snapshots and add tests

* Change onRemove prop signature

* Fix wrong bottom margin

* Fix misaligned remove icon

* Update assets/js/base/components/chip/index.js

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

* Update assets/js/base/components/chip/index.js

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

* Add missing default prop

* Prettier

* Ensure showScreenReaderText is a bool

* Rename removeOnClick with removeOnAnyClick

* Update snapshots

* Fix Chip aria-label logic

* Split Chip and RemovableChip

* Replace chip close character with an icon

* Fix outdated comment

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-10 11:09:49 +02:00
Darren Ethier 92067c0d04 update automattic/jetpack-autoloader to 2.0 branch (https://github.com/woocommerce/woocommerce-blocks/pull/2847) 2020-07-10 10:54:55 +02:00
Rua Haszard de91ead0db lots of release process doc tweaks (https://github.com/woocommerce/woocommerce-blocks/pull/2832)
* lots of release process doc tweaks:

- add outcomes for all H4s (we may be able to remove some similar material from "body" content)
- mention that svn is needed
- clarify relationship to PR and PR checklist in a few places
  - we have 2 docs to follow now, which could be confusing
- clarify release metadata step - this is metadata, not version number
- clarify relationship to woo core
- add dev blog post as final happy 🎉 step

* fix typo

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

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-10 09:20:08 +12:00
Albert Juhé Lluveras d12ffcd4e5 Update minimum required versions in readme.txt to align it with readme.md (https://github.com/woocommerce/woocommerce-blocks/pull/2834) 2020-07-09 12:36:52 -04:00
renovate[bot] a38203f2c2 Pin dependency rimraf to 3.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2827)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-08 13:10:23 +12:00
Rua Haszard 1d364a04bf Support bank transfer (BACS) payment method in checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2821)
* stubs for bank transfer payment method

* allow merchant to disable BACS payment method

* show customised BACS title & description in checkout

* re-add entry point for BACS payment method (lost in rebase)
2020-07-08 12:39:16 +12:00
Albert Juhé Lluveras 2fadea064e Document Cart & Checkout button styles (https://github.com/woocommerce/woocommerce-blocks/pull/2814)
* Reduce specificity of some button styles

* Submit container: make it possible for themes to change the shadow color without the need to rewrite shadow values

* Use background-color instead of background property in docs

* Add docs to style the button and the submit container

* Remove border from button

* Add back state styles to button component

* Docs improvements

* Undo unncessary changes in button component styles

* Add spaces
2020-07-07 11:59:51 +02:00
Albert Juhé Lluveras adfecb4259 Split up webpack files for better readability (https://github.com/woocommerce/woocommerce-blocks/pull/2817)
* Split up webpack files for better readability

* Fix storybook

* Fix tests

* update progress-bar-webpack-plugin and implement better feedback

- updates progress-bar-webpack-plugin to latest version which includes more granular output of what webpack event is being processed.
- Improve asset build complete summary to include what build was completed.

* remove unnecessary s suffix

* Add back package-lock

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-07 11:05:06 +02:00
Albert Juhé Lluveras 9c1c075be9 Don't load frontend scripts in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/2788)
* Move register_block_script and get_block_asset_build_path to src/Assets/Api

* Only load block scripts in the frontend

* Fix version_compare numbers so they match 5.2.x versions

* Use register_scripts from AssetApi class
2020-07-07 10:15:46 +02:00
Rua Haszard 6232bad7c3 2.10.0-dev next-version bump 2020-07-07 11:23:22 +12:00
Rua Haszard d664d27fa6 Release: 2.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2816)
* update version number in readme.txt

* 2.9.0 changelog

* flesh out changelog + consistent punctuation

* fix changelog prefixes

* remove extraneous .

* testing instructions for 2.9.0

* tweak testing instructions - delete shortcode

* 2.9 version in package-lock

* 2.9 version numbers

* 2.9 release version in package-lock

* Bumping version strings to new version.
2020-07-07 11:19:17 +12:00
Mike Jolley 8cd96950e8 Reviews by product/category e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/2808)
* Tests for reviews by product

* reviews by category
2020-07-06 14:48:39 -04:00
Darren Ethier e3dc2e9c86 Update javascript-testing.md 2020-07-03 08:11:00 -04:00
Albert Juhé Lluveras 2013c5e0f5 Dashicon module replacement: prevent cloning a non-element (https://github.com/woocommerce/woocommerce-blocks/pull/2804) 2020-07-03 10:51:37 +02:00
Rua Haszard c49a7af270 add basic docs for running e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/2800)
* add basic docs for running e2e tests

* shift common dependencies info to top, clarify iterate-test comment

* link out to wp-env docs

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

* remove extra bracket, tweak wp-env docs link

* typo

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-03 09:26:23 +12:00
Seghir Nadir 81570d733c Tweak some logic in our cart Integration test. (https://github.com/woocommerce/woocommerce-blocks/pull/2778)
* Fix Cart test async logic

* tweak test

* refactor test to not call response twice

* add comment for why we're calling fetch twice

* fix duplicate calls

* reset empty test to normal value

* switch to mockResponse

* convert comment to todo block

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-02 15:10:19 -04:00
Darren Ethier 76ab006219 bump versions to 2.9.0-dev 2020-07-02 09:51:05 -04:00
Seghir Nadir 7ed01f9254 Release: 2.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2768)
* update readme file

* add testing docs

* Bumping version strings to new version.
2020-07-02 09:48:08 -04:00
Rua Haszard 29e7aa9bdf basic e2e test for instantiating All Reviews block (https://github.com/woocommerce/woocommerce-blocks/pull/2799)
* add e2e test for instantiating All Reviews block:
- adapted code from @senadir in-progress PR
https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2756

* remove pptr-testing-library - not needed for this test

* Don't skip tests for the review block on < 5.3

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-07-02 11:32:42 +01:00
renovate[bot] 661ebc196a Update dependency autoprefixer to v9.8.4 (https://github.com/woocommerce/woocommerce-blocks/pull/2797)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-02 07:59:02 +02:00
renovate[bot] c417003e56 Update babel monorepo to v7.10.4 (https://github.com/woocommerce/woocommerce-blocks/pull/2794)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-02 07:53:31 +02:00
renovate[bot] 5bdba6f0a3 Update Node.js to v12.18.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2793)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-02 07:50:59 +02:00
renovate[bot] 346ce3ae16 Update dependency @testing-library/jest-dom to v5.11.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2795)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-02 07:50:43 +02:00
renovate[bot] cdf75babed Update dependency @types/react to v16.9.41 (https://github.com/woocommerce/woocommerce-blocks/pull/2796)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-01 16:10:16 +02:00
renovate[bot] 30b1f0fb38 Update dependency css-loader to v3.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2798)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-01 16:06:14 +02:00
Rua Haszard cb4ee3e632 update wporg readme docs to link to primary docs on docs.woocommerce.com (https://github.com/woocommerce/woocommerce-blocks/pull/1758)
* link to official docs in WPORG readme and remove old block docs

* simplify block list in readme - remove inline docs + add cart/checkout
2020-07-01 11:50:28 +01:00