* 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