Commit Graph

2019 Commits

Author SHA1 Message Date
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