* Remove `parent` from block config.
By removing the `parent` property from the block config, we can have
more flexibility to where we can use the pricing block - i.e., it does
not need to be a direct descendent of a `core/group` block.
* Remove unused save function/file.
* bot: update checkstyle.xml
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
* Add non-debounced versions of updatePaymentMethods
* Call undebounced function until store is ready then call debounced
* Reset debounce timer to 1 second
* Add better comments
* Try setting the trail setting of the debounce function
* Revert "Try setting the trail setting of the debounce function"
This reverts commit 040fb63cb612c19ac396396d1949b6429f402616.
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Convert product-elements/summary to TypeScript
* bot: update checkstyle.xml
* Update assets/js/atomic/blocks/product-elements/summary/index.ts
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Resolve introduced TS error
* bot: update checkstyle.xml
* Remove default subproperties
* Add TODO to refactor this part in the future
* Make attribute type more strict
* Add more context to the todo regarding removing the HOC
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Prevent padding from placeholder instructions to be overriden
Inside the AttributeFilter component we are using a component Placeholder from the @wordpress/components library. This component has its own styles applied to itself including the part related to the instructions that are displayed.
Currently there is no way to override the styles specifically for the instructions part so the only possible way is to force the style to be applied over the inner styles set by the Placeholder component.
* Add a wrapper to the instructions content and apply the styles to it
The initial idea was to force the style to be applied by using `!important` on the padding-bottom property. However, after discussing more about it, it was decided that a better alternative is to add the instructions content to the body of the Placeholder content instead of relying on the `instructions` prop of the component.
This way, instead of forcing the style to be applied which could cause some side effects in the future, we are wrapping the instructions content in an HTML element that we control and, thus, can modify the styles independently of the external library it's being used (@wordpress/components).
* Add rate limiting to cart endpoints based on session
* Handle nonce and rate checks in permission_callback
* Rate limit checkout only
* Debug
* Unused AbstractRoute
* Code standards
* Modify core rate limit table
* Add rate limit at rest api level, not route level
* Rate limit helper
* Remove rate limit from routes
* Usused dep
* Remove custom error logic no longer needed
* Remove dependency
* Remove custom permission_callback
* Hash IP and handle null
* Remove error response handler
* revert error_to_response changes
* Remove add_response_headers
* Remove IDENTIFIER
* Remove white space
* Increase limit
* Missing class comment
* Move rate limiting code within store api codebase
* white space
* Fix return type
* Check rate limit expiry greater than now
* Remove x- prefix
* reorder functions
* remove table
* pass request to add_nonce_headers
* return early and avoid elseif on AbstractCartRoute:get_response()
* Refactor get_ip_address() before implementing options for functionality
* Change rate limit to 5 requests
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Change rate limit window to 60 seconds
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Disable rate limiting by default
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Updated limits comment
* Example for Forwarded header
* Updated "woocommerce_store_api_enable_rate_limit_check" filter doc
* Added filter for the Store API rate limit check proxy support
* Add an action here that carries over the IP address being blocked.
* Added logic around setting the action_id, and returns an error when ip cannot be determined for users not logged in.
* Renamed action for limit exceeded.
* Common rate limiting header naming prefix, and fixed comment typos.
* Doc for Rate Limiting (wip)
* Example for Rate Limiting docs
* Remove private IP range block for rate limiting
* Refactored get_response() to add nonce headers to response instead of request
* Disable batching for Checkout calls to prevent bypassing Rate Limiting.
* Removed redundant arg.
* package-lock.json update
* Removed repeated func calls.
* Fix failing tests.
* Tests wip.
* Request limit and timeframe are now constants for RateLimits utility class.
* Tests for Rate Limit headers.
* Reverted PHPUnit config to enable all tests again.
* Update src/StoreApi/Authentication.php comment wording
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Removed possibly unnecessary get_ip_address() call.
* Changed wording on comment for get_ip_address() method.
* Simplified validate_ip() method.
* Fixed wrong header entry for "Forwarded" check.
* Unit testing for Authentication::get_ip_address()
* Comment explaining the reason to use ReflectionClass for testing get_ip_address().
* Support for error output outside batch request.
* MD linting.
* Refactor to implement options through a single filter.
* fixed md lint error and config file
* reverted accidental default func arg value removal
* re-enabled batch support for checkout
* action for limit exceed now also triggered in case we can't resolve the IP.
* Doc tweak.
* Return unresolved IP address when REMOTE_ADDR isn't set with proxy support disabled.
* Group unresolved ips for rate limiting
* Fixed bug where current limit wasn't properly initialized.
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Active Filters: Fix active filter grouping for Ratings and Stock Status
* bot: update checkstyle.xml
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Set a the color as white for the dark header/footer patterns
That way we make sure they will be visible no matter which theme is active.
* Adapt light patterns to inherit colors from theme
* Remove light from pattern names and color from social icons
* Make links inherit color
* Remove background
* Remove wp:page-list
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove 'update documentation' step from patch release checklist
* Make 'update documentation' a parent step in the release checklist
* Update .github/release-initial-checklist.md
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
* Add type to imports that need it
* Add type to imports that need it
* Fix the sanitize lint error
* Include missing dep
* Remove check from deps
* bot: update checkstyle.xml
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Use backslashes to fix webpack build on windows
* Update regex to use square brackets, and update copywebpack path for Windows
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Product Query: Fix pagination issue
* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Price Block
* fix query relation
* fix on sale query
* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Attributes block
* fix bugged pagination and on-sale filter after refactor
* address feedback
* Product Query - Add support for the Filter By Stock Block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Stock Block
* Fix filter blocks: the data (e.g: max price or stock-status) match the variation woocommerce/woocommerce-blocks#7245
fix filter blocks: the data (e.g: max price or stock-status) match the variation
* disable phcs rules on top of the file
* replace parameter name
* fix eslint error
* Product Query: Fix pagination issue
* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Price Block
* fix query relation
* fix on sale query
* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Attributes block
* fix bugged pagination and on-sale filter after refactor
* address feedback
* Product Query - Add support for the Filter By Stock Block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Stock Block
* address feedback
* Add PQ support for client-side.
Set up the block for PQ support and add necessary adjustments for the
editor. Will address dynamic save functionality in a following commit.
* Add dynamic render function for PQ support.
* Add dynamic render callback for SSR.
* Remove client-side Save function.
* Add PQ Context interface to shared type defs.
* Convert all block JS files to TS.
* Remove commented import from block file.
* Add typecasting to block function params.
As a workaround, added a general Record type but left a TODO to revisit
the proper object, as there is a mismatch in the shape of the default
object property types and the actual types.
* Update inserter behavior.
Allows for the ability to add the rating block from in the inserter
(as long as it's an inner block of the listed parents in the config).
Also disables the placeholder product selector from being rendered
unnecessarily (i.e., when the context ID is present).
* Update parent inner blocks config.
Reassign parent array to ancestor array which allows for blocks to be
included with more flexibility - i.e., added within groups that are
children of the ancestor block.
* Add productID to rating Attributes interface.
* TS type casting and import adustments.
Some adjustments to utilize types that we already have available, along
with some syntax adjustments and more sensible import tweaks.
* Update type-casting to use ProductResponseItem
Instead of using the generic Record, we can utilize the
ProductResponseItem interface and set an omission for the average_rating
property until that is corrected to properly reflect the API response.
* Add alias to blocks dir for imports.
Allows us to use exports from the blocks dir as "external" imports. This
way we do not need to write long, relative import paths (which can be
fragile in the long run).
* use full link for WordPress resources (https://github.com/woocommerce/woocommerce-blocks/pull/7211)
Co-authored-by: Niels Lange <info@nielslange.de>
* Empty commit for release pull request
* update readme
* add testing instructions
* add zip file link
* update testing instructions and changelog entry
* Bumping version strings to new version.
* Empty commit for release pull request
* Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506)
* Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)
* Fixed Price Slider Issue
Located where the price slider was hard coded and replaced it.
* fix CSS lint
* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130
use currentColor instead of hard-coded color for the slider of the Filte By Price block
* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130
use currentColor instead of hard-coded color for the slider of the Filte By Price block
* remove background-color
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525)
* Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)
* fix inconsistent button styling with TT3
* use wc_wp_theme_get_element_class_name
* add check to be sure that wc_wp_theme_get_element_class_name function exists
* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)
* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379
Fix Mini Cart Block global styles
* add font_size
* Empty commit for release pull request
* add changelog and testing instructions
* add zip link for testing
* Bumping version strings to new version.
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
* Empty commit for release pull request
* Calculate cart totals after running extensions (https://github.com/woocommerce/woocommerce-blocks/pull/7490)
* calculate cart totals afer running extensions
* update totlas call in CartUpdateCustomer
* test that cart is recalcing
* Update changelog in readme
* Add release testing notes
* Update release date in readme
* Bumping version strings to new version.
* update readme
* Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506)
* Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)
* Fixed Price Slider Issue
Located where the price slider was hard coded and replaced it.
* fix CSS lint
* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130
use currentColor instead of hard-coded color for the slider of the Filte By Price block
* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130
use currentColor instead of hard-coded color for the slider of the Filte By Price block
* remove background-color
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525)
* Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)
* fix inconsistent button styling with TT3
* use wc_wp_theme_get_element_class_name
* add check to be sure that wc_wp_theme_get_element_class_name function exists
* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)
* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379
Fix Mini Cart Block global styles
* add font_size
* upload a new build
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Empty commit for release pull request
* Added readme.txt changelog entry
* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)
* 8.7.2 Testing notes
* Update testing notes
* Update testing notes
* Bumped version
* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393
* Updated testing zip
* Bumping version strings to new version.
* Empty commit for release pull request
* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)
* Construct args for canMakePayment with correct keys
* When the CheckoutEventsContext mounts, initialize payment store
* Destructure useSelect correctly
* Dispatch __internalInitializePaymentStore in selector tests
* Update selector name to __internalUpdateAvailablePaymentMethods
* Remove check for editor when registering checkout store
* Add check for when express payment methods have updated too
* Ensure billingAddress key exists in canMakePayment arg
* Use editor context to know if we're in editor
* Updated readme.txt
* Reverted stable tag change on readme.txt
* Testing instructions
* Cleaned out testing instructions
* Bumping version strings to new version.
* Empty commit for release pull request
* Testing instructions
* package-lock.json version bump
* Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)
This reverts commit 25e24708b5.
* Testing zip
* Bumping version strings to new version.
* add testing instructions
* upload a new zip file
* Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506)
* Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)
* Fixed Price Slider Issue
Located where the price slider was hard coded and replaced it.
* fix CSS lint
* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130
use currentColor instead of hard-coded color for the slider of the Filte By Price block
* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130
use currentColor instead of hard-coded color for the slider of the Filte By Price block
* remove background-color
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525)
* Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)
* fix inconsistent button styling with TT3
* use wc_wp_theme_get_element_class_name
* add check to be sure that wc_wp_theme_get_element_class_name function exists
* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)
* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379
Fix Mini Cart Block global styles
* add font_size
* upload a new build
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
* Fix storybook build failing issues
Storybook build was failing because of 2 issues:
1. Can't import the named export 'Fragment' from non EcmaScript module (only default export is available)
I used solution provided in following comment:
https://github.com/storybookjs/storybook/issues/16690#issuecomment-971579785
This issue comes from the framer-motion library.
2. SassError: Can't find stylesheet to import.
To fixe this issue I have updated the path in import statements.
**Before**
```
@import "@wordpress/base-styles/breakpoints";
@import "@wordpress/base-styles/mixins";
@import "wordpress-components/src/popover/style";
@import "wordpress-components/src/tooltip/style";
```
**After**
```
@import "node_modules/@wordpress/base-styles/breakpoints";
@import "node_modules/@wordpress/base-styles/mixins";
@import "node_modules/wordpress-components/src/popover/style";
@import "node_modules/wordpress-components/src/tooltip/style";
```
* Add a comment to explain why webpackFinal block was added
* fix inconsistent button styling with TT3
* use wc_wp_theme_get_element_class_name
* add check to be sure that wc_wp_theme_get_element_class_name function exists
* Add a workflow for building nightly releases of the repo
* Added comment explaining where the release id comes from
* Update comment about id with the right id - doh
* Only deploy to wordpress.org for releases not pre-releases
* Fixed Price Slider Issue
Located where the price slider was hard coded and replaced it.
* fix CSS lint
* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130
use currentColor instead of hard-coded color for the slider of the Filte By Price block
* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130
use currentColor instead of hard-coded color for the slider of the Filte By Price block
* remove background-color
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Update installed to setup crosssells for all matching products in case of duplicates
* Improve shopper utils to wait for page elements to render
* Taxes should wait for totals wrapper
* Use shopper.block.goToShop()
* Inline docs
* Wait for errors
* partial match please fill error
* Disable apply button when there is no change to selected options
More info: https://github.com/woocommerce/woocommerce-blocks/issues/7116
* Add tests to the Filter Attribute block
Since we are making changes to the Filter Attributes block to fix issue woocommerce/woocommerce-blocks#7373, we are also adding tests to make sure the changes are providing the expected behavior
The setup-globals file was changed to add 'attributes' and 'has_filterable_products' properties to it, so it can be used in the tests.
* Merge test utils methods with attribute filter block
Removing test utils file and merging the methods with the Attribute Filter block to prevent tests from failing due to Jest configuration that only allow test files to exists inside a 'test' folder
* Remove checked.length === 0 condition
**Why was this condition needed before?**
Because when the user initially load the page, no filter is selected therefore we needed this condition to keep the Apply disabled in this case.
**Why we don't need it anymore?**
Because now in this PR we add following code:
```jsx
const activeFilters = getActiveFilters( attributeObject );
if ( activeFilters.length === checked.length ) {
return checked.every( ( value ) =>
activeFilters.includes( value )
);
}
```
This will return `true` when the user initially loads the page & Apply button will become disabled. Therefore, I believe it's safe to remove `checked.length === 0` condition.
More info: https://github.com/woocommerce/woocommerce-blocks/pull/7373#discussion_r994737313
* Add filterSize param to test setup
With this configuration, it is now possible to modify the current filter size in order to improve tests
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
* Add Stock Status to Product Query block filters
Creates a new Tools Panel called “Product filters” where we can neatly
organize our product specific settings. Eventually, this panel could be
merged with the core “Filters” panel; however, at the time of this
commit, this is impossible (see WordPress/gutenbergwoocommerce/woocommerce-blocks#43684 for a PoC).
Also moved the “On Sale” setting under this newly created panel.
* Add `resetAll` callback for the new Tools Panel
Tools Panels come with a “Reset All” functionality, that's supposed to
return all the settings to their original state.
In our case, things are a bit more complicated, as the original state
is dependant on the current variation, so it can't be hard-coded like it
is on the core block.
* Product Query: Fix pagination issue
* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Price Block
* fix query relation
* fix on sale query
* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Attributes block
* fix bugged pagination and on-sale filter after refactor
* address feedback
* address feedback
* Improve the performance of checking payment methods
* Use the default names of imports from @wordpress/data
* Fix circular dependency
* Fix __internalUpdateAvailablePaymentMethods
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Empty commit for release pull request
* Updated changelog.
* Minor lint fix.
* 8.7.0 Testing instructions
* Updated and tidy docs/internal-developers/testing/releases/README.md
* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)
* Set default style to link-button mixin
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* Add new mixin for links in filter blocks
* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page
* Add filter-link-button mixin that can be used in filter blocks
* Remove link-button styles that were moved to filter-link-button mixin
By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.
The styles for link button in filter blocks should reside in filter-link-button mixin.
* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions
* Re-added woocommerce/woocommerce-blocks#7273 to changelog
* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)
* Correct block name and description
* remove duplicated description for controls blocks
* remove duplicated title and desc
* Revert "remove duplicated description for controls blocks"
This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog
* Updated testing zip package.
* Minor formatting fix on the release instructions
* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)
* Updated zip.
* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)
* remove problematic actions as deps
* add inline docs
* add todo comment
* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)
* Updated testing zip.
* Bumping version strings to new version.
* Empty commit for release pull request
* Release: 8.7.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7371)
* Empty commit for release pull request
* Updated changelog.
* Minor lint fix.
* 8.7.0 Testing instructions
* Updated and tidy docs/internal-developers/testing/releases/README.md
* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)
* Set default style to link-button mixin
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* Add new mixin for links in filter blocks
* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page
* Add filter-link-button mixin that can be used in filter blocks
* Remove link-button styles that were moved to filter-link-button mixin
By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.
The styles for link button in filter blocks should reside in filter-link-button mixin.
* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions
* Re-added woocommerce/woocommerce-blocks#7273 to changelog
* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)
* Correct block name and description
* remove duplicated description for controls blocks
* remove duplicated title and desc
* Revert "remove duplicated description for controls blocks"
This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog
* Updated testing zip package.
* Minor formatting fix on the release instructions
* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)
* Updated zip.
* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)
* remove problematic actions as deps
* add inline docs
* add todo comment
* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)
* Updated testing zip.
* Bumping version strings to new version.
* Empty commit for release pull request
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Release: 8.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7396)
* Empty commit for release pull request
* Added readme.txt changelog entry
* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)
* 8.7.2 Testing notes
* Update testing notes
* Update testing notes
* Bumped version
* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393
* Updated testing zip
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Release: 8.7.3 (https://github.com/woocommerce/woocommerce-blocks/pull/7439)
* Empty commit for release pull request
* Added readme.txt changelog entry
* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)
* 8.7.2 Testing notes
* Update testing notes
* Update testing notes
* Bumped version
* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393
* Updated testing zip
* Bumping version strings to new version.
* Empty commit for release pull request
* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)
* Construct args for canMakePayment with correct keys
* When the CheckoutEventsContext mounts, initialize payment store
* Destructure useSelect correctly
* Dispatch __internalInitializePaymentStore in selector tests
* Update selector name to __internalUpdateAvailablePaymentMethods
* Remove check for editor when registering checkout store
* Add check for when express payment methods have updated too
* Ensure billingAddress key exists in canMakePayment arg
* Use editor context to know if we're in editor
* Updated readme.txt
* Reverted stable tag change on readme.txt
* Testing instructions
* Cleaned out testing instructions
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Release: 8.7.4 (https://github.com/woocommerce/woocommerce-blocks/pull/7449)
* Empty commit for release pull request
* Added readme.txt changelog entry
* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)
* 8.7.2 Testing notes
* Update testing notes
* Update testing notes
* Bumped version
* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393
* Updated testing zip
* Bumping version strings to new version.
* Empty commit for release pull request
* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)
* Construct args for canMakePayment with correct keys
* When the CheckoutEventsContext mounts, initialize payment store
* Destructure useSelect correctly
* Dispatch __internalInitializePaymentStore in selector tests
* Update selector name to __internalUpdateAvailablePaymentMethods
* Remove check for editor when registering checkout store
* Add check for when express payment methods have updated too
* Ensure billingAddress key exists in canMakePayment arg
* Use editor context to know if we're in editor
* Updated readme.txt
* Reverted stable tag change on readme.txt
* Testing instructions
* Cleaned out testing instructions
* Bumping version strings to new version.
* Empty commit for release pull request
* Testing instructions
* package-lock.json version bump
* Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)
This reverts commit 25e24708b5.
* Testing zip
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Empty commit for release pull request
* Added readme.txt changelog entry
* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)
* 8.7.2 Testing notes
* Update testing notes
* Update testing notes
* Bumped version
* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393
* Updated testing zip
* Bumping version strings to new version.
* Empty commit for release pull request
* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)
* Construct args for canMakePayment with correct keys
* When the CheckoutEventsContext mounts, initialize payment store
* Destructure useSelect correctly
* Dispatch __internalInitializePaymentStore in selector tests
* Update selector name to __internalUpdateAvailablePaymentMethods
* Remove check for editor when registering checkout store
* Add check for when express payment methods have updated too
* Ensure billingAddress key exists in canMakePayment arg
* Use editor context to know if we're in editor
* Updated readme.txt
* Reverted stable tag change on readme.txt
* Testing instructions
* Cleaned out testing instructions
* Bumping version strings to new version.
* Empty commit for release pull request
* Testing instructions
* package-lock.json version bump
* Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)
This reverts commit 25e24708b5.
* Testing zip
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
`wc()->api->get_endpoint_data` works, however, because it encodes and decodes from JSON, objects are lost and converted into arrays.
For the API is this not a problem, because they are output to JSON in the same way. For consumers however, they may be expecting object type.
We can fix this by getting the response data from the Cart Schema class directly.
* Empty commit for release pull request
* Added readme.txt changelog entry
* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)
* 8.7.2 Testing notes
* Update testing notes
* Update testing notes
* Bumped version
* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393
* Updated testing zip
* Bumping version strings to new version.
* Empty commit for release pull request
* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)
* Construct args for canMakePayment with correct keys
* When the CheckoutEventsContext mounts, initialize payment store
* Destructure useSelect correctly
* Dispatch __internalInitializePaymentStore in selector tests
* Update selector name to __internalUpdateAvailablePaymentMethods
* Remove check for editor when registering checkout store
* Add check for when express payment methods have updated too
* Ensure billingAddress key exists in canMakePayment arg
* Use editor context to know if we're in editor
* Updated readme.txt
* Reverted stable tag change on readme.txt
* Testing instructions
* Cleaned out testing instructions
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Empty commit for release pull request
* Added readme.txt changelog entry
* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)
* 8.7.2 Testing notes
* Update testing notes
* Update testing notes
* Bumped version
* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393
* Updated testing zip
* Bumping version strings to new version.
* Empty commit for release pull request
* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)
* Construct args for canMakePayment with correct keys
* When the CheckoutEventsContext mounts, initialize payment store
* Destructure useSelect correctly
* Dispatch __internalInitializePaymentStore in selector tests
* Update selector name to __internalUpdateAvailablePaymentMethods
* Remove check for editor when registering checkout store
* Add check for when express payment methods have updated too
* Ensure billingAddress key exists in canMakePayment arg
* Use editor context to know if we're in editor
* Updated readme.txt
* Reverted stable tag change on readme.txt
* Testing instructions
* Cleaned out testing instructions
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
We where running the "withSidebarNotices" HOC each time the
"editor.BlockEdit" hook is fired. The problem is that this hook is
fired on page editor scroll, when hovering over the blocks, when a
block preview is loading, etc.
So, we only want the "withSidebarNotices" HOC to be executed when a Woo
Block in selected!
* Construct args for canMakePayment with correct keys
* When the CheckoutEventsContext mounts, initialize payment store
* Destructure useSelect correctly
* Dispatch __internalInitializePaymentStore in selector tests
* Update selector name to __internalUpdateAvailablePaymentMethods
* Remove check for editor when registering checkout store
* Add check for when express payment methods have updated too
* Ensure billingAddress key exists in canMakePayment arg
* Use editor context to know if we're in editor
* Empty commit for release pull request
* Updated changelog.
* Minor lint fix.
* 8.7.0 Testing instructions
* Updated and tidy docs/internal-developers/testing/releases/README.md
* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)
* Set default style to link-button mixin
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* Add new mixin for links in filter blocks
* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page
* Add filter-link-button mixin that can be used in filter blocks
* Remove link-button styles that were moved to filter-link-button mixin
By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.
The styles for link button in filter blocks should reside in filter-link-button mixin.
* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions
* Re-added woocommerce/woocommerce-blocks#7273 to changelog
* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)
* Correct block name and description
* remove duplicated description for controls blocks
* remove duplicated title and desc
* Revert "remove duplicated description for controls blocks"
This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog
* Updated testing zip package.
* Minor formatting fix on the release instructions
* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)
* Updated zip.
* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)
* remove problematic actions as deps
* add inline docs
* add todo comment
* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)
* Updated testing zip.
* Bumping version strings to new version.
* Empty commit for release pull request
* Release: 8.7.1 (https://github.com/woocommerce/woocommerce-blocks/pull/7371)
* Empty commit for release pull request
* Updated changelog.
* Minor lint fix.
* 8.7.0 Testing instructions
* Updated and tidy docs/internal-developers/testing/releases/README.md
* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)
* Set default style to link-button mixin
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* Add new mixin for links in filter blocks
* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page
* Add filter-link-button mixin that can be used in filter blocks
* Remove link-button styles that were moved to filter-link-button mixin
By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.
The styles for link button in filter blocks should reside in filter-link-button mixin.
* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions
* Re-added woocommerce/woocommerce-blocks#7273 to changelog
* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)
* Correct block name and description
* remove duplicated description for controls blocks
* remove duplicated title and desc
* Revert "remove duplicated description for controls blocks"
This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog
* Updated testing zip package.
* Minor formatting fix on the release instructions
* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)
* Updated zip.
* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)
* remove problematic actions as deps
* add inline docs
* add todo comment
* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)
* Updated testing zip.
* Bumping version strings to new version.
* Empty commit for release pull request
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Release: 8.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/7396)
* Empty commit for release pull request
* Added readme.txt changelog entry
* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)
* 8.7.2 Testing notes
* Update testing notes
* Update testing notes
* Bumped version
* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393
* Updated testing zip
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* README.md formatting
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Products by Rating: Move the Filter by Ratings block to the feature plugin build
* Products by Rating: Update the internal doc
* Products by Rating: Include a Feature Plugin check before loading the Rating filter variation
* Add overview to payment data store docs
* Add documentation for isExpressPaymentMethodActive
* Add documentation for getActiveSavedToken
* Remove _ from Example heading
* Add documentation for getActivePaymentMethod
* Add documentation for getAvailablePaymentMethods
* Add documentation for getAvailableExpressPaymentMethods
* Add documentation for getPaymentMethodData
* Add documentation for getSavedPaymentMethods
* Add documentation for getActiveSavedPaymentMethods
* Add documentation for shouldSavePaymentMethod
* Add documentation for getCurrentStatus
* Change docs for shouldSavePaymentMethod to getShouldSavePaymentMethod
* Add documentation for normal/express paymentMethodsInitialized
* Add table of contents for payment method documentation
* Products by Rating: Add InnerBlock support for Ratings
* Product by Ratings: Register Ratings filter as an InnerBlock
* Product by Rating: Fix active rating filters bug
* Products by Rating: Remove all heading references
* Products by Rating: Minor code fixes
* Products by Rating: Fix ESlint errors
* Products by Rating: Fix dependency placement
* Empty commit for release pull request
* Updated changelog.
* Minor lint fix.
* 8.7.0 Testing instructions
* Updated and tidy docs/internal-developers/testing/releases/README.md
* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)
* Set default style to link-button mixin
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* Add new mixin for links in filter blocks
* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page
* Add filter-link-button mixin that can be used in filter blocks
* Remove link-button styles that were moved to filter-link-button mixin
By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.
The styles for link button in filter blocks should reside in filter-link-button mixin.
* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions
* Re-added woocommerce/woocommerce-blocks#7273 to changelog
* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)
* Correct block name and description
* remove duplicated description for controls blocks
* remove duplicated title and desc
* Revert "remove duplicated description for controls blocks"
This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog
* Updated testing zip package.
* Minor formatting fix on the release instructions
* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)
* Updated zip.
* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)
* remove problematic actions as deps
* add inline docs
* add todo comment
* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)
* Updated testing zip.
* Bumping version strings to new version.
* Empty commit for release pull request
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Check callback for payment method is available before trying to run it
* Check if callback is a function before trying to run it
* Update tests to ensure callbacks only run if they are registered
* Empty commit for release pull request
* Updated changelog.
* Minor lint fix.
* 8.7.0 Testing instructions
* Updated and tidy docs/internal-developers/testing/releases/README.md
* Add filter-link-button mixin (https://github.com/woocommerce/woocommerce-blocks/pull/7357)
* Set default style to link-button mixin
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* Add new mixin for links in filter blocks
* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page
* Add filter-link-button mixin that can be used in filter blocks
* Remove link-button styles that were moved to filter-link-button mixin
By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.
The styles for link button in filter blocks should reside in filter-link-button mixin.
* Cherry picked Add filter-link-button mixin woocommerce/woocommerce-blocks#7357 and updated testing instructions
* Re-added woocommerce/woocommerce-blocks#7273 to changelog
* Correct block name and description (https://github.com/woocommerce/woocommerce-blocks/pull/7354)
* Correct block name and description
* remove duplicated description for controls blocks
* remove duplicated title and desc
* Revert "remove duplicated description for controls blocks"
This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
* removed woocommerce/woocommerce-blocks#7338 from testing instructions and changelog
* Updated testing zip package.
* Minor formatting fix on the release instructions
* change any to or below the express payment method on cart (https://github.com/woocommerce/woocommerce-blocks/pull/7369)
* Updated zip.
* Add temporary workaround to fix inserting Cart block in WordPress.com (https://github.com/woocommerce/woocommerce-blocks/pull/7367)
* remove problematic actions as deps
* add inline docs
* add todo comment
* Cherry picked: Fix a problem that causes an infinite loop when inserting Cart block in wordpress.com (7367)
* Updated testing zip.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Products by Rating: Add display options
* Products by Rating: Add support for the Apply button display option
* Products by Rating: Reset button display fix
* Products by Rating: Reset button dependency fix
* Products by Rating: Fix Active filters rating removal and Rating Reset button
* Products by Rating: Tweak preview checklist options
* Products by Rating: Remove stock status mentions
* Products by Rating: Remove redundant color option and fix loading check logic
* Products by Rating: Fix Reset button styling
* Products by Rating: Code cleanup and standardization
* Correct block name and description
* remove duplicated description for controls blocks
* remove duplicated title and desc
* Revert "remove duplicated description for controls blocks"
This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
* Correct block name and description
* remove duplicated description for controls blocks
* remove duplicated title and desc
* Revert "remove duplicated description for controls blocks"
This reverts commit ed5417eb0e5191ed2f1def2a04c9e724fe70856a.
* Set default style to link-button mixin
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* Add new mixin for links in filter blocks
* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page
* Add filter-link-button mixin that can be used in filter blocks
* Remove link-button styles that were moved to filter-link-button mixin
By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.
The styles for link button in filter blocks should reside in filter-link-button mixin.
* Set default style to link-button mixin
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* Add new mixin for links in filter blocks
* Revert change to link-button mixin to prevent it to affect link buttons on Checkout page
* Add filter-link-button mixin that can be used in filter blocks
* Remove link-button styles that were moved to filter-link-button mixin
By default, link-button mixin styles should have only styles from the text-button mixin and also be underlined.
The styles for link button in filter blocks should reside in filter-link-button mixin.
It was identified that we currently have 3 different behaviors for links used in the application. In issue woocommerce/woocommerce-blocks#1778, it was discussed a set of good practices that we should follow in order to obtain consistency between links.
Currently, the link-button mixin is already used by the 'Clear all' button in the Active Filters block, so the idea was to increment it with a common pattern (font size small, font-weight normal, underlined by default and not underlined when on hover) that can be reused by other components (for example FilterResetButton).
* Change link-button mixin to make it attend the expected default style for links
* Replace text-button with link-button mixin in FilterResetButton component
* fix infinite rerendering issue for active filter block when use with PHP template or site editor
* group useQueryStateByKey calls
* update deps array
* Refresh the default payment method only if the active one is unavailable
* Add new type for serializable data store payment method
* Update uses of PaymentMethods/ExpressPaymentMethods to the plain version
* Add tests for setAvailablePaymentMethods action
* Update data store key in tests
* Add attributes, settings, and editor PQ settings.
- Adds isDescendentOfQueryLoop attribute and sets up usage in editor.
- Connects Context (via useContext) in editor.
- Sets up necessary hierarchy in block index file settings.
* Add server-side rendered product price.
Adds the SSR output for the atomic Price block for PQ support.
* Remove Save attribute from JS index.
To allow for the block to be SSR, we need to remove the Save
attrubite/function on the JS side and allow for the PHP class to handle
it on the backend.
* Update PHP asset register method for added clarity
* Adjust block attr/context spreading for clarity.
* register filter wrapper block
* register block variation
* rename the active filters wrapper
* prevent 404 error
* Revert "prevent 404 error"
This reverts commit 8b6cb7c6658b2a5a99b890b67f1dce8c1c51cdbf.
* render parent wrapper block
* support price filter block
* hide the active filter block from inserter
* swap the title of wrapper and inner filter block for active filters
* hide the legacy heading for the price filter
* update block title and description for active filters and price filter
* remove heading control for price filter
* remove heading control for active filters
* update pattern
* try: upgrade button
* limit the number of inner block to 2
* prevent removing the inner filter block
* Revert "prevent removing the inner filter block"
This reverts commit 83b7feed78a7a7f50fd5799d1706faa9f2fc9050.
* convert stock filter to inner block
* refactor block upgrade button to share between filter blocks
* update default heading
* update pattern
* update icon and title
* Fix stock filter error by importing translations package
* Upgrade Active Filters name to Active Filter Controls
* Add upgrade support to price filter
* Convert attribute filter to inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7101)
* wip: convert attribute filter to inner block
* fix: render inner attribute filter block on the front end
* refactor: inner block wrapper, extract the attribute parsing logic into a utility
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
* Set correct attribute on the new filter blocks when they are upgraded
* Use the Warning component to display the upgrade message so it is consistent with Gutenberg
* address code review
* better detect legacy block to show the upgrade notice
* rename UpgradeToolbarButton to UpgradeNotice
* add upgrade notice to the stock filter block
* rename InnerBlockWrapper to BlockWrapper
* attribute-filter: control wrapper visibility
* passing block attributes down to inner active filters control block
* fix styling of inner attribute filter control block
* passing attribute to inner price filter control block
* passing down the attribute to inner stock filter control block
* remove unneccessary parsing
* use default scope for variations
* fix default attribute values
* use default block appender
* fix: lock control blocks
* remove dynamic title code from attribute filter block
* register active filters as variation and set it to the default that overrides the base block
* fix isActive for default variation
* fix: isActive logic for the active filters block
* register side effect
* fix ts error
* e2e: fix active filters block backend test
* e2e: fix frontend active filters test
* e2e: fix attribute filter test
* e2e: fix price filter test
* e2e: fix stock filter test
* e2e: update fixture
* e2e: fix attribute filter test
* remove invalid test
* e2e: update heading selector for price filter in backend test
* e2e: fixe backend price filter heading test
* fix: patterns i18n
* fix: heading level when upgrading the block
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Track most recent inner blocks in useForcedLayout
* Force useSelect to re-select when we know innerBlocks has changed
* Rename mapSelect back to select
* Add forcedBlocksInserted to callback deps
* Add documentation for validation data store
Co-authored-by: Niels Lange <info@nielslange.de>
* Use correct file path for validation data store docs
* Fix typo in hasValidationErrors documentation
* Add parameters and example of getValidationError
* Improve description of getValidationErrorId
* Fix typo in hasValidationErrors
* Document clearValidationErrors
* Add documentation and example for setValidationErrors
* Add documentation for clearAllValidationErrors
* Add documentation for hideValidationError
* Add documentation for showValidationError
* Add overview section
* Update hideValidationError documentation
* Add showValidationErrors documentation
* Update table of contents
* Fix typo in action name and add example
* Fix typo in hasValidationErrors
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Rename payment-method-data-context to payment-event-context and tidy up types and things
* Rename uses of PAYMENT_METHOD_DATA_STORE_KEY to PAYMENT_STORE_KEY
* Rename __internalInitializePaymentMethodDataStore and unsubscribeInitializePaymentMethodDataStore
* Rename unsubscribeInitializePaymentMethodDataStore
* Rename setProcessingResponse to setPaymentResult and remove setOrderId from the checkout data store actions
* Fix accidentally changing data exposed to the observers
* Rename all checkout actions with the __internal prefix
* Prefix all payment method data store actions with __internal
* Pedantic spacing
* Fix ts error
* Remove object from sanitizeHTML return value
* Import sanitizeHTML from utils
* Fix dangerously set inner HTML format
* Update package-lock
* Update package-lock
* Update package-lock
* Update @types/dompurify version
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Add showRemoveItemLink filter
This is a filter that will allow developers to set whether the link to remove a cartItem is visible
* Add test for showRemoveItemLink filter
* Remove unnecessary quantity override
* Move definition of cart to avoid hardcoding id value in filter
* Updated documentation for `showRemoveItemLink` filter
* available-filters.md tweak
* available-filters.md tweak
* Add example to filters for showRemoveItemLink
* Remove whitespace
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Refactor Product Image anchor render function.
Move closing tag for the anchor into the render function and pass badge
and image output into anchor children as args.
Also removes duplicate border radius logic from anchor render function,
as it is already present on the class render method.
* Clean up sprintf args.
* Replace deprecated placeholder function.
The `woocommerce_placeholder_img_src` function has been depricated since
v3.0. This replaces that function with the `wc_placeholder_img_src`
function.
* Re-apply token support
* Updated nonce headers
* Updated package-lock.json
* test commit to debug failing git hooks
* Revert "test commit to debug failing git hooks"
This reverts commit e64086b0a7aede154705be09c7b3433b08bc1e34.
* JsonWebToken utility class for generating and validating HS256 JWT tokens. Removed third-party JWT library.
* Add ext-hash to composer (required by hash_hmac())
* Removed unnecessary method param.
* Tests for retrieving cart contents via Cart-Token
* Removed token tests ( we can't properly test cart token functionality until we refactor the way it intercepts calls to replace the session object )
* Abstracted payload from JsonWebToken class. We can now use it to encode custom payloads and reuse them wherever we want.
* Fixed missing check for token expiration in the payload.
* MD lint error and config fix
* Update composer.lock
* Fixed bug using the wrong nonce header.
* Refactor to properly save session data based on cart token.
* Refactored DB queries to properly use prepared statement
* Removed underscore prefix for class attributes
* Fixed spaces instead of tabs indenting composer.json. Cleaned up .editorconfig
* Cleaned up borked .md comments.
* Comment for WP_SETUP_CONFIG check.
* Reverted SQL prepared statement for including table names.
* Used hash_equals() for signature comparison. Renamed some wrongly named properties.
* Updated composer.lock
* Reverted some accidentally removed lines on some documentation files.
* Reverted accidentally removed line on docs/internal-developers/testing/releases/404.md
* Changed param type from mixed to
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Remove setPristine as it's not used
* Comment checkout actions
* Rename setProcessingResponse to setPaymentResult and remove setOrderId from the checkout data store actions
* Add comments to payment actions
* Update documentation with data stores
* Fix accidentally changing data exposed to the observers
* Document missing parameters for actions
* WIP add filter for place order button label
* Solve TS issue
* Add display priority
* Refactor display priority
* WIP Implement useMemo()
* Try using a global cache
* Add docs for placeOrderLabel filter
* Update docs/third-party-developers/extensibility/checkout-block/available-filters.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Adjust docs
* Rename “placeOrderLabel” to “placeOrderButtonLabel”
* Update assets/js/types/type-defs/payments.ts
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
* Add interactivity to the Product by Rating filter block
* Fix block with the latest repo changes
* Product by Rating: Code tidying up
* Add an experimental build gate and update block title and description
* Remove redundant title and description
* Add support for the CheckboxList component in the Products by Rating block
* Products by Rating: Minor code clean-up
* Active Filters: Fix the Clear All button for Ratings. Closes #woocommerce/woocommerce-blocks#7172
* Products by Rating: Add misc TS fixes
* Product Query: Fix pagination issue
* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790
Product Query - Add support for the Filter By Price Block
* fix query relation
* fix on sale query
* fix bugged pagination and on-sale filter after refactor
* fix reload page when the Filter By Price block is used with All Products block
* use array_intersect instead of array_merge
* Convert checkout context to data store - part 1 (https://github.com/woocommerce/woocommerce-blocks/pull/6232)
* Add checkout data store
* wip on checkout data store
* CheckoutContext now uses the checkout store
* Investigated and removed setting the redirectUrl on the default state
* update extension and address hooks to use checkout data store
* use checkout data store in checkout-processor and use-checkout-button
* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity
* Remove useCheckoutContext from shipping provider
* Remove isCalculating from state
* Removed useCheckoutContext from lots of places
* Remove useCheckoutContext from checkout-payment-block
* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block
* add isCart selector and action and update the checkoutstate context
* Fixed redirectUrl bug by using thunks
* Remove dispatchActions from checkout-state
* Change SET_HAS_ERROR action to be neater
* Thomas' feedback
* Tidy up
* Oops, deleted things I shouldn't have
* Typescript
* Fix types
* Fix tests
* Remove isCart
* Update docs and remove unecessary getRedirectUrl() selector
* set correct type for preloadedCheckoutData
* Remove duplicate Address type
* Fix missing addresses from type-defs index
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Revert feedback changes
* REvert feedback formatting
* Update docs formatting
* Delete empty types.ts file
* remove merge conflict from docs
* Correct linting in docs
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Move checkout state code into thunks and rename `CheckoutState` context to `CheckoutEvents` (https://github.com/woocommerce/woocommerce-blocks/pull/6455)
* Add checkout data store
* wip on checkout data store
* CheckoutContext now uses the checkout store
* Investigated and removed setting the redirectUrl on the default state
* update extension and address hooks to use checkout data store
* use checkout data store in checkout-processor and use-checkout-button
* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity
* Remove useCheckoutContext from shipping provider
* Remove isCalculating from state
* Removed useCheckoutContext from lots of places
* Remove useCheckoutContext from checkout-payment-block
* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block
* add isCart selector and action and update the checkoutstate context
* Fixed redirectUrl bug by using thunks
* Remove dispatchActions from checkout-state
* Change SET_HAS_ERROR action to be neater
* Thomas' feedback
* Tidy up
* Oops, deleted things I shouldn't have
* Typescript
* Fix types
* Fix tests
* Remove isCart
* Update docs and remove unecessary getRedirectUrl() selector
* validate event emitter button
* Added thunks in a separate file
* Call thunks from checkout-state
* Checkout logic tested and working
* Remove dependency injection as much as poss, tidy up and fix some TS errors
* Fix types in thunks.ts
* Fixed some ts errors
* WIP
* Fixed bug
* Shift side effects from checkout-state to checkout-processor
* Revert "Shift side effects from checkout-state to checkout-processor"
This reverts commit 059533da4eb34f9982f66cd4adacc7b2c24f939f.
* Rename CheckoutState to CheckoutEvents
* Move status check outside the thunk
* remove duplicate EVENTS constant
* remove temp buttons
* Remove console logs
* Augment @wordpress/data package with our new store types
* Add correct type for CheckoutAction
* Remove createErrorNotice arg from runCheckoutAfterProcessingWithErrorObservers
* Remove createErrorNotice from emit event types
* Use type keyword when importing types
* Add correct types for dispatch and select in thunks
* Update wordpress/data types
* Replace store creation with new preferred method
* Set correct action type on reducer
* Remove unnecessary async from thunk
* add CHECKOUT_ prefix to checkout events again
* export EVENTS with eveything else in checkout0-events/event-emit
* Remove duplicate SelectFromMap and TailParameters
* Updated type for paymentStatus
* TODO remove wp/data experimental thunks
* Remove `setCustomerId` from events and `processCheckoutResponseHeaders` (https://github.com/woocommerce/woocommerce-blocks/pull/6586)
* Prevent passing dispatch, instead get actions direct from store
* Get setCustomerId from the store instead of passing it to processCheckoutResponseHeaders
* Revert "Prevent passing dispatch, instead get actions direct from store"
This reverts commit 4479a2ef5599d9c8d99c3629616b3d662210fc08.
* Auto stash before revert of "Prevent passing dispatch, instead get actions direct from store"
* Remove duplicate dispatch
* Fix unit tests
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Refactor selectors to not return functions anymore
This is a poor DevEx and naming did not reflect what the selector was returning.
* Update combobox to be more explicit when selecting validation error
* Update useValidation to use the new getValidationError selector
* Include @woocommerce/base-hooks in tsconfig
* Update ValidationInputError to use new selector
* Update ValidatedTextInput to use new selectors
* Prevent reference errors when getting validation errors in ComboBox
* Defend against case where message prop of error object is undefined
* Fix totals/coupon to use new validation selector
* Use validation data store in CheckoutTerms block
* Update AddressForm to use new validation selector
* Update AttributeSelectControl to use new validation selector
* Fix syntax error in ValidatedTextInput
* Fix multiple import error from rebase
* Fix lint issue in useStoreCartItemQantity
* Fix tests to reflect new selector API
* Remove unused validation prop from CheckoutTermsBlock
* Change CheckoutTermsBlock unit tests to use validation data store
* Fix JSDOC syntax
* fix merge conflict in checkout-api.md
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Mock getCartTotals
* Change test to use data store instead of context
* Move payment method context test to data store selectors
* Change description of test suite
* Bump commit to trigger tests
* Fix path in test
* update package lock
* Set correct state payment method reducer tests/use correct actions
* Get saved payment methods from store not context
* Mock stores and update tests to allow switching payment methods
* Update tests to get onSubmit from checkoutEventsContext
* Remove cartTotalsLoaded check from payment method initialize check
* Make PaymentMethods test wait until payments initialized
* initialize payment method data store when cart is loaded
* Remove unneeded actions and add initializePaymentMethodDataStore
* Remove check for cart totals loaded in checkPaymentMethods
* Remove updateAvilablePaymentMethods from registry
* Remove unneeded mock
* Remove unused import
* Rename imports to fix eslint errors
* Remove unused imports
* Remove return false from checkPaymentMethods
* Remove unnecessary setPaymentMethodsInitialized call
* Add todo comment to track refactoring opportunity
* Remove savedpayment methods from payment method context and rename it
* Rename payment method data context to payment method events context
* Add tests for setDefaultPaymentMethods
* Optimize the availablePaymentMethods state data
Store only the "name" attribute for now.
* Get list of payment methods from the registry instead of the store
We are using this hook to get some React elements in the payment method
object. So, we are getting the raw data directly from the registry instead
of the store.
* Fix payment state not loading on the Checkout edit page
* Handle checkout edit page case
* Fix infinite loop error on C&C Blocks
* Include @wordpress/redux-routine in transformIgnorePatterns jest config
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Move paymentMethodDataProvider into a data store (https://github.com/woocommerce/woocommerce-blocks/pull/6208)
* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type
* Add default state for PaymentMethod data store
* Add preliminary action types
* Add preliminary action dispatchers
* Create payment method data store
* Add preliminary reducers for payment method data store
* Add preliminary selectors for payment method data store
* Add reducers/actions for registering payment methods
* Export payment method data store key
* Add test for payment method data reducers
* Add shouldSavePaymentMethod selector
* Add store key as constant
* Add more action types for registering and initializing payment methods
* Get active payment method from data store instead of from context
* Add registered methods to default state of payment method data store
* Dispatch name of registered payment method to payment method data store
* Remove setShouldSavePayment from payment method dispatcher and types
* Get payment methods from registry instead of payment context
* Add available payment methods to store
* Add function to check whether payment methods are allowed to be used
* Add selector to check if payments are initialised
* Remove resolvers and add controls to payment method data store
* Change type of payment requirements to string[]
* Turn addRegistered and addRegisteredExpress into generators
This is so we can check each payment method's validity before adding it to the list of available payment methods
* Add action type for setting express payments as initialized
* Only select from available methods in payment method options
* Remove argument from addRegisteredPaymentMethod in payment method registry
* Rename folder and store name to not contain the word data
* Add selectors for express payment methods and their initialisation
* Delete controls again in favour of thunks
* Rename payment-method-data to payment-methdods
* Create new setDefaultPaymentMethod function
This will set the payment method when the cart loads.
* Add CustomerPaymentMethodConfiguration type
* Make getAvailableExpressPaymentMethods return correct data
* Check express methods and normal methods when cart changes
* Add action for setting active express payment methods
* Handle express methods in checkPaymentMethodCanPay
* Hide express payments area if none are available
* Add selector for paymentMethodData
* Add customer data to default state and add selector for it
* Add setPaymentStatus action and reducer case
* Set the default payment method when one isn't selected
* Correct types on getCustomerPaymentMethods
* Set status in data store alongside context status
* Comment out active gateway selection - remove later
* Set status in express payment methods in data store
* Use correct key in payment method data context
* Directly check payment methods from the list in blocks-registry
* Add semicolon to import statement
* Fix payment method data state call
* Get paymentMethodData from store not context
* Fix linting issues
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Rebase on the update/checkout-data-store branch & Fix failed payments (https://github.com/woocommerce/woocommerce-blocks/pull/6587)
* Add checkout data store
* wip on checkout data store
* CheckoutContext now uses the checkout store
* Investigated and removed setting the redirectUrl on the default state
* update extension and address hooks to use checkout data store
* use checkout data store in checkout-processor and use-checkout-button
* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity
* Remove useCheckoutContext from shipping provider
* Remove isCalculating from state
* Removed useCheckoutContext from lots of places
* Remove useCheckoutContext from checkout-payment-block
* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block
* add isCart selector and action and update the checkoutstate context
* Fixed redirectUrl bug by using thunks
* Remove dispatchActions from checkout-state
* Change SET_HAS_ERROR action to be neater
* Thomas' feedback
* Tidy up
* Oops, deleted things I shouldn't have
* Typescript
* Fix types
* Fix tests
* Remove isCart
* Update docs and remove unecessary getRedirectUrl() selector
* set correct type for preloadedCheckoutData
* Remove duplicate Address type
* Fix missing addresses from type-defs index
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Revert feedback changes
* REvert feedback formatting
* Update docs formatting
* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type
* Add default state for PaymentMethod data store
* Add preliminary action types
* Add preliminary action dispatchers
* Create payment method data store
* Add preliminary reducers for payment method data store
* Add preliminary selectors for payment method data store
* Add reducers/actions for registering payment methods
* Export payment method data store key
* Add test for payment method data reducers
* Add shouldSavePaymentMethod selector
* Add store key as constant
* Add more action types for registering and initializing payment methods
* Get active payment method from data store instead of from context
* Add registered methods to default state of payment method data store
* Dispatch name of registered payment method to payment method data store
* Remove setShouldSavePayment from payment method dispatcher and types
* Get payment methods from registry instead of payment context
* Add available payment methods to store
* Add function to check whether payment methods are allowed to be used
* Add selector to check if payments are initialised
* Remove resolvers and add controls to payment method data store
* Change type of payment requirements to string[]
* Turn addRegistered and addRegisteredExpress into generators
This is so we can check each payment method's validity before adding it to the list of available payment methods
* Add action type for setting express payments as initialized
* Only select from available methods in payment method options
* Remove argument from addRegisteredPaymentMethod in payment method registry
* Rename folder and store name to not contain the word data
* Add selectors for express payment methods and their initialisation
* Delete controls again in favour of thunks
* Rename payment-method-data to payment-methdods
* Create new setDefaultPaymentMethod function
This will set the payment method when the cart loads.
* Add CustomerPaymentMethodConfiguration type
* Make getAvailableExpressPaymentMethods return correct data
* Check express methods and normal methods when cart changes
* Add action for setting active express payment methods
* Handle express methods in checkPaymentMethodCanPay
* Hide express payments area if none are available
* Add selector for paymentMethodData
* Add customer data to default state and add selector for it
* Add setPaymentStatus action and reducer case
* Set the default payment method when one isn't selected
* Correct types on getCustomerPaymentMethods
* Set status in data store alongside context status
* Comment out active gateway selection - remove later
* Set status in express payment methods in data store
* Directly check payment methods from the list in blocks-registry
* Add semicolon to import statement
* Fix payment method data state call
* Get paymentMethodData from store not context
* Add addPaymentMethodData action/reducer case
* Update payment method on payment success
* Add 'getCurrentStatus' selector
* Remove the temporary solution
For getting payment method data into the data store
* Prevent the 'success' context action from being dispatched
* Update the "setPaymentStatus" data store action
Accept status as an object instead of string
* Fix the "currentStatus" reducer state update value
* Get payment data into data store
* Set the correct payment status to data store
* Get the success status of payment from data store
* Use store data in the payment dispatchers
Replace the React useReducers action in the payment dispatchers file with
the payment method data store
* Get payment status from data store
* Use data store for the payment error status
* Use payment data store failed status
* Use payment data store for the isFinished status
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Fix merge conflict error
* Set & get the provider's state from our data store instead of React's useReducer (https://github.com/woocommerce/woocommerce-blocks/pull/6588)
* Add checkout data store
* wip on checkout data store
* CheckoutContext now uses the checkout store
* Investigated and removed setting the redirectUrl on the default state
* update extension and address hooks to use checkout data store
* use checkout data store in checkout-processor and use-checkout-button
* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity
* Remove useCheckoutContext from shipping provider
* Remove isCalculating from state
* Removed useCheckoutContext from lots of places
* Remove useCheckoutContext from checkout-payment-block
* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block
* add isCart selector and action and update the checkoutstate context
* Fixed redirectUrl bug by using thunks
* Remove dispatchActions from checkout-state
* Change SET_HAS_ERROR action to be neater
* Thomas' feedback
* Tidy up
* Oops, deleted things I shouldn't have
* Typescript
* Fix types
* Fix tests
* Remove isCart
* Update docs and remove unecessary getRedirectUrl() selector
* set correct type for preloadedCheckoutData
* Remove duplicate Address type
* Fix missing addresses from type-defs index
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Revert feedback changes
* REvert feedback formatting
* Update docs formatting
* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type
* Add default state for PaymentMethod data store
* Add preliminary action types
* Add preliminary action dispatchers
* Create payment method data store
* Add preliminary reducers for payment method data store
* Add preliminary selectors for payment method data store
* Add reducers/actions for registering payment methods
* Export payment method data store key
* Add test for payment method data reducers
* Add shouldSavePaymentMethod selector
* Add store key as constant
* Add more action types for registering and initializing payment methods
* Get active payment method from data store instead of from context
* Add registered methods to default state of payment method data store
* Dispatch name of registered payment method to payment method data store
* Remove setShouldSavePayment from payment method dispatcher and types
* Get payment methods from registry instead of payment context
* Add available payment methods to store
* Add function to check whether payment methods are allowed to be used
* Add selector to check if payments are initialised
* Remove resolvers and add controls to payment method data store
* Change type of payment requirements to string[]
* Turn addRegistered and addRegisteredExpress into generators
This is so we can check each payment method's validity before adding it to the list of available payment methods
* Add action type for setting express payments as initialized
* Only select from available methods in payment method options
* Remove argument from addRegisteredPaymentMethod in payment method registry
* Rename folder and store name to not contain the word data
* Add selectors for express payment methods and their initialisation
* Delete controls again in favour of thunks
* Rename payment-method-data to payment-methdods
* Create new setDefaultPaymentMethod function
This will set the payment method when the cart loads.
* Add CustomerPaymentMethodConfiguration type
* Make getAvailableExpressPaymentMethods return correct data
* Check express methods and normal methods when cart changes
* Add action for setting active express payment methods
* Handle express methods in checkPaymentMethodCanPay
* Hide express payments area if none are available
* Add selector for paymentMethodData
* Add customer data to default state and add selector for it
* Add setPaymentStatus action and reducer case
* Set the default payment method when one isn't selected
* Correct types on getCustomerPaymentMethods
* Set status in data store alongside context status
* Comment out active gateway selection - remove later
* Set status in express payment methods in data store
* Directly check payment methods from the list in blocks-registry
* Add semicolon to import statement
* Fix payment method data state call
* Get paymentMethodData from store not context
* Add addPaymentMethodData action/reducer case
* Update payment method on payment success
* Add 'getCurrentStatus' selector
* Remove the temporary solution
For getting payment method data into the data store
* Prevent the 'success' context action from being dispatched
* Update the "setPaymentStatus" data store action
Accept status as an object instead of string
* Fix the "currentStatus" reducer state update value
* Get payment data into data store
* Set the correct payment status to data store
* Get the success status of payment from data store
* Use store data in the payment dispatchers
Replace the React useReducers action in the payment dispatchers file with
the payment method data store
* Get payment status from data store
* Use data store for the payment error status
* Use payment data store failed status
* Use payment data store for the isFinished status
* Update the setPaymentStatus argument
* Set up setRegisteredPaymentMethods in data store
* Use the data store version of the registeredPaymentMethods
* Fix the default state type of the registeredPaymentMethods
* Set up setRegisteredExpressPaymentMethod in data store
* Use the data version of the registred express payment methods
* Set the correct action type for removing payment methods
* Fix default state express payment methods type
* Use the store data version of activePaymentMethod
* Use setActivePaymentMethod in the dispatchers file
And refactor code
* Update payment status arguments for express payment methods
* Use paymentMethodData from the data store
* Use payment method's errorMessage from data store
* Update paymentMethods list in data store reducer
* Replace remaining payment context data with data store
* Clean up payment method context file
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Get payment method data directly from the data store instead of the usePaymentMethodDataContext hook (https://github.com/woocommerce/woocommerce-blocks/pull/6589)
* Add checkout data store
* wip on checkout data store
* CheckoutContext now uses the checkout store
* Investigated and removed setting the redirectUrl on the default state
* update extension and address hooks to use checkout data store
* use checkout data store in checkout-processor and use-checkout-button
* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity
* Remove useCheckoutContext from shipping provider
* Remove isCalculating from state
* Removed useCheckoutContext from lots of places
* Remove useCheckoutContext from checkout-payment-block
* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block
* add isCart selector and action and update the checkoutstate context
* Fixed redirectUrl bug by using thunks
* Remove dispatchActions from checkout-state
* Change SET_HAS_ERROR action to be neater
* Thomas' feedback
* Tidy up
* Oops, deleted things I shouldn't have
* Typescript
* Fix types
* Fix tests
* Remove isCart
* Update docs and remove unecessary getRedirectUrl() selector
* set correct type for preloadedCheckoutData
* Remove duplicate Address type
* Fix missing addresses from type-defs index
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Revert feedback changes
* REvert feedback formatting
* Update docs formatting
* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type
* Add default state for PaymentMethod data store
* Add preliminary action types
* Add preliminary action dispatchers
* Create payment method data store
* Add preliminary reducers for payment method data store
* Add preliminary selectors for payment method data store
* Add reducers/actions for registering payment methods
* Export payment method data store key
* Add test for payment method data reducers
* Add shouldSavePaymentMethod selector
* Add store key as constant
* Add more action types for registering and initializing payment methods
* Get active payment method from data store instead of from context
* Add registered methods to default state of payment method data store
* Dispatch name of registered payment method to payment method data store
* Remove setShouldSavePayment from payment method dispatcher and types
* Get payment methods from registry instead of payment context
* Add available payment methods to store
* Add function to check whether payment methods are allowed to be used
* Add selector to check if payments are initialised
* Remove resolvers and add controls to payment method data store
* Change type of payment requirements to string[]
* Turn addRegistered and addRegisteredExpress into generators
This is so we can check each payment method's validity before adding it to the list of available payment methods
* Add action type for setting express payments as initialized
* Only select from available methods in payment method options
* Remove argument from addRegisteredPaymentMethod in payment method registry
* Rename folder and store name to not contain the word data
* Add selectors for express payment methods and their initialisation
* Delete controls again in favour of thunks
* Rename payment-method-data to payment-methdods
* Create new setDefaultPaymentMethod function
This will set the payment method when the cart loads.
* Add CustomerPaymentMethodConfiguration type
* Make getAvailableExpressPaymentMethods return correct data
* Check express methods and normal methods when cart changes
* Add action for setting active express payment methods
* Handle express methods in checkPaymentMethodCanPay
* Hide express payments area if none are available
* Add selector for paymentMethodData
* Add customer data to default state and add selector for it
* Add setPaymentStatus action and reducer case
* Set the default payment method when one isn't selected
* Correct types on getCustomerPaymentMethods
* Set status in data store alongside context status
* Comment out active gateway selection - remove later
* Set status in express payment methods in data store
* Directly check payment methods from the list in blocks-registry
* Add semicolon to import statement
* Fix payment method data state call
* Get paymentMethodData from store not context
* Add addPaymentMethodData action/reducer case
* Update payment method on payment success
* Add 'getCurrentStatus' selector
* Remove the temporary solution
For getting payment method data into the data store
* Prevent the 'success' context action from being dispatched
* Update the "setPaymentStatus" data store action
Accept status as an object instead of string
* Fix the "currentStatus" reducer state update value
* Get payment data into data store
* Set the correct payment status to data store
* Get the success status of payment from data store
* Use store data in the payment dispatchers
Replace the React useReducers action in the payment dispatchers file with
the payment method data store
* Get payment status from data store
* Use data store for the payment error status
* Use payment data store failed status
* Use payment data store for the isFinished status
* Update the setPaymentStatus argument
* Set up setRegisteredPaymentMethods in data store
* Use the data store version of the registeredPaymentMethods
* Fix the default state type of the registeredPaymentMethods
* Set up setRegisteredExpressPaymentMethod in data store
* Use the data version of the registred express payment methods
* Set the correct action type for removing payment methods
* Fix default state express payment methods type
* Use the store data version of activePaymentMethod
* Use setActivePaymentMethod in the dispatchers file
And refactor code
* Update payment status arguments for express payment methods
* Use paymentMethodData from the data store
* Use payment method's errorMessage from data store
* Update paymentMethods list in data store reducer
* Replace remaining payment context data with data store
* Clean up payment method context file
* Get payment method state from data store in the checkout submit hook
* Copy types.ts file into the payment data store folder
* Fix isExpressPaymentMethodActive selector
* Move the entire currentStatus into the data store
* Replace the payment context state with the data store
* Fix getActiveSavedToken & clean up the context file
* Use the accutrate name of the "createErrorNotice"
* Update the payment method data store key import
* Diable unused state from the context
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Refactor the payment method data store & context (https://github.com/woocommerce/woocommerce-blocks/pull/6607)
* Add checkout data store
* wip on checkout data store
* CheckoutContext now uses the checkout store
* Investigated and removed setting the redirectUrl on the default state
* update extension and address hooks to use checkout data store
* use checkout data store in checkout-processor and use-checkout-button
* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity
* Remove useCheckoutContext from shipping provider
* Remove isCalculating from state
* Removed useCheckoutContext from lots of places
* Remove useCheckoutContext from checkout-payment-block
* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block
* add isCart selector and action and update the checkoutstate context
* Fixed redirectUrl bug by using thunks
* Remove dispatchActions from checkout-state
* Change SET_HAS_ERROR action to be neater
* Thomas' feedback
* Tidy up
* Oops, deleted things I shouldn't have
* Typescript
* Fix types
* Fix tests
* Remove isCart
* Update docs and remove unecessary getRedirectUrl() selector
* set correct type for preloadedCheckoutData
* Remove duplicate Address type
* Fix missing addresses from type-defs index
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Revert feedback changes
* REvert feedback formatting
* Update docs formatting
* Fix typographical error on LegacyRegisterExpressPaymentMethodFunction type
* Add default state for PaymentMethod data store
* Add preliminary action types
* Add preliminary action dispatchers
* Create payment method data store
* Add preliminary reducers for payment method data store
* Add preliminary selectors for payment method data store
* Add reducers/actions for registering payment methods
* Export payment method data store key
* Add test for payment method data reducers
* Add shouldSavePaymentMethod selector
* Add store key as constant
* Add more action types for registering and initializing payment methods
* Get active payment method from data store instead of from context
* Add registered methods to default state of payment method data store
* Dispatch name of registered payment method to payment method data store
* Remove setShouldSavePayment from payment method dispatcher and types
* Get payment methods from registry instead of payment context
* Add available payment methods to store
* Add function to check whether payment methods are allowed to be used
* Add selector to check if payments are initialised
* Remove resolvers and add controls to payment method data store
* Change type of payment requirements to string[]
* Turn addRegistered and addRegisteredExpress into generators
This is so we can check each payment method's validity before adding it to the list of available payment methods
* Add action type for setting express payments as initialized
* Only select from available methods in payment method options
* Remove argument from addRegisteredPaymentMethod in payment method registry
* Rename folder and store name to not contain the word data
* Add selectors for express payment methods and their initialisation
* Delete controls again in favour of thunks
* Rename payment-method-data to payment-methdods
* Create new setDefaultPaymentMethod function
This will set the payment method when the cart loads.
* Add CustomerPaymentMethodConfiguration type
* Make getAvailableExpressPaymentMethods return correct data
* Check express methods and normal methods when cart changes
* Add action for setting active express payment methods
* Handle express methods in checkPaymentMethodCanPay
* Hide express payments area if none are available
* Add selector for paymentMethodData
* Add customer data to default state and add selector for it
* Add setPaymentStatus action and reducer case
* Set the default payment method when one isn't selected
* Correct types on getCustomerPaymentMethods
* Set status in data store alongside context status
* Comment out active gateway selection - remove later
* Set status in express payment methods in data store
* Directly check payment methods from the list in blocks-registry
* Add semicolon to import statement
* Fix payment method data state call
* Get paymentMethodData from store not context
* Add addPaymentMethodData action/reducer case
* Update payment method on payment success
* Add 'getCurrentStatus' selector
* Remove the temporary solution
For getting payment method data into the data store
* Prevent the 'success' context action from being dispatched
* Update the "setPaymentStatus" data store action
Accept status as an object instead of string
* Fix the "currentStatus" reducer state update value
* Get payment data into data store
* Set the correct payment status to data store
* Get the success status of payment from data store
* Use store data in the payment dispatchers
Replace the React useReducers action in the payment dispatchers file with
the payment method data store
* Get payment status from data store
* Use data store for the payment error status
* Use payment data store failed status
* Use payment data store for the isFinished status
* Update the setPaymentStatus argument
* Set up setRegisteredPaymentMethods in data store
* Use the data store version of the registeredPaymentMethods
* Fix the default state type of the registeredPaymentMethods
* Set up setRegisteredExpressPaymentMethod in data store
* Use the data version of the registred express payment methods
* Set the correct action type for removing payment methods
* Fix default state express payment methods type
* Use the store data version of activePaymentMethod
* Use setActivePaymentMethod in the dispatchers file
And refactor code
* Update payment status arguments for express payment methods
* Use paymentMethodData from the data store
* Use payment method's errorMessage from data store
* Update paymentMethods list in data store reducer
* Replace remaining payment context data with data store
* Clean up payment method context file
* Get payment method state from data store in the checkout submit hook
* Copy types.ts file into the payment data store folder
* Fix isExpressPaymentMethodActive selector
* Move the entire currentStatus into the data store
* Replace the payment context state with the data store
* Fix getActiveSavedToken & clean up the context file
* Use the accutrate name of the "createErrorNotice"
* Update the payment method data store key import
* Diable unused state from the context
* Get enabled customer payment methods using data store selector
* Remove remaining useReducer action from the dispatchers file
* Update types and remove unused vars
* Remove the payment method dispatchers hook
* Refactor & clean up (remove unused files)
* Remove commented line from payment methods types
* Move event emitter into thunks
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Remove checkout-state after merge conflicts
* Fix linting errors
* Move types to types.ts
* Move default states into respective store folders
* Fix types and add comment
* Move setExpressPaymentError to payment-methods store
* fix express payment methods not showing up
* Check if payment method is active from the state
* Add comments
* Remove commented out code in payment method data context
* Display an error in the check-payment-methods directly from data store
* Remove use-emit-response hook and move utils in event-emit/utils.ts
* Use correct action property to remove payment methods
* Fix formatting
* Only try to initialize payment methods when cart is done loading
* Add function to order payment methods from server
* Add payment methods in the correct order
* Prevent adding registered payment methods before cart is ready
* Ensure payment methods get removed from state when deregistered
* Reorder setting default payment methods to add customer methods first
* Get customer methods from store not context
* Remove error from payment-method state and associated selectors
* Remove use-payment-method-registration and update the payment method state to remove the duplicated registeredPaymentMethods
* Remove errorMessage from payment-methods store
* Rename customerPaymentMethods -> savedPaymentMethods
* Order payment methods when validating
* Refactor payment-methods.js
* Fix "Payment methods not set in editor" woocommerce/woocommerce-blocks#6655 bug
We never get to load the payment methods object in the editor mode
because there are no cart totals to load.
* Initialize payment methods when available payments are loaded
* Remove duplicate code
* Fix data store state mutation anti-pattern
A Redux rule is to never mutate the state in a reducer to avoid any unexpected results
* Set availablePaymentMethods to the paymentMethods object
Instead of its keys. We can get the keys using "Object.keys".
* Use the available ordered payment methods
The `getPaymentMethods` & `getExpressPaymentMethods` may include unordored
& unavailable payment methods.
* Get the correct value from the emit event response
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Add validation reducers, actions, and action types
* Add selector for getValidationErrors
* Export store key and register store
* Export validation store key
* Move TextInput files to checkout package
* Export ValidatedTextInput from blocks-checkout package
* Update imports of ValidatedTextInput to reflect new location
* Use the validation wp-data store for showing error messages
* Export getValidationError in checkout package
* Move validation store to checkout package
* Move ValidationInputError to blocks-checkout package
* Only export "exposedSelectors" from validation
* Convert validation context to data store
* Fixed linting error
* Fixed linting error
* Change the validation selectors to return a function
* Convert reducer and selectors to TS
* Remove superfluous comments and improve test titles
* Test to ensure visible errors remain visible
* Make test for hasValidationErrors more robust
* Augment the wp-data module to include our selectors and actions
* Removed unused `exposedSelectors` variable
* Remove TS error because of `instanceId` on props
* Remove unnecessary as const
* Use function returned by getValidationError
* Use correct selector/action names now context has been decoupled
* hide validation error when input value changes
* Add correct aria-describedBy now we can get error id from store
* Clear validation error from store when component unmounts
* Clear validation error if input is valid
* convert ValidationInputError to TS and get correct id/error from store
* Ensure checkout block doesn't break when there are no errors
* Get validation data from the store instead of context
* Update country input to remove validation context
* Move validation store out of checkout package
* Move TextInput and ValidationInputError back out of the checkout package
* Remove duplicate internal styles comment
* Remove exports that no longer exist
* Get validation store key from block-data
* Make attribute-select-control use validation data store
* Export FieldValidationStatus type
* Make combobox use validation store not context
* Make Address use validation store not context
* Make Address use validation store not context
* Use hasValidationErrors selector as a function in shipping calculator
* Remove validation context from coupon story
* Import VALIDATION_STORE_KEY from correct location
* Stop coupon story from erroring
* Update useStoreCartCoupons to use validation store not context
* Make TotalsCoupon use validation store instead of context
* Make AddToCartFormContext use validation store not context
* Remove ValidationContext
* Import FieldValidationStatus from correct location
* Import ValidatedTextInput and ValidatedTextInput from correct location
* Remove ValidationContextProvider
* Update components to use validation store not context
* Update useValidation to use the data store
* Replace the validation context in checkout-events file
* Use the re-mapped path for the store key import
* Use "register" instead of the deprecated "registerStore"
* Fix import error of the "FieldValidationStatus" type
* Use TS instead of React's "PropTypes"
* Fix the type of "ValidationInputError" in the "payment-method-interface"
* Fix error not showing on the first place order click bug
We were mutating the state in the reducer, which prevented re-rendering
on state change
* Fix state mutation issue in the Validation reducer
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Add checkout data store
* wip on checkout data store
* CheckoutContext now uses the checkout store
* Investigated and removed setting the redirectUrl on the default state
* update extension and address hooks to use checkout data store
* use checkout data store in checkout-processor and use-checkout-button
* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity
* Remove useCheckoutContext from shipping provider
* Remove isCalculating from state
* Removed useCheckoutContext from lots of places
* Remove useCheckoutContext from checkout-payment-block
* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block
* add isCart selector and action and update the checkoutstate context
* Fixed redirectUrl bug by using thunks
* Remove dispatchActions from checkout-state
* Change SET_HAS_ERROR action to be neater
* Thomas' feedback
* Tidy up
* Oops, deleted things I shouldn't have
* Typescript
* Fix types
* Fix tests
* Remove isCart
* Update docs and remove unecessary getRedirectUrl() selector
* validate event emitter button
* Added thunks in a separate file
* Call thunks from checkout-state
* Checkout logic tested and working
* Remove dependency injection as much as poss, tidy up and fix some TS errors
* Fix types in thunks.ts
* Fixed some ts errors
* WIP
* Fixed bug
* Shift side effects from checkout-state to checkout-processor
* Revert "Shift side effects from checkout-state to checkout-processor"
This reverts commit 059533da4eb34f9982f66cd4adacc7b2c24f939f.
* Rename CheckoutState to CheckoutEvents
* Move status check outside the thunk
* remove duplicate EVENTS constant
* remove temp buttons
* Remove console logs
* Augment @wordpress/data package with our new store types
* Add correct type for CheckoutAction
* Remove createErrorNotice arg from runCheckoutAfterProcessingWithErrorObservers
* Remove createErrorNotice from emit event types
* Use type keyword when importing types
* Add correct types for dispatch and select in thunks
* Update wordpress/data types
* Replace store creation with new preferred method
* Set correct action type on reducer
* Remove unnecessary async from thunk
* add CHECKOUT_ prefix to checkout events again
* export EVENTS with eveything else in checkout0-events/event-emit
* Remove duplicate SelectFromMap and TailParameters
* Updated type for paymentStatus
* TODO remove wp/data experimental thunks
* Remove `setCustomerId` from events and `processCheckoutResponseHeaders` (https://github.com/woocommerce/woocommerce-blocks/pull/6586)
* Prevent passing dispatch, instead get actions direct from store
* Get setCustomerId from the store instead of passing it to processCheckoutResponseHeaders
* Revert "Prevent passing dispatch, instead get actions direct from store"
This reverts commit 4479a2ef5599d9c8d99c3629616b3d662210fc08.
* Auto stash before revert of "Prevent passing dispatch, instead get actions direct from store"
* Remove duplicate dispatch
* Fix unit tests
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Add checkout data store
* wip on checkout data store
* CheckoutContext now uses the checkout store
* Investigated and removed setting the redirectUrl on the default state
* update extension and address hooks to use checkout data store
* use checkout data store in checkout-processor and use-checkout-button
* trim useCheckoutContext from use-payment-method-interface && use-store-cart-item-quantity
* Remove useCheckoutContext from shipping provider
* Remove isCalculating from state
* Removed useCheckoutContext from lots of places
* Remove useCheckoutContext from checkout-payment-block
* Remove useCheckoutContext in checkout-shipping-methods-block and checkout-shipping-address-block
* add isCart selector and action and update the checkoutstate context
* Fixed redirectUrl bug by using thunks
* Remove dispatchActions from checkout-state
* Change SET_HAS_ERROR action to be neater
* Thomas' feedback
* Tidy up
* Oops, deleted things I shouldn't have
* Typescript
* Fix types
* Fix tests
* Remove isCart
* Update docs and remove unecessary getRedirectUrl() selector
* set correct type for preloadedCheckoutData
* Remove duplicate Address type
* Fix missing addresses from type-defs index
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update docs/block-client-apis/checkout/checkout-api.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Revert feedback changes
* REvert feedback formatting
* Update docs formatting
* Delete empty types.ts file
* remove merge conflict from docs
* Correct linting in docs
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Adds to the Product Image Block the support for the Product Query Block
Adds to the Product Image Block the support for the Product Query Block woocommerce/woocommerce-blocks#6911
* use shared config
* use shared config
* use shared config
* Add to the Product Button Block the support for the Product Query Block
* Add to the Product Image Block the support for the Product Query Block
* fix lint errors
* address feedback
* set grid view and font-size L as default
Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Generate Inner Blocks' JSON files in a common folder
* Get the correct metadata path for the Inner Blocks
The Inner Blocks' metadata lives now in the `/build/inner-blocks`. But,
the function `get_block_metadata_path` was only looking for metadata
inside the top-level of the `build/` folder
Sanitizing the merchant store link in the error message added in WooPay when in some
cases the customer could run into an issue where we need to tell them an error occurred
and they have to go back to the merchant store and re-initialize WooPay to fix it.
Because previously we were only expecting strings, the text was not sanitized.
* Refactor Product Query to use the latest Gutenberg APIs
As we worked with Gutenberg folks in WordPress/gutenbergwoocommerce/woocommerce-blocks#43590,
WordPress/gutenbergwoocommerce/woocommerce-blocks#43632 and WordPress/gutenbergwoocommerce/woocommerce-blocks#44093 we have
created a standard API that could be used for our use-case. This
PR refactors our WIP experimental work to use that standardized API.
* use full link for WordPress resources (https://github.com/woocommerce/woocommerce-blocks/pull/7211)
Co-authored-by: Niels Lange <info@nielslange.de>
* Empty commit for release pull request
* update readme
* add testing instructions
* add zip file link
* update testing instructions and changelog entry
* Bumping version strings to new version.
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
* Remove experimental flag from Cross-Sells block
* Remove experimental flag from Cross-Sells block
* Remove experimental flag from woocommerce/cart-cross-sells-products-block
* Create Cross-Sells product list
* Show “Read more” button for out-of-stock cross-sells products
* Update assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Remove obsolete isLoading and placeholderRows
* Fix TS errors
* Rename crossSellsProduct to product
* Fix critical error
* Create 2e2 tests for Cross-Sells block
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Enabled __unstableHTML hidden option for HTML rendering within notices.
* Fixed margin-bottom for HTML notice content
* Fixed margin-top for HTML notice content
* Attempt to fix a broken e2e test
* Empty commit for release pull request
* add changelog - 8.5.0 version
* Add testing instructions
* add missing screenshot
* Fix pills in the Filter by Attribute block dropdown overlapping with the chevron (second attempt) (https://github.com/woocommerce/woocommerce-blocks/pull/7112)
* Fix invisible Reset filter button in some themes (https://github.com/woocommerce/woocommerce-blocks/pull/7111)
* update link zip file
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>