Commit Graph

2846 Commits

Author SHA1 Message Date
renovate[bot] fa9d93d381 Update dependency @types/gtag.js to v0.0.5 (https://github.com/woocommerce/woocommerce-blocks/pull/4300)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-06-03 11:36:42 +00:00
Albert Juhé Lluveras 3f1caedb9e Hide Cart and Checkout blocks from the widget editor (https://github.com/woocommerce/woocommerce-blocks/pull/4303) 2021-06-03 09:50:12 +02:00
Darren Ethier c391899258 Fix broken phpunit tests (https://github.com/woocommerce/woocommerce-blocks/pull/4305)
* allow for WOO_VERSION config in tests setup

* pass through WOO_VERSION environment var to container

* force specific WOO_VERSION value for phpunit test run

* try passing through environment variable via docker arg

Also set .env for controlling local runs of phpunit
2021-06-03 09:35:52 +02:00
Seghir Nadir 44f31606c3 set is calculating correctly (https://github.com/woocommerce/woocommerce-blocks/pull/4293) 2021-06-02 14:52:32 +01:00
Seghir Nadir cd3242900e add i18n to wcSettings (https://github.com/woocommerce/woocommerce-blocks/pull/4295) 2021-06-02 14:52:15 +01:00
Thomas Roberts 1702a6c0c3 Check if there are tax lines before rendering the container for them (https://github.com/woocommerce/woocommerce-blocks/pull/4284) 2021-06-02 11:14:42 +01:00
Thomas Roberts f0cb4cba90 Add documentation for the `couponName` filter (https://github.com/woocommerce/woocommerce-blocks/pull/4282)
This was somehow omitted from woocommerce/woocommerce-blocks#4166
2021-06-02 11:11:26 +01:00
Seghir Nadir 1b87589f82 remove usage of mustBeString (https://github.com/woocommerce/woocommerce-blocks/pull/4294) 2021-06-01 09:46:02 +01:00
renovate[bot] 28206058d8 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4290)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-31 16:07:59 +01:00
Thomas Roberts 36e8b1e44f Check if product can be added to cart before adding ajax class to button (https://github.com/woocommerce/woocommerce-blocks/pull/4265) 2021-05-27 12:57:49 +01:00
Thomas Roberts 774364ff56 Update version for next release 2021-05-26 16:10:43 +01:00
Thomas Roberts 24895dd9cf Merge branch 'release/5.2.0' into trunk 2021-05-26 16:09:41 +01:00
Thomas Roberts 30aff545a2 Bumping version strings to new version. 2021-05-26 15:42:21 +01:00
Thomas Roberts f4841cdff1 Update link to testing zip 2021-05-26 15:31:37 +01:00
Thomas Roberts 7920a40df9 Fix display of itemised taxes (https://github.com/woocommerce/woocommerce-blocks/pull/4279)
* Add price to itemised tax rates & hide Total when itemised taxes are on

* Update snapshots for taxes in sidebar
2021-05-26 14:57:56 +01:00
Thomas Roberts 61755f0f01 Fix display of itemised taxes (https://github.com/woocommerce/woocommerce-blocks/pull/4279)
* Add price to itemised tax rates & hide Total when itemised taxes are on

* Update snapshots for taxes in sidebar
2021-05-26 14:04:42 +01:00
renovate[bot] d2b4a91f1f Update dependency downshift to v6.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/4272)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-26 08:52:31 +00:00
renovate[bot] 1cbf0180e5 Update dependency @types/react to v16.14.8 (https://github.com/woocommerce/woocommerce-blocks/pull/4270)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-26 05:04:55 +00:00
renovate[bot] bd8e3c5275 Update dependency @woocommerce/e2e-utils to v0.1.5 (https://github.com/woocommerce/woocommerce-blocks/pull/4271)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-26 03:47:54 +00:00
renovate[bot] 5984b987b4 Update dependency @types/lodash to v4.14.170 (https://github.com/woocommerce/woocommerce-blocks/pull/4269)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-26 02:30:17 +00:00
Thomas Roberts a2e8c605de Create 5.2.0 testing notes 2021-05-25 15:31:03 +01:00
Thomas Roberts 256af96b92 Update package.json
npm ci was not working correctly this will fix it.
2021-05-25 14:52:37 +01:00
Thomas Roberts 9b38c5ff51 Merge remote-tracking branch 'origin/release/5.2.0' into release/5.2.0 2021-05-25 14:50:06 +01:00
Thomas Roberts 8360d5b384 Update changelog and WC tested up to 2021-05-25 14:26:32 +01:00
github-actions 708c41a4d4 Empty commit for release pull request 2021-05-25 13:17:26 +00:00
Thomas Roberts b187f9f466 Revert "Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)"
This reverts commit ee9b2d20e0.
2021-05-25 14:13:29 +01:00
Mike Jolley cf8ab9fa93 Add key to each `CartTotalItem` (https://github.com/woocommerce/woocommerce-blocks/pull/4240)
* Move type defs

* Move type guards

* Fix imports

* Extract prepareTotalItems to TS file

* usePaymentMethodInterface as TS file

* Fix TS props

* Fix currency type defs

* Add return type to usePaymentMethodInterface

* Add key prop to CartTotalItem

* Fixed up js tests

* Move SymbolPosition into type-defs package

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2021-05-25 12:49:13 +01:00
Seghir Nadir 3b69179cbe Fix duplicate plugins by using wp.components global in the editor. (https://github.com/woocommerce/woocommerce-blocks/pull/4211)
* fix duplicate slotProvider

* load file on demand

* add comment and load components in blocks as well

* add todo block
2021-05-25 10:46:28 +01:00
Thomas Roberts c8f6f5e372 Hide "including X in taxes" when the amount of tax is 0 (https://github.com/woocommerce/woocommerce-blocks/pull/4262)
* Hide "including x in taxes" if tax amount is 0

* Add jest types to tsconfig

* Move SHOW_TAXES into component body

This is to make the code more testable and allows us to change values. There's no significant performance impact because of this change.

* Add tests and snapshots for TotalsFooterItem
2021-05-25 08:43:46 +01:00
renovate[bot] bb29ebb12c Update dependency @octokit/graphql to v4.6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/4230)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-24 18:14:37 +01:00
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