* 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