* 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>
* 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
* 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
* 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
* 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>
* 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.
* 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
* 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>
* 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
* 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>
* 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
* 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
* 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
* 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.