Commit Graph

2256 Commits

Author SHA1 Message Date
Albert Juhé Lluveras e125dfd97b Fix radio controls and checkboxes in Twenty Twenty One dark theme (https://github.com/woocommerce/woocommerce-blocks/pull/3446)
* Fix radio controls in Twenty Twenty One dark theme

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

* Adjust placeholder color if css variable exists

This is 2021 specific but may become more prominant.

* FIx editor button styles in 2021

* Adjust button sizes based on columns

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

* Fix price slider styling in Twenty Twenty One

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

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

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

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

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

* Remove links from CartLineItemRow if not visible in catalogue

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

* Add hasLink prop to ProductName

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

* Add tests and storybook for ProductName

* Add catalog_visibility check to OrderSummaryItem

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

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

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

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

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

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

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

* update package-lock.json

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

* Remove empty data when normalising

* combine conditonals

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

* Sync shipping address changes with billing data

* Update inline documentation

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

* Avoid loading shipping address from customer is shipping is disabled

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

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

* Add action that combines billing and shipping updates

* Add route for updating billing and shipping address

* Sync billing data to server on change

* Shared constants for billing data

* Skip address update if missing country

* Allow null values to skip formatting

* Add billing to cart schema

* Removed unwanted hooks from previous commit

* Decoding is handled in useStoreCart

* Remove hook

* Make shipping context hold state

* Make billing context hold state

* Add address processors

* Cart does not have billing

* Update tests, remove some unrelated changes affecting the diff

* Revert "Update inline documentation"

This reverts commit 0393f49316de3152c6dcf6fda1192c06a74f1b55.

* Make shippingRatesAreResolving conditonal based on API request

* Shared address processor in cart and checkout

* Rename REST endpoint

* CustomerDataProvider and hook

* Update shipping address type defs

* Rename customer address endpoint, and remove update-shipping

* Update tests

* Fix tests by restoring country validation

* typo

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

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

* Simplify debounce and request handling

* Remove state from address sync

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

* Rename shipping rates loading to customer data loading

* Sync based on useStoreCart data

* Made cart API less strict on addresses

* Fix useCheckoutAddress sync

* Add note on currentShippingAsBilling

* Use incoming isCart

* Add more detailed inline comment for shippingAsBilling toggle event

* Combine customer billing and shipping ref

* Update address docblock

* Error handling in pluckAddress

* Fix cart response after rebase

* Update customer tests

* Update src/StoreApi/Routes/CartUpdateCustomer.php

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

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

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

* Add disabled class & style for disabled FormStep components

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

* Update test snapshot for FormStep

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

* Remove redundant selector from form-step styles

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

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

* Remove position rule from checkout-step heading content

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

* Force payment methods to react to order totals change

* Fix express payments reducer so it overwrites

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

* update Stripe for new registerPaymentMethod interface

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

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

* use correct case for `JavaScript`

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

* typedefs for payment registration options + tidies for regular methods

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

* mention typedefs in payment method dev docs

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

* update unit tests for new payment method API

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

* update package-lock.json

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

* Hook into order query args

* Add comments before applying filters

* Revert "Add comments before applying filters"

This reverts commit 83b695665c05a3a9e7669e8777080c6ff10d8421.

* Revert "Hook into order query args"

This reverts commit 94cec6c83cf5b5ce05cd106daf217c0b08f13a03.

* Hide draft orders from My Account > Orders

* Move filter to its own file

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

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

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

* The shipping total row is missing a border

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

This reverts commit f3a4f24f5785392eb43bfc69a5548d398c47d8bb.

* Add hasCalculatedShipping to schema and hooks

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

* Refactor shipping row display to use new API props

* Remove block level isShippingCostHidden

* fix test

* Correct the math in the shipping preview in cart

* Document null

* Remove test—this option no longer exists

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

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

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

* Decode entities in responseData

* Correctly handle checkoutResponse props

* Show one error at a time from express methods

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

* Add legacy methods

* Inject a FeatureGating class instance into Package

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

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

* return before assign

* fix phplint errors

* declare Throwable

* remove empty init

* return initial data if shape is not correct

* Add IDENTIFIER to schema classes

* refactor ExtendRestApi to not use filters

* remove extra check

* implement ExtendRestAPI injected into StoreAPI schemas

* use $extend instead of $extend_schema

* fix phpcs issues

* update schema

* fix data type

* address review

* fix object cast

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

* add `discount_type` field to coupon API docs

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

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

* Update package-lock.json

* Update dependencies order.

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

* Update package-lock.json

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

* Update package-lock.json

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

* Update package-lock.json

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

* Update package-lock.json

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

* Update changelog for the 3.8.0 release.

* Update testing instructions.

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

* verify draft order object instance before using

* ensure per_page value is cast to integer

* correctly account for categories value and type in conditional

* add more instanceof checks

* Correct variable name in array check

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

* shouldCreateAccount context docs

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

* Only render notes if needed

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

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

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

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

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

* use public api for registration settings (via WC_Checkout)

* initial round of test fixes

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

* return early if WC_Checkout is not available

* remove temporary test group and uncomment new test.

* improve test method name

* fix comment to match new routine name

* ensure block shows login prompt when store disables checkout signup

* fix incorrect conditional order and cover with tests

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

* Update package-lock.json

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

* Update package-lock.json

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

* Update package-lock.json

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

* Update package-lock.json

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

* Update package-lock.json

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

* Update package-lock.json

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