Commit Graph

2666 Commits

Author SHA1 Message Date
renovate[bot] ae69316957 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4253)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-24 16:40:05 +01:00
Michael P. Pfeiffer 297254eaf7 Block Widgets: hide legacy widgets with a feature-complete block equivalent (https://github.com/woocommerce/woocommerce-blocks/pull/4237)
* Block Widgets: hide legacy widgets with block equivalent

* Unhide Products and Products by Rating widgets
2021-05-21 09:53:46 +02:00
Michael P. Pfeiffer cfad13f3a2 Block Widgets: hide All Products and Filter blocks in the Customizer (https://github.com/woocommerce/woocommerce-blocks/pull/4225) 2021-05-21 09:52:27 +02:00
Thomas Roberts ee9b2d20e0 Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)
* Move text-input to checkout package

* Pass validation props directly to ValidatedTextInput

* Import label relatively instead of from package

* Pass validation functions to ValidatedTextInput

This is so it doesn't need to get them from useValidationContext.

* Add InputProps to ValidatedTextInput

This will be used to control additional props on the input element of TextInput

* Spread inputProps onto <input> element of TextInput

* Export TextInput from @woocommerce/blocks-checkout

* Add @woocommerce/blocks-checkout package to tsconfig

* Allow styling to be applied to number inputs and when value is 0

* Make style order consistent

* Remove inputProps to rely on rest in TextInput

* Add specific prop for the inputErrorComponent

* Only disallow active state if value is 0 AND type is number

* Change all uses of ValidatedTextInput to also pass inputErrorComponent

* Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent"

This reverts commit ec734b99c20c4d29fcf778714246fc406ee37eaf.

* Revert "Remove inputProps to rely on rest in TextInput"

This reverts commit 1fc64cca4002206423d1fa443ff2d60130ba1ea0.

* Revert "Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent""

This reverts commit 110e3606a996668be5a32698b634b7706d16cddc.

* Revert "Revert "Remove inputProps to rely on rest in TextInput""

This reverts commit aeb03526c44b3fcc97a719a18930d08157a80baf.

* Don't pass errorMessage to ValidatedTextInput
2021-05-20 17:56:56 +01:00
Mike Jolley 1ad39d6eac Create LICENSE (https://github.com/woocommerce/woocommerce-blocks/pull/4235) 2021-05-20 15:07:12 +01:00
Albert Juhé Lluveras c94187e450 Update @woocommerce/components (https://github.com/woocommerce/woocommerce-blocks/pull/4100)
* Add isCompact prop to components using SearchListControl

* Update @woocommerce/components to 6.1.2

* Remove legacy CSS code

* Add some CSS rules to override conflicting editor styles

* Replace showCount prop with has-count class name

* Create ExpandableSearchListItem component

* Refactor ProductControl so it uses ExpandableSearchListItem

* Update @woocommerce/components to 6.2.0

* Fix @woocommerce/components builds breaking

* Fix a11y of expandable item list children

* Set categories to an empty array by default

* Render compact control in Attribute filter sidebar

* Add countLabel to ProductAttributeTermControl

* Fix ProductTagControl selected items

* Use sentence case for countLabel

* Fix wrong margins in block editor

* Fix checkbox alignment

* Update package-lock.json

* Fix withCategories test

* Fix JS error in Filter Products by Attribute block

* Make input ids unique
2021-05-20 10:58:59 +02:00
Thomas Roberts 26a84cedde Convert TextInput and ValidatedTextInput to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4226)
* Change index file from base/context to .ts

This is to stop TS complaining when importing things from here.

* Convert ValidatedTextInput to TypeScript

* Convert TextInput to TypeScript

* Ensure Label accepts correct HTML Attributes Props

* Remove PropTypes from TextInput and ValidatedTextInput

No longer needed because of TypeScript

* Use correct error id to show validation message

* Use HTMLElement instead of a specific element type for LabelProps

* Update assets/js/base/components/text-input/validated-text-input.tsx

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

* Update assets/js/base/components/text-input/validated-text-input.tsx

* Use correct formatting in ValidatedTextInput

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-05-19 10:55:15 +01:00
renovate[bot] 5d595de6f5 Update dependency @testing-library/react-hooks to v5.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/4233)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-19 07:36:46 +00:00
renovate[bot] f99b95c2bf Update dependency @types/lodash to v4.14.169 (https://github.com/woocommerce/woocommerce-blocks/pull/4234)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-19 04:36:44 +00:00
renovate[bot] d621f0aff8 Update dependency @testing-library/react to v11.2.7 (https://github.com/woocommerce/woocommerce-blocks/pull/4232)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-19 03:46:21 +00:00
renovate[bot] dbcc0c80f2 Update dependency @stripe/react-stripe-js to v1.4.1 (https://github.com/woocommerce/woocommerce-blocks/pull/4231)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-19 02:48:45 +00:00
renovate[bot] 69343e478e Pin dependency @types/wordpress__deprecated to 2.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/4229)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-19 01:32:34 +00:00
Raluca Stan 092a28848c Fix e2e checkout tests and adjust jest setup (https://github.com/woocommerce/woocommerce-blocks/pull/4216)
* Fix checkout test
- make tests independent & test also for empty cart case
- make sure the Order summary is expanded with a better selector
* Remove unnecessary localStorage operations from tests
* Go to cart page before removing an item from cart
* Remove logging observing before tests
This removes unnecessary console.log interception. A big part of the logic was done for Puppeteer 1.6.1, but since 3.0.0 message.text() returns string. We allow console.error messages to surface in our tests. Although they don't cause the test to fail it might be a good addition for debugging purposes.
2021-05-18 15:09:30 +02:00
renovate[bot] 0f3c601f34 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4212)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-18 11:27:27 +01:00
Mike Jolley c123dfdeba Convert checkout state context provider to Typescript (https://github.com/woocommerce/woocommerce-blocks/pull/4200)
* git move to ts files

* Type the checkout state provider

* Restore for loop for error handling

* Types not needed

* Consolodate response handling

* Unused import

* Fix defaults for onCheckoutAfterProcessingWithSuccess etc

* Type useEmitResponse and remove isObject checks

* useEmitResponse as const

* Check that redirectUrl is string

* Define actions as const

* data.redirectUrl should be truthy

* Add redirectURL todo item as followup

* remove null fallback
2021-05-18 10:37:31 +01:00
Thomas Roberts 983ce48cad Move Button and Label components to `@woocommerce/blocks-checkout` package (https://github.com/woocommerce/woocommerce-blocks/pull/4222)
* Move Button to checkout package

* Move Label to Components Package
2021-05-18 09:10:31 +01:00
Thomas Roberts 57c5b0c532 Update design of cart and checkout sidebars (https://github.com/woocommerce/woocommerce-blocks/pull/4180)
* Update cart/coupon/shipping design

* Add order summary heading

* Move and style discounts on checkout sidebar

* Add rate to tax lines

* Ensure the option to display taxes itemised is available to Cart block

* Output individual tax items below the total & add styles for this

* Add success notice under coupon input on successful coupon addition

* Add border to bottom of Totals footer

* Show success message when adding coupon

* Add padding to cart item rows

* Add preview data to cart for when taxes are enabled

* Add rate to cart response type

* Add showRateAfterTaxName attribute to Cart block

* Add control to cart block to show rate percentage after rate name

* Add rate % in cart totals only if option is toggled on

* Pass showRateAfterTaxName attribute down to TotalsTaxes

* Add showRateAfterTaxName to Checkout block

* Add control to block editor for showRateAfterTaxName on Checkout

* Pass showRateAfterTaxName down to TotalsTaxes in Checkout

* Change label for showing tax rates in cart and checkout blocks

* Add test to ensure Taxes section shows in Cart block

* Add tests for cart sidebar and rate percentages

* Remove order summary title from checkout sidebar

* Check if taxes are enabled before rendering the option to show rate %s

* Add ShippingVia component to show the selected rate in sidebar

* Remove value from individual tax rates

* Remove bold from Shipping via label

* Remove coupon added successfully message

* Ensure panel headings that are h2s are the same colour as others

* Clean up eslint warnings

* Show rate %s by default

* Update snapshots following design changes

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-05-17 15:00:57 +01:00
Albert Juhé Lluveras b14b557c91 Don't default to fallback in getSetting if value is falsy (https://github.com/woocommerce/woocommerce-blocks/pull/4202) 2021-05-16 19:00:06 +01:00
Mike Jolley bcac811d7c Fix es lint warnings (https://github.com/woocommerce/woocommerce-blocks/pull/4206)
* Un-used PropTypes import

* Avoid global and use ownerDocument

* receiveCart return type

* ignoreRestSiblings when destructuring for @typescript-eslint/no-unused-vars

* Replace lodash find

* Use global rather than window

* Remove lodash map

* move rule to overrides
2021-05-16 18:59:32 +01:00
Raluca Stan 7deea0eee8 Fix cart and checkout frontend e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/4199)
* Wip: fix e2e fe tests

* Test that navigation ends

* Fix waitForNavigation

* comment out failing php test

* click the dom element

* Ensure navigation happens by waiting for it. Test page title.

* remove skip and update docs

* Revert "comment out failing php test"

This reverts commit 7c40e8caf3aa32e35e3b70eb32051251b06e0613.

* Fix USD from merge conflict

* Add missing check for page title

* Try page.waitForFunction for text search

* test to see checkout page title is correct

* test checkout page url on CI

* unde jest config change

* Fix assertion for checkout page

* remove extra localStorage item remove call

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-05-16 18:41:34 +01:00
Mike Jolley d1f55724e6 Set order status to pending when no payment is needed (https://github.com/woocommerce/woocommerce-blocks/pull/4186) 2021-05-13 11:49:39 +01:00
Mike Jolley 286d52befb Remove the need for the `canMakePayment` callback in the editor context (https://github.com/woocommerce/woocommerce-blocks/pull/4188)
* Force can pay true in editor context

* Update docs
2021-05-13 11:21:21 +01:00
Mike Jolley 87bb095f1f Sync customer data during checkout with draft orders. (https://github.com/woocommerce/woocommerce-blocks/pull/4197)
* Update store when email changes

* Add pluckEmail helper and convert to TS

* improve guard

* sync draft order with customer data
2021-05-13 11:20:37 +01:00
Albert Juhé Lluveras 792f0671af Set default store currency to USD in tests (https://github.com/woocommerce/woocommerce-blocks/pull/4203) 2021-05-13 12:14:15 +02:00
renovate[bot] c2a07c7a9d Update dependency config to v3.3.6 (https://github.com/woocommerce/woocommerce-blocks/pull/4195)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-13 10:16:04 +02:00
renovate[bot] a071edfd92 Update dependency cssnano to v4.1.11 (https://github.com/woocommerce/woocommerce-blocks/pull/4196)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-13 10:15:35 +02:00
Seghir Nadir 0c42322dba Add cart data to filters (https://github.com/woocommerce/woocommerce-blocks/pull/4164)
* add cart data to filters

* add extensions back to footer filter
2021-05-12 13:32:05 +01:00
renovate[bot] 730d7fa82b Pin dependency lodash to 4.17.21 (https://github.com/woocommerce/woocommerce-blocks/pull/4193)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-12 13:04:44 +01:00
renovate[bot] adcaaa2352 Update dependency chalk to v4.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/4194)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-12 13:04:13 +01:00
Mike Jolley a90988aebf Should be using value rather than name (https://github.com/woocommerce/woocommerce-blocks/pull/4187) 2021-05-12 13:02:26 +01:00
Thomas Roberts 1dcbddc0bd Add checkout filter for coupon names (https://github.com/woocommerce/woocommerce-blocks/pull/4166)
* Make extensions optional, not all filters will need to pass this through

For example the CartCouponSchema has no option for extensibility (and I don't think it's needed at any rate) so extensions will always be an empty object. Rather than explicitly specifying this when running the filter, we can let it default to an empty object.

* Add filter for coupon code
2021-05-11 13:57:02 +01:00
Thomas Roberts f97ee971af Check if variation data is iterable before formatting (https://github.com/woocommerce/woocommerce-blocks/pull/4182) 2021-05-11 11:45:02 +01:00
Darren Ethier 523f49d3b1 update package-lock (version change mostly) 2021-05-10 11:21:01 -04:00
Darren Ethier fb70016d45 update version string to dev version 2021-05-10 11:16:58 -04:00
github-actions[bot] e3568aa275 Release: 5.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4185)
* Empty commit for release pull request

* Add changelog

* update testing notes

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2021-05-10 11:14:05 -04:00
renovate[bot] a4c2f2e7ae Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4184)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-10 14:38:04 +02:00
Thomas Roberts 6ffa778729 Convert shipping components to typescript (https://github.com/woocommerce/woocommerce-blocks/pull/4135)
* Add type defs for customer

Taken from 194ecccf78/assets/js/type-defs/customer.ts

* Convert ShippingCalculatorAddress to TypeScript

* Convert ShippingCalculator to TypeScript

* Convert ShippingLocation to TypeScript

* Allow packageId to be a number or string in useSelectShippingRate(s)

* Convert ShippingRatesControl to TypeScript

* Convert ShippingOptionsStep to TypeScript

* Allow package_id to be a string or number

This is because of Subscriptions using strings for package IDs

* Change to use CartShippingRateItemShippingRate instead of Rate

* Add extra props to PackageProps type

* Make ShippingAddress have the correct type

* Use CartShippingRateItemShippingRate instead of Rate

* Remove Rate type

* Set return types to JSX.Element

* Change type of props.renderOption in ShippingRatesControl

* Remove customer type defs and relocate aliases to default-address-fields

* Add EnteredAddress type

* Import EnteredAddress from new location

* Remove unnecessary eslint ignore

* Remove unused variable

* Remove confusing use of word Item in Shipping types

* Remove confusing use of word Item in Shipping types
2021-05-10 10:03:30 +01:00
Albert Juhé Lluveras a25eba0232 Feature gate PaymentApi (https://github.com/woocommerce/woocommerce-blocks/pull/4176)
* Feature gate PaymentApi

* Improve payment method missing dependencies error message so it's clear it only affects blocks

* Add PaymentApi feature flags to list of feature flags in docs
2021-05-10 10:00:14 +02:00
Darren Ethier c85654f579 Improvements to `emitEventWithAbort`. (https://github.com/woocommerce/woocommerce-blocks/pull/4158)
* modify emitEventWithAbort to change return value

`emitEventWithAbort` now returns an array of responses up to the first response that triggered an error or fail response instead of aborting on success responses too.

* update add to cart form context provider

* update checkout state context provider

* update payment method data context provider

* update tests and fix thrown error handling.
2021-05-07 16:39:28 -04:00
Raluca Stan 269341acc4 Add lodash as a devDependency (https://github.com/woocommerce/woocommerce-blocks/pull/4179) 2021-05-07 15:50:55 +02:00
Seghir Nadir 037dc09f62 Don't clear email and phone fields when using separate billing address. (https://github.com/woocommerce/woocommerce-blocks/pull/4162)
* preseve-billing-data

* pluck empty email and phone

* add issue number
2021-05-05 12:59:30 +01:00
Raluca Stan b9db5d4c51 Fix/cart backend test (https://github.com/woocommerce/woocommerce-blocks/pull/4153)
* Fix backend cart e2e test

* Adjust test structure

* Fix e2e checkout backend test.

Make sure the confirmation window is closed
2021-05-05 12:52:27 +01:00
renovate[bot] 07abd0f0b8 Update dependency @stripe/stripe-js to v1.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4170)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-05 10:08:45 +00:00
Thomas Roberts 57b4215bce Add documentation for filters (https://github.com/woocommerce/woocommerce-blocks/pull/4167)
* Rename the argument in the CheckoutFilterFunction type

This only exists as an extra descriptive hint to anyone using this type, the value `label` was never used by anything so it does not need to be changed anywhere else.

* Create Available Filters document

* Add available filters to the extensibility README

* Update docs/extensibility/available-filters.md to fix typographical error

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

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-05-05 10:41:48 +01:00
renovate[bot] 7a53dd1f27 Update dependency @woocommerce/e2e-utils to v0.1.4 (https://github.com/woocommerce/woocommerce-blocks/pull/4172)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-05 08:10:24 +00:00
renovate[bot] 1cabe4b614 Update dependency @types/react to v16.14.6 (https://github.com/woocommerce/woocommerce-blocks/pull/4171)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-05 03:31:52 +00:00
renovate[bot] 0255e27bb0 Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/4169)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-05 02:23:13 +00:00
renovate[bot] 599814cf43 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4163)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-04 14:07:05 +01:00
Mike Jolley 2b6952151e 5.1.0-dev 2021-04-28 17:21:36 +01:00
github-actions[bot] 6614876baa Release: 5.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4144)
* Empty commit for release pull request

* Changelog

* Testing instructions

* cast correct value of setting

* fix typo

* add zip

* /tsconfig.base export-ignore

* update image

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-04-28 17:15:39 +01:00