woocommerce/plugins/woocommerce-blocks/assets/js/data/validation
Thomas Roberts f3588635d7 Add stricter observer type checks in payments thunk to improve resilience to bad observer responses (https://github.com/woocommerce/woocommerce-blocks/pull/8319)
* Allow observers to set billingAddress by returning billingData

This is required since we didn't correctly deprecate billingData when we changed the name to billingAddress

* Add tests for shippingAddress and paymentMethodData

* Add mocked __internalSetPaymentMethodData to correct object

It was in registry, but should be in dispatch as the action is on the same store as the thunk. Registry is used for actions on other stores.

* Re-add FieldValidationStatus type

* Add FieldValidationStatus back

* Remove empty file

* Import FieldValidationStatus from correct place

* Remove import of deleted types file

* Add isObserverResponse type guard

* Use error constant instead of magic string in event emitter

* Remove composite project tsconfig

* Add ObserverResponse type

* Add types to emitEventWithAbort

* Check if paymentmethod data is an object before dispatching

* Set types on observer responses

* Add validationErrors type guards

* Add tests for validation typeguards

* Add validation errors as option on observer response

* Add more granular observer response types

* Check observer response has correct types before dispatching actions

* Force type on deprecated billingData and shippingData

* Remove unnecessary comment
2023-02-13 03:43:57 -08:00
..
test Add stricter observer type checks in payments thunk to improve resilience to bad observer responses (https://github.com/woocommerce/woocommerce-blocks/pull/8319) 2023-02-13 03:43:57 -08:00
action-types.ts Add `clearValidationErrors` action to validation data store (https://github.com/woocommerce/woocommerce-blocks/pull/7601) 2022-11-17 09:19:44 -08:00
actions.ts Add stricter observer type checks in payments thunk to improve resilience to bad observer responses (https://github.com/woocommerce/woocommerce-blocks/pull/8319) 2023-02-13 03:43:57 -08:00
constants.ts Convert validation context to data store (https://github.com/woocommerce/woocommerce-blocks/pull/6402) 2022-09-28 13:45:42 +01:00
index.ts Remove the experimental flag that's used to include thunks in wp.data (https://github.com/woocommerce/woocommerce-blocks/pull/7617) 2022-11-14 09:07:49 +00:00
reducers.ts Add stricter observer type checks in payments thunk to improve resilience to bad observer responses (https://github.com/woocommerce/woocommerce-blocks/pull/8319) 2023-02-13 03:43:57 -08:00
selectors.ts Refactor `getValidationError` and `getValidationErrorId` selectors in `wc/store/validation` data store (https://github.com/woocommerce/woocommerce-blocks/pull/7146) 2022-09-28 13:45:42 +01:00