* Fix checkbox styling in 2020 and 2017 themes by setting input font size
* 2017 button hover style fixes
* Fix editor dark inputs
* Restore dark color
* Fix circular dependencies in Icons package
* CircularDependencyPlugin
* Fix deriveSelectedShippingRates CD
* Move useStoreNotices to context/hooks
* Move useStoreCart to base/context/hooks
* Move useStoreEvents to base/context/hooks
* Move collection/product hooks
* Move useStoreAddToCart
* Move useCustomerData
* move shipping hooks
* Move checkout and payment hooks
* Context should import hooks with relative paths
* Prevent circular dependency in store notices container components
* Move address fields to settings so they are shared
* Import PaymentMethod components direct
* relative import
* Fix select CD
* Move ValidationInputError
* Move components consumed by context
* Fix up internal imports in context
* fix CD in checkout package
* Separate providers
* Fixing context exports
* Fix base context hook import
* fix mocks
* Pass hooks to Slot Fills as Fill Props to avoid imports from base-context
* Export components, not hooks
* Pass props to ExperimentalOrderMeta
* Run CD plugin when using `npm start` only
* Rename CIRCULAR_DEPS to CHECK_CIRCULAR_DEPS
* Remove duplicate key from rebase
* Move packages component back to main file
* Remove dashicon module replacement
* Restore SVG import from package not external
* Move core locale handling to avoid impact settings package size
* Remove deleted file from rebase
* Apply kses before wc_format_content
* Add kses to price HTML strings
* KSES in product grid
* kses in featured product
* Switch short description filter to wc_format_content in featured product block
* Fix click on Proceed to checkout bug when Coupon error is visible.
The bug happened because of the layout shift produced by the error message disappearance.
* Strip tags that are added to notices
* Add test to ensure HTML is stripped by convert_notices_to_exceptions
* Test function directly, rather than through validate_cart_items
* Apply correct formatting to tests/php/StoreApi/Utilities/NoticeHandler.php
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Trying a different way of adding a commit to allow for pr creation on release pull requests. This way reduces both the number of commits and requires no actual file changes.
* Add cartUpdate middleware
* Include timestamp for when cart data was generated
* Add getCartFromApi action
* Check whether cart can be hydrated or needs to be fetched from API
* Add cartDataIsStale action and remove getCartFromApi action
* Add isCartDataStale selector
* Don't load cart until staleness check is complete
* Add comment to ease worry about locaStorage execution
* Correct doc block and fix typographical error
* Cater for lastCartUpdate or the timestamp being undefined
* Include @woocommerce/api and @woocommerce/e2e-utils
* Add getNormalPagePermalink test utility
This will allow us to get the permalink of a "normal" page, i.e. one that is not using the block editor.
* Add getBlockPagePermalink test utility
This will get the permalink for a page using the Block editor.
* Emit action to update cart staleness in all execution paths
* Add visitPostOfType function
This will allow us to visit the editor page for a post based on its name and post type.
* Add functions to get permalinks from editor pages
* Add front-end tests for cart
* Update package-lock.json
* Create local function to ensure the page permalink is visible
* Change functions for getting permalinks
They were often failing for unknown reasons, these _somehow_ make them more stable.
* Add logging for GitHub actions
* Add more logging for tests
* Add more logging for tests
* Add more logging for tests
* Wait for networkidle on back
* Remove logging except timestamp
* Wait for timestamp to be added to localStorage
* Split tests to make runs slightly shorter
* Wait for add to cart request before continuing test
* Fix formatting in cart.test.js
* Rename cartDataStale to setIsCartDataStale
* Create constant for localStorage timestamp name
* Rename cartDataIsStale to isCartDataStale
This is for consistency, the action to change this is called setIsCartDataStale - I think this reads better.
* Use cleaner logic when determining if the cart should render or fetch
* Change docblock for isCartDataStale selector
* Remove boolean cast from SET_IS_CART_DATA_STALE reducer
* Set longer timeouts for frontend cart tests
* Enclose cart staleness checks in condition/prevent unnecessary execution
* Remove unnecessary boolean cast from selector
* Use constant for local storage key in tests
* Use new localstorage key in tests. cant access constants in page context
* Implement `started` action creator.
Also for TS typing I changed `paymentMethodData` to be optional for both the `success` and `started` action creators.
This is because the behaviour allows for paymentMethodData to be retained in the state if it is not explicitly provided on dispatch.
* Implement started action creator on the exposed payment status dispatcher.
The implementation now allows for receiving payment method data when the `start` status is dispatched.
* Don’t overwrite payment method data when `success` status is set.
It is intended that if paymentMethodData is undefined, that is simply passed through to the dispatched action. This signals the reducer to retain the existing paymentMethodData in state (when undefined).
The correct way to clear the paymentMethodData is to either explictly provide an empty object, or set the status to pristine.
* Fix types for incoming paymentMethodData
* Implement receiving paymentMethodData in reducer.
This changeset also configures the reducer to retain the existing paymentMethodData in state (and related correlated information0 when the provided paymentMethodData property is undefined.
The only time paymentMethodData should be reset in state is when it is explicitly provided or the status is set to PRISTINE.
* Fix types for started action dispatcher.
* Explicitly clear paymentMethodData state when express payment started.
Also restores previous paymentMethodData when express payment cancelled.
* Switch saved tokens to utilize the payment method status started dispatched action instead of success.
This change ensures that savedToken handlers registered by payment methods have access to the `onPaymentProcessing` checkout event.
* fix typedef
Really just need to ensure types are used anywhere, this is a temporary change due to the time sensitive needs for this PR.
* Update assets/js/base/context/cart-checkout/payment-methods/reducer.ts
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>