* Wrap Checkout Edit in SlotFillProvider
Required to render Slot/Fills in the editor
* Remove editor check when rendering ExperimentalOrderShippingPackages
We want to render it in the editor and on the front end, so checking is no longer necessary
* Wrap Cart in SlotFillProvider when in editor
This is so Slot/Fills can be rendered in the preview
* Empty commit for release pull request
* Add changelog
* Add testing notes
* Fix a typo
* load all JSON translation files correctly (https://github.com/woocommerce/woocommerce-blocks/pull/8034)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Disable Rate Limiting when editing Blocks in admin (https://github.com/woocommerce/woocommerce-blocks/pull/7934)
* Disable Rate Limiting for users who can edit posts
To avoid limiting the number of edits in WP admin to our Woo Blocks, we
need to disable rate limiting altogether.
We simply disabled rate limiting for users who can edit posts!
* Refactor rate limiting code
* Fix disabled rate limiting bug for non admin users
* Refactored applying rate limiting code.
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Update woocommerce-gutenberg-products-block.zip
* Update ZIP file
* Add screenshots to testing notes
* Fix markdown linting issues
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Disable Rate Limiting for users who can edit posts
To avoid limiting the number of edits in WP admin to our Woo Blocks, we
need to disable rate limiting altogether.
We simply disabled rate limiting for users who can edit posts!
* Refactor rate limiting code
* Fix disabled rate limiting bug for non admin users
* Refactored applying rate limiting code.
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Dependabot: Enable auto-merge on pull requests.
* Update auto-merge dependency list
* Update dependabot documentation and invert the order of the auto-merge action for clarity.
* Filter Rating Block > Prevent reload on select.
* Filter by Stock Block > Prevent reload on select.
* Disable debounce for the editor.
* Filter by Price Block > Prevent reload on select.
* Filter by Attribute Block > Prevent reload on select.
* Make the isEditor and isSelected params optional.
* Make isSelected optional.
* Address CR
* update to use isObject
PHP 8.2 deprecated using ${var} in strings
(https://kinsta.com/blog/php-8-2/#deprecate--string-interpolation). {$var}
should be used instead. This commit fixes the occurrences of ${var} in
woocommerce-blocks to prepare for the next version of PHP which is
scheduled to be released early in December.
I found this in the context of testing MailPoet with PHP 8.2. I'm not
familiar with the woocommerce-blocks so I might be missing something. I did
not test the changes in this commit.
* Set up incompatiblePaymentMethods in data store
* Save incompatible payment methods in data store
* Create the IncompatibilityPaymentGatewaysNotice
* Fix hidden notice bug
* Rename "paymentAdminLink" to GlobalPaymentMethod and move to types dir
* Add all registered methods to incompatiblePaymentMethods state
* Rename selector to getIncompatiblePaymentMethods
* Remove incompatible methods when adding available ones
* Remove unused reducer cases
* Stop adding incompatible methods now that we add them in default state
* Display incompatible methods in the notice from the data store
* Refactor incompatible payment gateways notice
* Update the incompatible extensions notice's design
* Hide Make as default notice
We hide this notice while the notification for incompatible payment
gateways is visible
* Hide the sidebar compatibility notice
Hide this notice while the notification for incompatible payment
gateways is visible. And show it otherwise.
* Capitalize the label for the button on the page settings notice
* Fix missing 'globalPaymentMethods' bug on frontend
* Highlight incompatible payments in sidebar
Highlight incompatible payment gateways within the Payment Options Block
* Rename the incompatible gateways notice's component
* Support plural and singular forms for the notice
* Update incompatible extensions notice's design
* Use the simplified types import
Co-authored-by: Niels Lange <info@nielslange.de>
* Add translation support to notice message
* Fix failing unit tests
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Display Add Review link in the All Products if there's no product rating in All Products and Products
* Apply the font-size mixin to the Add Review link
* Make Add review link NOT clickable in editor
* Improve styles of Rating component so they support alignment in product grids
* Use Woo Blocks instead Woo core translation
* Activale previously skipped e2e tests
* Adjust loading order of $shared_chunks, $vendor_chunks and $chunks
* Revert chunk order of MiniCart.php
* Render the block in the frontend
* Add icon style selector to Display settings
This adds an icon style selector in which users can choose the customer account link icon.
* Display on the frontend depending on the icon style
* Rename attributes
* Refactor block rendering
* Improve styling
* Add link to account settings
* Split css file
* Switch to SSR
* Add customer account block to header patterns
* Add customer account block to footer patterns
* Adapt minimal header to designs
* Adapt large header to designs
* Adapt header patterns to new designs and format code
* Adapt footer patterns to the designs
* Change display style for the essential header
* Increase alt icon size
* Make the icon resize with the label
* Adjust icon size on headers
* Add padding and move second row to the right
* Remove unused enum
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
* Add empty 'Customer Account' block
* Add edit to render the block on the editor
* Add Customer Account icon to @woocommerce/icons library
This icon is used in the Customer Account block.
* Use customerAccount icon in the Customer Account block
* Add Block Settings to Customer Account block
Add Typography and Color settings to the Customer Account block that can be used during Edit mode.
* Add Customer Account style icons
This adds the customer account style icons to be used by the customer account block.
* Render the block in the frontend
* Add Display setting to the Customer Account block
This setting allow users to choose if they want to include an icon with the customer account link.
* Add icon style selector to Display settings
This adds an icon style selector in which users can choose the customer account link icon.
* Display on the frontend depending on the icon style
* Rename attributes
* Refactor block rendering
* Improve styling
* Make the account link dynamic
* Add alignment menu
* Get dashboardUrl with getSettings and add fallback
* Add link to account settings
* Add tests
* Fix test
* Change display title
* Split css file
* Switch to SSR
* Add styles to the front end
* Address latest feedback
* Remove experimental flag
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
* Mini Cart block - added notice support woocommerce/woocommerce-blocks#6941
Mini Cart block - added notice support
* set isDismissible to true
* address feedback
* improve layout
* fix style and update close button label
* fix UI when the admin bar is visible
* Split out dismissible notices
* fix css
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Add cart view switcher
* Attribute based switched POC
* Tidy up view handling
* Mini cart
* Not sure who clint is. Typo - rename to clientId
* Avoid string casting in TS
* Add margin to title
* Set custom source to prevent currentView saving to post content.
Note this also removes `save` which does not exist in Gutenberg.
* Remove higher order component from withViewSwitcher
* Import view switcher in main file
* Add to side effects
* Move view switcher import
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Empty commit for release pull request
* Update the readme file with 9.1.1 release changes
* Product Query: Add `Sorted by title` preset. (https://github.com/woocommerce/woocommerce-blocks/pull/7949)
* Add `Sort by title` preset.
* sorted, thanks @nerrad
* Update the readme file with woocommerce/woocommerce-blocks#7949 changes
* 9.1.1 Release: Add testing docs
* Atomic Block: fix ancestor definition (https://github.com/woocommerce/woocommerce-blocks/pull/7947)
* Fix the incorrect layout of Rating and Price in Classic Template and Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7932)
* Fix the incorrect layout of Rating and Price in Classic Template
There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block
* Add dropdown version of Filter by Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7831)
* Extend Filter by Stock Editor options with dropdown and single/multiple choice
* Add dropdown implementation for Filter by Stock Status
* Adjust font-sizes to the rest of the filters
* Add tests to Filter by Stock: dropdown and list variants
* Change test file extension from .js to .tsx, so it handles types as well
* Add E2E test to Filter by Stock checking if display style can be toggled
* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions
* Change the name of the filter blocks in the test files
* Remove unnecessary waiting step in E2E test for Filter by Stock
toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed
* Improve the STOCK_STATUS_OPTIONS type handling
* Extract onDropdownChange function instead of inline arrow function
* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single
* Product Query: Add patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7857)
* Product Query: First attempt at adding patterns
* Product Query: Update patterns and the default block template
* Product Query: And new and update existing patterns
* Product Query: Adjust layout of the Minimal Product Row pattern
* Product Query: Update pattern names
* Product Query: Polish spaces between blocks inside the patterns
* Product Query patterns: Link product titles and improve spacing between product elements
* Product Query patterns: Button font-size update
* Product Query patterns: Center the pagination
* Product Query patterns: Center the pagination for the default pattern
* Product Query patterns: Remove an empty column
* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern
* Add dropdown version of Filter by Rating (https://github.com/woocommerce/woocommerce-blocks/pull/7771)
* Rename the setting section to match Filter by Attribute
* Add Display Style toggle to the block settings
* Set list as a default value of displayStyle for Filter by Rating
* Add dropdown variant of Filter by Rating
* Extend the Editor settings with selectType: single or multiple
* Adjust the styles of a FormTokenField to other dropdown
* Align Editor settings order and wording between Filter by Attribute and Rating
* Fix the issue with cut off corners of dropdown borders
* Provide translated screen reader messages and placeholder
* Revert the label property, which is necessary to display checkbox list
* Make classname for Rating component optional and remove styling in Filter by Rating
* Cover the case when filter with zero products needs string methods for comparison
* Handle Typescript errors and add ts-ignore annotations when necessary
* Remove explicit key prop assignment in Rating component
* Remove leftover property in type definition
* Refactor JSX element extension with custom properties to more robust way with object copy
* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)
* Filter by Rating tests:
- List single
- List multiple
- Dropdown single
- Dropdown multiple
* Adjust the font-size of Filter by Rating dropdown to the rest of the filters
* Fix E2E tests after the Editor settings label has been changed
* Improve sorting in Filter by Rating dropdown
With this change the order of options is always descending: in the chips, suggestions, active filters and URL
* Change the name of the filter blocks in the test files
* Prevent single dropdown input to overflow the wrapper
The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css
* Remove the unused styles of active options in Filter by Rating
Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then
* Change the approach of shared styles to fix the dropdown issue in filters
Instead of using direct classes, rewrite it to mixin and include in the filters
* Fix the Filter by Rating with Products block
The problem was with the Products block, that there was incorrect initial value of product ratings query
* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* Product Query - Enable "Inherit Query from template" option (https://github.com/woocommerce/woocommerce-blocks/pull/7641)
* Add Inherit Query from template option
* Update label
* Product Elements: Fix block settings (https://github.com/woocommerce/woocommerce-blocks/pull/7914)
* Product Elements: Fix block settings
* Rating: Fix inactive star color
* Product Rating: Fix color inheritance
* StyleAttributesUtils: Fix PHP notices and invalid CSS output (https://github.com/woocommerce/woocommerce-blocks/pull/7909)
* StyleAttributesUtils: Fix PHP notices and invalid CSS output. Closeswoocommerce/woocommerce-blocks#7899.
* StyleAttributesUtils: Fix border radius and width support
* StyleAttributesUtils: Fix border radius and border color support
* StyleAttributesUtils: Include additional checks to deal with PHP warnings
* StyleAttributesUtils: Improve the custom border array check
* Update MiniCart.php to fix price total amount on page load prices are including tax (https://github.com/woocommerce/woocommerce-blocks/pull/7832)
* Update MiniCart.php
Added an update to the '$cart_contents_total' variable on the 'get_cart_price_markup' function if $cart->display_prices_including_tax is active. Currently displaying wrong amount total on page load if items are already in the basket.
* Update MiniCart.php
Removed white spaces?
* Update MiniCart.php
Fixed IF statement
* Remove whitespace at end of line
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Product Query: implement compatibility with Filter by Rating block (https://github.com/woocommerce/woocommerce-blocks/pull/7792)
* Product Query: implement compatibility with Filter by Rating block woocommerce/woocommerce-blocks#7631
Product Query: implement compatibility with Filter by Rating block
* address feedback
* address feedback
* add comment
* add new zip file link
* add missing class
* add testing instructions about woocommerce/woocommerce-blocks#7947
* add new zip file link
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Bumping version strings to new version.
* Remove feature flag from Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8001)
* Remove feature flag from Products block
* Remove Products block from feature flags documentation
* Empty commit for release pull request
* Update changelog
* Add zip file link
* Bumping version strings to new version.
* Enable Product SKU and Product Stock Indicator in Core (https://github.com/woocommerce/woocommerce-blocks/pull/8009)
* Update changelog
* Update changelog
* Empty commit for release pull request
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Luke O'Regan <oregan.luke@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Empty commit for release pull request
* Update the readme file with 9.1.1 release changes
* Product Query: Add `Sorted by title` preset. (https://github.com/woocommerce/woocommerce-blocks/pull/7949)
* Add `Sort by title` preset.
* sorted, thanks @nerrad
* Update the readme file with woocommerce/woocommerce-blocks#7949 changes
* 9.1.1 Release: Add testing docs
* Atomic Block: fix ancestor definition (https://github.com/woocommerce/woocommerce-blocks/pull/7947)
* Fix the incorrect layout of Rating and Price in Classic Template and Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7932)
* Fix the incorrect layout of Rating and Price in Classic Template
There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block
* Add dropdown version of Filter by Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7831)
* Extend Filter by Stock Editor options with dropdown and single/multiple choice
* Add dropdown implementation for Filter by Stock Status
* Adjust font-sizes to the rest of the filters
* Add tests to Filter by Stock: dropdown and list variants
* Change test file extension from .js to .tsx, so it handles types as well
* Add E2E test to Filter by Stock checking if display style can be toggled
* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions
* Change the name of the filter blocks in the test files
* Remove unnecessary waiting step in E2E test for Filter by Stock
toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed
* Improve the STOCK_STATUS_OPTIONS type handling
* Extract onDropdownChange function instead of inline arrow function
* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single
* Product Query: Add patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7857)
* Product Query: First attempt at adding patterns
* Product Query: Update patterns and the default block template
* Product Query: And new and update existing patterns
* Product Query: Adjust layout of the Minimal Product Row pattern
* Product Query: Update pattern names
* Product Query: Polish spaces between blocks inside the patterns
* Product Query patterns: Link product titles and improve spacing between product elements
* Product Query patterns: Button font-size update
* Product Query patterns: Center the pagination
* Product Query patterns: Center the pagination for the default pattern
* Product Query patterns: Remove an empty column
* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern
* Add dropdown version of Filter by Rating (https://github.com/woocommerce/woocommerce-blocks/pull/7771)
* Rename the setting section to match Filter by Attribute
* Add Display Style toggle to the block settings
* Set list as a default value of displayStyle for Filter by Rating
* Add dropdown variant of Filter by Rating
* Extend the Editor settings with selectType: single or multiple
* Adjust the styles of a FormTokenField to other dropdown
* Align Editor settings order and wording between Filter by Attribute and Rating
* Fix the issue with cut off corners of dropdown borders
* Provide translated screen reader messages and placeholder
* Revert the label property, which is necessary to display checkbox list
* Make classname for Rating component optional and remove styling in Filter by Rating
* Cover the case when filter with zero products needs string methods for comparison
* Handle Typescript errors and add ts-ignore annotations when necessary
* Remove explicit key prop assignment in Rating component
* Remove leftover property in type definition
* Refactor JSX element extension with custom properties to more robust way with object copy
* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)
* Filter by Rating tests:
- List single
- List multiple
- Dropdown single
- Dropdown multiple
* Adjust the font-size of Filter by Rating dropdown to the rest of the filters
* Fix E2E tests after the Editor settings label has been changed
* Improve sorting in Filter by Rating dropdown
With this change the order of options is always descending: in the chips, suggestions, active filters and URL
* Change the name of the filter blocks in the test files
* Prevent single dropdown input to overflow the wrapper
The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css
* Remove the unused styles of active options in Filter by Rating
Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then
* Change the approach of shared styles to fix the dropdown issue in filters
Instead of using direct classes, rewrite it to mixin and include in the filters
* Fix the Filter by Rating with Products block
The problem was with the Products block, that there was incorrect initial value of product ratings query
* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* Product Query - Enable "Inherit Query from template" option (https://github.com/woocommerce/woocommerce-blocks/pull/7641)
* Add Inherit Query from template option
* Update label
* Product Elements: Fix block settings (https://github.com/woocommerce/woocommerce-blocks/pull/7914)
* Product Elements: Fix block settings
* Rating: Fix inactive star color
* Product Rating: Fix color inheritance
* StyleAttributesUtils: Fix PHP notices and invalid CSS output (https://github.com/woocommerce/woocommerce-blocks/pull/7909)
* StyleAttributesUtils: Fix PHP notices and invalid CSS output. Closeswoocommerce/woocommerce-blocks#7899.
* StyleAttributesUtils: Fix border radius and width support
* StyleAttributesUtils: Fix border radius and border color support
* StyleAttributesUtils: Include additional checks to deal with PHP warnings
* StyleAttributesUtils: Improve the custom border array check
* Update MiniCart.php to fix price total amount on page load prices are including tax (https://github.com/woocommerce/woocommerce-blocks/pull/7832)
* Update MiniCart.php
Added an update to the '$cart_contents_total' variable on the 'get_cart_price_markup' function if $cart->display_prices_including_tax is active. Currently displaying wrong amount total on page load if items are already in the basket.
* Update MiniCart.php
Removed white spaces?
* Update MiniCart.php
Fixed IF statement
* Remove whitespace at end of line
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Product Query: implement compatibility with Filter by Rating block (https://github.com/woocommerce/woocommerce-blocks/pull/7792)
* Product Query: implement compatibility with Filter by Rating block woocommerce/woocommerce-blocks#7631
Product Query: implement compatibility with Filter by Rating block
* address feedback
* address feedback
* add comment
* add new zip file link
* add missing class
* add testing instructions about woocommerce/woocommerce-blocks#7947
* add new zip file link
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Bumping version strings to new version.
* Remove feature flag from Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8001)
* Remove feature flag from Products block
* Remove Products block from feature flags documentation
* Empty commit for release pull request
* Update changelog
* Add zip file link
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Luke O'Regan <oregan.luke@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Rename configurateFilterProductsByAttributeBlock() to configurateFilterByAttributeBlock()
* Rename configurateFilterProductsByAttributeBlock() to configureAttributeFilterBlock()
* Add Mini Cart button styles to Button component
* Add wp-element-button class to Button component
* Don't load opinionated button styles in TT3 and Zaino
* Remove bold styles from Mini Cart buttons
* Refactor Store Notices
Move snackbar hiding filter before notice creation
Implements showApplyCouponNotice
Refactor context providers
Use STORE_NOTICE_CONTEXTS
use refs to track notice containers
Refactor ref usage
Use existing noticeContexts
* Move new notice code to checkout package
* Combine store and snackbars
* Update noticeContexts imports
* Remove context provider
* Update data store
* Fix 502
* Add new error contexts
* Force types
* Unnecessary reorder of imports
* Fix global handling
* Document forceType
* Optional props are undefined
* Remove function name
* Missing condition
* Remove context prop
* Define ACTION_TYPES
* Remove controls
* Update assets/js/base/context/event-emit/utils.ts
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* CONTACT_INFORMATION
* Remove ref from registerContainer
* Abstract container locating methods
* pass context correctly when displaying notices
* Remove debugging buttons
* Update filter usage - remove useMemo so filter can work inline
* Refactor existing error notices from the API (https://github.com/woocommerce/woocommerce-blocks/pull/7728)
* Update API type defs
* Move create notice utils
* Replace useCheckoutNotices with new contexts
* processCheckoutResponseHeaders should check headers are defined
* Scroll to error notices only if we're not editing a field
* Error handling utils
* processErrorResponse when pushing changes
* processErrorResponse when processing checkout
* remove formatStoreApiErrorMessage
* Add todo for cart errors
* Remove unused deps
* unused imports
* Fix linting warnings
* Unused dep
* Update assets/js/types/type-defs/api-response.ts
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Add todo
* Use generic
* remove const
* Update array types
* Phone should be in address blocks
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update store name to wc/store/store-notices
* Fix assertResponseIsValid
* Funnel woocommerce_rest_invalid_email_address to the correct place
* woocommerce_rest_missing_email_address
* Move comments around
* Move data back into const
* Spacing
* Remove spacing
* Remove forced snack bar and styling
* Move notices within wrapper
* Remove type
* hasStoreNoticesContainer rename
* Group by status/context
* Remove global context
* Remove white space
* remove changes to simplify diff
* white space
* Move comment to typescript
* List style
* showApplyCouponNotice docs
* See if scrollIntoView exists
* fix notice tests
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Respect core settings for showing the Checkout block
* Add account creation option from core to checkout context provider
* Fix TS errors
* Adjust display logic of <LoginPrompt />
* Update assets/js/blocks/checkout/block.tsx
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Rename <LoginPrompt> to <MustLoginPrompt>
* Show space between login text and login link
* Fix TS error
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Add receiveCart thunk
* Add mapCartResponseToCart helper
* Add getItemsPendingQuantityUpdate selector
* Update cart resolvers to be thunks
* Remove RECEIVE_CART action and replace with SET_CART_DATA
receiveCart will turn into a thunk.
* Add notifyQuantityChanges functions
* Remove receiveCart from action type definition, replace with setCartData
* Move apiFetchWithHeaders out of controls
This will just be a normal function since we'll be updating actions to thunks which will use this instead of a control.
* Include thunks in actions file
* Update receiveCart action to setCartData
* Update applyCoupon action to a thunk
* Update useStoreCartCoupons to get action from correct place
* Update StoreCartCoupon types
* Add types for Thunk and ThunkReturnType in mapped-types
* Change applyCoupon to a thunk
* Get applyCoupon, removeCoupon, receiveApplyingCoupon from useDispatch
This is to separate the concerns of actions vs. selectors. Previously the actions were fetched during useSelect which is not a pattern we use anywhere else in the codebase. Since we updated the MapToDispatch type, we can now get correctly typed thunks from the data store.
* Improve apiFetchWithHeaders typings
* Convert removeCoupon from generator to thunk
* Add applyCoupon and removeCoupon to CartAction type
* Remove unused old-style type-def
* Add receiveApplyingCoupon & receiveRemovingCoupon to StoreCartCoupon
* Correct issues with StoreCartCoupon type
These were not intended to reflect the actions in data store, rather the functions offered by the useStoreCartCoupons hook.
* Update applyExtensionCartUpdate to a thunk
* Update addItemToCart to thunk
* Add ResolveSelectFromMap type that works with thunks
* Add CartDispatchFromMap and CartResolveSelectFromMap types
We can add this to all data stores to get them working with thunks properly.
* Add docs and update generic name in ResolveSelectFromMap
* Add correct types for thunk resolvers in cart data store
* Update removeItemFromCart to thunk
* Update apiFetchWithHeaders to use generic
* Update selectShippingRate to thunk
* Update resolver tests to test correct thunk functionality
* Update updateCustomerData to thunk
* Update reducer test to reflect new action name
* Update comments on CartDispatchFromMap and CartResolveSelectFromMap
* Add quantity_limits to preview cart
* Make notices speak when shown
* Remove copilot comment
* Add isWithinQuantityLimits function
This is because we shouldn't show a notice if the quantity limits change, but the item's quantity is still OK.
* Add tests for notifyQuantityChanges
* Show notice when multiple_of is updated
* Update test to test for multiple_of changes
* Remove empty export
* Remove controls from cart data store
Not needed anymore since the exported value from the shared-controls file was empty.
* Export a control and async function for apiFetchWithHeaders
This is required because async functions cannot be called from sync generators.
* Use control version of apiFetchWithHeaders in the collections store
* Improve comments and remove incorrect TypeScript
* Update assets/js/data/cart/actions.ts
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update ResolveSelectFromMap to include selectors too
* Update TS in actions
* Use finally to remove duplicate code
* remove item pending delete/qty update after action runs in all cases
This will also reset the state when the request to remove it/change quantity errors
* Remove unnecessary type from param.
Not needed because we have TS now. The description can stay though, it is useful.
* Update snackbar wording to use active voice
* Remove old WP version check
* Set max quantity to high number instead of null
This would only happen in a niche case, and would require several TS changes to fix, so it's better to set it as a number here. 9999 should be high enough, and is the default quantity limit set below in get_product_quantity_limit
* Set code on woocommerce_rest_cart_invalid_key to 409
This is so the cart is returned in the response, so the client can update.
* Fix typo in comment and add CartSelectFromMap
* Remove unnecessary docblock
* Add getItemsPendingDelete selector
This is needed so we can show a notice for items that are unexpectedly removed from the cart. We need to know which ones are pending delete so we can skip showing the notice for them.
* Add type for notifyQuantityChanges args and change args to object
* Add notifyIfRemoved function
This will check items that have been removed and show a notice for them.
* Fix TS in receiveCart & pass itemsPendingDelete to notifyQuantiyChanges
* Update wording on removal notice
* Update types for notifyQuantityChanges args
* Update tests to reflect new wording and args being an object
* Check item is truth before running comparison of keys
* Update tests for unexpectedly and expectedly removed items
* Ignore print_r to satisfy phpcs
* Update PHP tests to reflect correct response code when deleting items
* Remove unnecessary controls and dispatch events directly from thunk
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Convert cart-checkout/totals/shipping component to TypeScript.
* Change hasRates tyep to boolean and fix renderOption type
* fix type for renderOption in ShippingRatesControlProps
* WIP: Make place order editable
* Remove obsolete undefined
* Wrap <ReturnToCartButton> within <Noninteractive>
* Rename const from submitButtonText to paymentMethodButtonLabel
* Simplify defaultValue logic
* Empty commit for release pull request
* Update the readme file with 9.1.1 release changes
* Product Query: Add `Sorted by title` preset. (https://github.com/woocommerce/woocommerce-blocks/pull/7949)
* Add `Sort by title` preset.
* sorted, thanks @nerrad
* Update the readme file with woocommerce/woocommerce-blocks#7949 changes
* 9.1.1 Release: Add testing docs
* Atomic Block: fix ancestor definition (https://github.com/woocommerce/woocommerce-blocks/pull/7947)
* Fix the incorrect layout of Rating and Price in Classic Template and Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7932)
* Fix the incorrect layout of Rating and Price in Classic Template
There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block
* Add dropdown version of Filter by Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7831)
* Extend Filter by Stock Editor options with dropdown and single/multiple choice
* Add dropdown implementation for Filter by Stock Status
* Adjust font-sizes to the rest of the filters
* Add tests to Filter by Stock: dropdown and list variants
* Change test file extension from .js to .tsx, so it handles types as well
* Add E2E test to Filter by Stock checking if display style can be toggled
* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions
* Change the name of the filter blocks in the test files
* Remove unnecessary waiting step in E2E test for Filter by Stock
toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed
* Improve the STOCK_STATUS_OPTIONS type handling
* Extract onDropdownChange function instead of inline arrow function
* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single
* Product Query: Add patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7857)
* Product Query: First attempt at adding patterns
* Product Query: Update patterns and the default block template
* Product Query: And new and update existing patterns
* Product Query: Adjust layout of the Minimal Product Row pattern
* Product Query: Update pattern names
* Product Query: Polish spaces between blocks inside the patterns
* Product Query patterns: Link product titles and improve spacing between product elements
* Product Query patterns: Button font-size update
* Product Query patterns: Center the pagination
* Product Query patterns: Center the pagination for the default pattern
* Product Query patterns: Remove an empty column
* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern
* Add dropdown version of Filter by Rating (https://github.com/woocommerce/woocommerce-blocks/pull/7771)
* Rename the setting section to match Filter by Attribute
* Add Display Style toggle to the block settings
* Set list as a default value of displayStyle for Filter by Rating
* Add dropdown variant of Filter by Rating
* Extend the Editor settings with selectType: single or multiple
* Adjust the styles of a FormTokenField to other dropdown
* Align Editor settings order and wording between Filter by Attribute and Rating
* Fix the issue with cut off corners of dropdown borders
* Provide translated screen reader messages and placeholder
* Revert the label property, which is necessary to display checkbox list
* Make classname for Rating component optional and remove styling in Filter by Rating
* Cover the case when filter with zero products needs string methods for comparison
* Handle Typescript errors and add ts-ignore annotations when necessary
* Remove explicit key prop assignment in Rating component
* Remove leftover property in type definition
* Refactor JSX element extension with custom properties to more robust way with object copy
* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)
* Filter by Rating tests:
- List single
- List multiple
- Dropdown single
- Dropdown multiple
* Adjust the font-size of Filter by Rating dropdown to the rest of the filters
* Fix E2E tests after the Editor settings label has been changed
* Improve sorting in Filter by Rating dropdown
With this change the order of options is always descending: in the chips, suggestions, active filters and URL
* Change the name of the filter blocks in the test files
* Prevent single dropdown input to overflow the wrapper
The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css
* Remove the unused styles of active options in Filter by Rating
Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then
* Change the approach of shared styles to fix the dropdown issue in filters
Instead of using direct classes, rewrite it to mixin and include in the filters
* Fix the Filter by Rating with Products block
The problem was with the Products block, that there was incorrect initial value of product ratings query
* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* Product Query - Enable "Inherit Query from template" option (https://github.com/woocommerce/woocommerce-blocks/pull/7641)
* Add Inherit Query from template option
* Update label
* Product Elements: Fix block settings (https://github.com/woocommerce/woocommerce-blocks/pull/7914)
* Product Elements: Fix block settings
* Rating: Fix inactive star color
* Product Rating: Fix color inheritance
* StyleAttributesUtils: Fix PHP notices and invalid CSS output (https://github.com/woocommerce/woocommerce-blocks/pull/7909)
* StyleAttributesUtils: Fix PHP notices and invalid CSS output. Closeswoocommerce/woocommerce-blocks#7899.
* StyleAttributesUtils: Fix border radius and width support
* StyleAttributesUtils: Fix border radius and border color support
* StyleAttributesUtils: Include additional checks to deal with PHP warnings
* StyleAttributesUtils: Improve the custom border array check
* Update MiniCart.php to fix price total amount on page load prices are including tax (https://github.com/woocommerce/woocommerce-blocks/pull/7832)
* Update MiniCart.php
Added an update to the '$cart_contents_total' variable on the 'get_cart_price_markup' function if $cart->display_prices_including_tax is active. Currently displaying wrong amount total on page load if items are already in the basket.
* Update MiniCart.php
Removed white spaces?
* Update MiniCart.php
Fixed IF statement
* Remove whitespace at end of line
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Product Query: implement compatibility with Filter by Rating block (https://github.com/woocommerce/woocommerce-blocks/pull/7792)
* Product Query: implement compatibility with Filter by Rating block woocommerce/woocommerce-blocks#7631
Product Query: implement compatibility with Filter by Rating block
* address feedback
* address feedback
* add comment
* add new zip file link
* add missing class
* add testing instructions about woocommerce/woocommerce-blocks#7947
* add new zip file link
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/911.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Luke O'Regan <oregan.luke@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Add type for lock attribute in isBlockLocked
* Add getMissingBlocks function
* Add findBlockPosition function
* Refactor useForcedLayout to use registry batch & insert multiple blocks
* Improve comment on getMissingBlocks function
* Fix the incorrect layout of Rating and Price in Classic Template
There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block
* Extend Filter by Stock Editor options with dropdown and single/multiple choice
* Add dropdown implementation for Filter by Stock Status
* Adjust font-sizes to the rest of the filters
* Add tests to Filter by Stock: dropdown and list variants
* Change test file extension from .js to .tsx, so it handles types as well
* Add E2E test to Filter by Stock checking if display style can be toggled
* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions
* Change the name of the filter blocks in the test files
* Remove unnecessary waiting step in E2E test for Filter by Stock
toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed
* Improve the STOCK_STATUS_OPTIONS type handling
* Extract onDropdownChange function instead of inline arrow function
* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single
* Make Cart and Checkout buttons editable
* Make shopping button editable
* Remove obsolete dot from the “Empty Mini Cart view” title
* Ensure to keep the existing styles
* Improve name of start shopping button label
* Prevent potential TS error
* Edit Proceed to Checkout button
* Don't allow empty button and remove console log
* extract default button label into a variable
* Feedback from Nadir & Niels
Co-authored-by: Niels Lange <info@nielslange.de>
* Product Query: First attempt at adding patterns
* Product Query: Update patterns and the default block template
* Product Query: And new and update existing patterns
* Product Query: Adjust layout of the Minimal Product Row pattern
* Product Query: Update pattern names
* Product Query: Polish spaces between blocks inside the patterns
* Product Query patterns: Link product titles and improve spacing between product elements
* Product Query patterns: Button font-size update
* Product Query patterns: Center the pagination
* Product Query patterns: Center the pagination for the default pattern
* Product Query patterns: Remove an empty column
* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern
* Rename the setting section to match Filter by Attribute
* Add Display Style toggle to the block settings
* Set list as a default value of displayStyle for Filter by Rating
* Add dropdown variant of Filter by Rating
* Extend the Editor settings with selectType: single or multiple
* Adjust the styles of a FormTokenField to other dropdown
* Align Editor settings order and wording between Filter by Attribute and Rating
* Fix the issue with cut off corners of dropdown borders
* Provide translated screen reader messages and placeholder
* Revert the label property, which is necessary to display checkbox list
* Make classname for Rating component optional and remove styling in Filter by Rating
* Cover the case when filter with zero products needs string methods for comparison
* Handle Typescript errors and add ts-ignore annotations when necessary
* Remove explicit key prop assignment in Rating component
* Remove leftover property in type definition
* Refactor JSX element extension with custom properties to more robust way with object copy
* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)
* Filter by Rating tests:
- List single
- List multiple
- Dropdown single
- Dropdown multiple
* Adjust the font-size of Filter by Rating dropdown to the rest of the filters
* Fix E2E tests after the Editor settings label has been changed
* Improve sorting in Filter by Rating dropdown
With this change the order of options is always descending: in the chips, suggestions, active filters and URL
* Change the name of the filter blocks in the test files
* Prevent single dropdown input to overflow the wrapper
The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css
* Remove the unused styles of active options in Filter by Rating
Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then
* Change the approach of shared styles to fix the dropdown issue in filters
Instead of using direct classes, rewrite it to mixin and include in the filters
* Fix the Filter by Rating with Products block
The problem was with the Products block, that there was incorrect initial value of product ratings query
* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* A notice is now displayed in the editor whenever the Filter by Rating block is used in a store that has no products with ratings. Additionally, users can now preview/update the content, settings, and color for the filter even when the store doesn't have any ratings yet.
* StyleAttributesUtils: Fix PHP notices and invalid CSS output. Closeswoocommerce/woocommerce-blocks#7899.
* StyleAttributesUtils: Fix border radius and width support
* StyleAttributesUtils: Fix border radius and border color support
* StyleAttributesUtils: Include additional checks to deal with PHP warnings
* StyleAttributesUtils: Improve the custom border array check
* add more clarity about the responsibility of reviewing/merging the PR on WC Core during the release process
* Update .github/release-initial-checklist.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update MiniCart.php
Added an update to the '$cart_contents_total' variable on the 'get_cart_price_markup' function if $cart->display_prices_including_tax is active. Currently displaying wrong amount total on page load if items are already in the basket.
* Update MiniCart.php
Removed white spaces?
* Update MiniCart.php
Fixed IF statement
* Remove whitespace at end of line
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update hex color val to currentColor.
* Remove fill attributes on SVG
Having the fill attributes explicitly defined on the SVG was setting the
icon to purple in unexpected cases.
This also reverts the quick attempt to adjust CSS selector for a fix, as
it was the incorrect approach.
* Allows custom validation rules to be applied to fields - in this case, email address
* Add local state to only push valid changes
* Do not need required
* unused isString
* Move to push level
* Update packages/checkout/components/text-input/validated-text-input.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update packages/checkout/components/text-input/validated-text-input.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update packages/checkout/components/text-input/validated-text-input.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update packages/checkout/components/text-input/validated-text-input.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Validate when the data store changes
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Creates a new block variation based on the core “Post Excerpt” called “Product Summary”.
* Brands it as our old “Product Summary” atomic element.
* Creates a utility function to allow easy creation of such variations.
As much as we can, we should use core blocks when the functionality is mostly overlapping. In the case of the Post Title block, we don't need to add and maintain our own block most likely, so we should just brand the Post Title block instead.
This PR does the following:
* Creates a new block variation based on the core “Post Title” called “Product Title”.
* Brands it as our old “Product Title” atomic element.
* Use this variation as the default within the Product Query template.
* Also removes some old code used for variations before the namespace attribute was available on the core Query Loop and repurposes it to create this variation.
* Product Query: add Feedback Prompt in inspector
The prompt doesn't appear at the very bottom as there isn't
currently any straightforward way to do this in the block variation.
More investigation is required.
* Product Query: Change icon, description and name
* Product Query: switch to Feature plugin flag
* Add all currently available atomic blocks to the default Product Query template
* Update feature flags doc
* Change SKU and Stock Indicator feature flags
* Change feature flags docs
* Add title prop to the `FeedbackPrompt` and add a title to the Product Query one
* Hacky solution to display the feedback block at the bottom
The order of the inspector controls is set in Gutenberg.
We can hack our way down by hooking to the “color” group and
display our feedback there.
Other panels would be displayed below that if added, such as borders
and margin.
* Reduce Product Query default template
* Fix e2e tests after Product Query block name change (https://github.com/woocommerce/woocommerce-blocks/pull/7840)
* Product Query: Add a better default pattern (https://github.com/woocommerce/woocommerce-blocks/pull/7833)
* Product Query: Add a better default pattern
* Product Price: Add bottom margin
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.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.
* 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
* Bumping version strings to new version.
* update changelog
* Empty commit for release pull request
* add testing instructions
* update zip file link
* Prevent Mini Cart loading the same script twice (https://github.com/woocommerce/woocommerce-blocks/pull/7794)
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>
* Empty commit for release pull request
* Display correct block template when filtering by attribute (https://github.com/woocommerce/woocommerce-blocks/pull/7640)
* Fix error when trying to access the queried object when it's null (https://github.com/woocommerce/woocommerce-blocks/pull/7664)
* Fix error when trying to access the queried object when it's null.
* Check if the `slug` exists
* Use the taxonomy name instead of the slug, otherwise it returns false
* Update readme changelog
* Add testing notes
* Improve testing notes format
* Bumping version strings to new version.
* Prevent Mini Cart loading the same script twice (https://github.com/woocommerce/woocommerce-blocks/pull/7794)
* Empty commit for release pull request
* update changelog
* add testing instructions
* update zip file link
* Mini Cart: load wc-blocks-registry package at the load of the page instead of lazy load it (https://github.com/woocommerce/woocommerce-blocks/pull/7813)
* update changelog
* update testing instructions
* update zip file link
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Luigi <gigitux@gmail.com>
This fixes a bug in which in certain cases Products wouldn't load in the editor because the Product Query
block was doing some REST API request with some invalid parameters.
* Escape all values in output of Product category list
* Escape all values in output of Product Sale Badge
* Escape values before rendering
Whenever you’re rendering data, make sure to properly escape it. Escaping output prevents XSS (Cross-site scripting) attacks.
* Remove unnecessary space
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Add product query support for Product Summary block
On the client side, when the Product Summary block is used within the product query block, the markup will be rendered on the server side - No javascript related to Product Summary block will be rendered.
* Update variable names for clarity & readability
* Escape all values in output string
* Fix custom style not working
More info: https://github.com/woocommerce/woocommerce-blocks/pull/7774#discussion_r1035909243
* Align the font-size of checkbox-control component to the price slider amount
* Align the font-size of Price Slider Button to the price slider amount
* Align the font-size of Filter Reset Button to the price slider amount
* Align the font-size of Clear All Button to the price slider amount
* Align the font-size of Apply button in Editor to the price slider amount
* Align the font-size of Apply button in Frontend to the price slider amount
* Align the font-size of Price Slider Amount to the standard size
* Align the font-size of Active Filter chips to the price slider amount
* Align the font-size of Filter by Price (text) to the price slider amount
* Align the font-size of Filter by Attribute (dropdown) to the price slider amount
* Align the font-size of placeholder of Filter by Attribute (dropdown) to the price slider amount
* Change font-size for text in filters from font-size(smaller) to font-size(smaller)
As a result of discussion in PR it was agreed to check the styles with bigger font size hence the change
* Align the font-size of input text of Filter by Attribute (dropdown) to the price slider amount
* Change margin-right of checkbox-control to relative value so it better adapts to the fonts
* 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
* rename allowControls to allowedControls
* add support to the global query
* fix eslint error
* bot: update checkstyle.xml
* Update src/BlockTypes/ProductQuery.php
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* fix global query generation
* bot: update checkstyle.xml
* try: refactor merge_queries
* remove debug code
* fix: unpack assoc array php 7.4
* try: refactor merge_queries to take any form of input without unpacking
and preparing the input arrays
* add missing query vars
* add feature flag
* updates comment
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Adds product query support for Category list block
On the client side, when the Category list block is used within the
product query bloc, the markup will be rendered on the server side -
No javascript related to Category list block will be rendered.
* bot: update checkstyle.xml
* Fix extra space after the category link
I used the solution from following link: https://css-tricks.com/fighting-the-space-between-inline-block-elements/#aa-remove-the-spaces
Here is the content from the above link:
The reason you get the spaces is because, well, you have spaces between the elements (a line break and a few tabs counts as a space, just to be clear). Minimized HTML will solve this problem, or one of these tricks:
```CSS
<ul>
<li>
one</li><li>
two</li><li>
three</li>
</ul>
```
or
```CSS
<ul>
<li>one</li
><li>two</li
><li>three</li>
</ul>
```
or with comments…
```CSS
<ul>
<li>one</li><!--
--><li>two</li><!--
--><li>three</li>
</ul>
```
They’re all pretty funky, but it does the trick.
* Fix custom style doesn't work on the frontend side
For more info, check this comment on the PR:
https://github.com/woocommerce/woocommerce-blocks/pull/7675#pullrequestreview-1179267957
In summary, user can set the custom styles like text color, link color, font size, font weight, line height using the editor sidebar.
These styles weren't showing on the frontend side.
* Add support for additional CSS class(es)
* Fix "custom style -> link color" not working
To understand the issue in more details please check following comment:
https://github.com/woocommerce/woocommerce-blocks/pull/7675#issuecomment-1319822535
* Fix classname undefined issue
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Rename Active Product Filters block to Active Filters
* Rename wc-block-active-product-filters__placeholder to wc-block-active-filters__placeholder
* Rename active filters fixture
* Add archive-product to the hierarchy
* Fallback to archive-product and get titles from blocks if the templates from theme don't have one
* Rename function
* Fix comment
* Add fallbacks to the db and blocks versions
* Add missing product attribute blockified template
* Update docs
* Add comment and fix comment type on wp_template
* Replate template name if we know the template in blocks
* Add comment and fix linting error
* Fix archive-product template
* Clone the fallback template from db to show them in the template lsit
* Return the fallback template when querying for a single template
* Remove unneeded condition
* Use wp function instead of gutenberg one
* Fix tests
* Fix tests on Product Catalog templates
It was checking a single product for the customization, but it should check the /shop page
* Disable tests related with deleteAllTemplates function
* 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 e2e tests for the Filter By Price block
* Product Query - Add e2e tests for the Filter By Attribute block
* fix comment
* fix comment
* remove not used import
* remove not used import
* address feedback
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Add product query support for Sale badge block
On the client side, when the Sale badge block is used within the product query block, the markup will be rendered on the server side - No javascript related to Sale badge block will be rendered.
* Add support for additional CSS class(es)
ADDITIONAL CSS CLASS(ES)(available in advanced toggle in sidebar) should be added to the container div
* Convert preset to css variable for padding
We are getting padding value in preset format like this:
"var:preset|spacing|50"
Therefore I added a function to convert it to CSS variable like this:
"var(--wp--preset--spacing--50)"
i.e. "var:preset|spacing|50" -> "var(--wp--preset--spacing--50)"
* Add reference for preset to css variable conversion logic
* Empty commit for release pull request
* Update compatibility sections and add release 9.0.0 changelog
* Add testing instructions for the 9.0.0 release
* Update testing instructions for the 9.0.0 release
* Remove testing instructions for an unmerged PR
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
* Add support for “Popular Presets” for PQ block
This commits achieves the following:
* Adds a section in the inspector control called “Popular Presets”,
which contains a dropdown with popular presets.
* Adds support for the first preset: “Best selling products”.
By selecting this, users can sort products by total sales.
* Switches the order of the custom inspector controls and the default
Query Loop inspector controls: our controls will be now on top
as per the latest design spec (see pdnLyh-2By-p2).
* Restricts the allowed Query parameters to the sort orders we want to
allow according to the latest design spec (disabling title and date).
* Removes the core “Order By” dropdown.
* Refactor `setCustomQueryAttribute` to `setQueryAttribute` because
since a few iterations, our custom query attributes are not deeply nested
anymore, and this function can be used for the normal query too.
* Add back-end support for sorting by Best Selling via the Product Query block
* Adds the `popularity` value as an allowed value for `orderby` on
`product` REST API calls.
* Handles the query differently if the `orderby` value is one among the
custom ones.
* Update cart.md
Add information on how to add extra data to the /add-item request
* Update src/StoreApi/docs/cart.md
Co-authored-by: Niels Lange <info@nielslange.de>
* Update src/StoreApi/docs/cart.md
Co-authored-by: Niels Lange <info@nielslange.de>
* Add clearValidationErrors to validation data store actions
* Add reducer case for CLEAR_VALIDATION_ERRORS
* Add tests for CLEAR_VALIDATION_ERRORS
* Add documentation for clearValidationErrors
* Deprecate clearAllValidationErrors in actions.ts
* Remove CLEAR_VALIDATION_ERRORS action and reducer case
* Update reducer test for clearAllValidationErrors
* Make error message in test describe the test better
* Update reducer to handle CLEAR_VALIDATION_ERRORS with no error passed
* Update documentation for validation data store
* Remove unnecessary linebreaks in documentation
* Moved all payment utils functions in a utils folder
* Delete as it's not being used
* bot: update checkstyle.xml
* bot: update checkstyle.xml
* Fix TS error
* bot: update checkstyle.xml
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Fix typo in HTML markup of ProductImage block placeholder
Typo caused rendering of incorrect HTML attributes: width and height of Product Image placeholder that were anyway ignored by the browser
* Remove inline styles (width and height) from ImagePlaceholder in ProductElements > Image block
Inline height took precedence over the inherited styles which made the placeholder image skewed (in loading and loaded state). Removal of those styles allows the ImagePlaceholder to adapt the height to the available space keeping the ratio or inherit the styles from the parent
* Remove inline styles (width and height) from placeholder image in ProductImage.php block
Inline styles applied to the placeholder image of ProductImage block were overriden by other styles with higher specificity, which made them redundant. Additionally, corresponding styles were removed from the placeholder image from Editor code as they caused UI glitches. Additional proof that it's safe to remove them is in the first commit in this branch, the purpose of which was to fix those styles as there was a typo which corrupted them and eventually inline width and height were ignored by the browser and not applied to the element
* Add test to check placeholder image renders without width and height inline attributes
This is to prevent adding inline width and height attributes so the sizing of the placeholder image is controlled by the inherited styles or element styles, in the same way as a regular product image
* Fix TypeScript errors in the block test file of Product Image
* Add generic alt text to placeholder image
Alt text added in this commit is a generic text, not description of the actual image. That's because the image itself is set externally through the settings and may change over time
* Revert adding placeholder image alt text and add comments to make the empty alt explicit
After a Github discussion: https://github.com/woocommerce/woocommerce-blocks/pull/7651\#discussion_r1019560494 it was decided the placeholder should NOT have alt text as it serves the purpose of decorative image. According to the guidelines decorative images should not have alt text: https://www.w3.org/WAI/tutorials/images/decorative/. Comments were added also to other places where it happens
* bot: update checkstyle.xml
Co-authored-by: Karol Manijak <karolm@Karols-MacBook-Pro.local>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Make loading placeholder colors match the current font color
Currently, the loading placeholder effect has a default gray color. However, since users can modify their themes with the Site Editor and choose a different set of colors for their websites, it would be interesting to make those placeholders match the color palette.
In this commit, the idea was to modify the `placeholder` mixin to replace the transparent font color with the current color and also modify the background-color and the linear-gradient to match the current font color. Furthermore, transparency was added to the middle color of the linear-gradient so we can keep the loading animation close to what it currently is.
* Add opacity to placeholder mixin
Before our changes, when the font color was dark, we had a lighter placeholder background color. After the changes the color is currently darker than before so the idea for this commit is to change the opacity of the placeholder in a way that the current color blends with the background color set for the theme.
* Change placeholder mixin opacity
After testing different combinations of colors, we decided to change the opacity to 0.15 so when the font color is darker the placeholder will have a lighter background color.
* bot: update checkstyle.xml
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add actions and selectors for new paymemt status
* Remove set_complete from reducer
* Replace all usages of getCurrentStatus with specific sepectors
* Replace all `setCurrentStatus` with individual actions
* Update docs
* Removed currentStatus
* bot: update checkstyle.xml
* Update docs/third-party-developers/extensibility/data-store/payment.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Address Thomas feedback
* Add link to deprecated message
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Bump version number of @types/wordpress__blocks
* bot: update checkstyle.xml
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Empty commit for release pull request
* Display correct block template when filtering by attribute (https://github.com/woocommerce/woocommerce-blocks/pull/7640)
* Fix error when trying to access the queried object when it's null (https://github.com/woocommerce/woocommerce-blocks/pull/7664)
* Fix error when trying to access the queried object when it's null.
* Check if the `slug` exists
* Use the taxonomy name instead of the slug, otherwise it returns false
* Update readme changelog
* Add testing notes
* Improve testing notes format
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
* Remove the experimental flag that's used to include thunks in wp.data
* bot: update checkstyle.xml
* Fix ts error from previous PR
* bot: update checkstyle.xml
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Fix error when trying to access the queried object when it's null.
* Check if the `slug` exists
* Use the taxonomy name instead of the slug, otherwise it returns false
* 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.
* 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 dynamic render function for PQ support.
* Update to use correct classnames on PHP side.
SSR markup was accidentally using rating classname instead of sku so it
was not applying the proper text transform seen in the editor.
* Rename BlockAttributes type to Attributes
This keeps things consistent with the type naming on the other blocks.
* Remove redundant spread of sharedConfig object.
We don't need to spread the `sharedConfig` object into the `blockConfig`
object when defining `blockConfig` since we spread/merge these two
objects when registering the block via `registerExperimentalBlockType`.
* bot: update checkstyle.xml
* bot: update checkstyle.xml
* Empty commit to trigger checks.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Remove isExpressPaymentMethodActive and paymentStatus.isDoingExpressPayment from the payment store
* Remove uneccessary paymentStatuses key from the payments store
* Move ValidatedTextInput and ValidationInputError to checkout package
* Include checkout package in tsconfig file
* Remove unnecessary index file
We export these components from packages/checkout/index.js instead
* Import ValidatedTextInput & ValidationInput error from checkout package
* Only add validationError.message when validationError is an object
* Explicitly add undefined to optional props
* Import isObject to test validationError
* Extend the HTML Input element attributes
* Use more performant useDispatch instead of dispatch
* Export component without withInstanceId hoc for testing
* Add tests for ValidatedTextInput
* bot: update checkstyle.xml
* Rename export of unwrapped component to have __
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add woocommerce_blocks_loaded hook information to actions doc
* add docs to woocommerce_blocks_loaded hook inline
* fix docs
* Switch to updated wp-hooks/generator package
* Prevent syntax error in doc script from storeapi.php
* Remove footer from internal docs and examples
* Doc footer script should ignore examples and internal developer docs
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* fixed method sig
* Updated to @wordpress/env@5.5.0 and set default PHP 7.4 for wp-env.
* updated Coding Standards flow to use PHP 8.0
* Added comment to E2E flows explaining what PHP version is used
* Revert "Updated to @wordpress/env@5.5.0 and set default PHP 7.4 for wp-env."
This reverts commit 696cd7f42edc9d9726b777cf4f83a501a6d63936.
* Added comment to Unit test flows explaining what PHP version is used.
Specified PHP version on .wp-env.json
* Fixed composer-lock.json version.
* Updated tests to run on PHP Unit 9.2.6
* Updated tests to run on PHP 8
* Reverted test, mismatched results between local and pipeline
* Removed Todo
* Updated platform overrides
* Update Migrationb tests with Mockery for PHP8 compat
* try at PHP unit flow matrix
* Fix blocks.ini invalid config
* Temp disable E2E
* Downgraded woocommerce/woocommerce-sniffs as it introduced new sniffs we should be handling on a different PR
* re-enable E2E tests
* blocks.ini fix
* revert blocks.ini fix
* Update @wordpress/env
* remove .htaccess mapping
* Fix permissions for tests
* Debug permissions
* Attempt at perm fix
* Attempt at perm fix
* Downgraded @wordpress/env
* Another attempt at upgrade @wordpress/env
* Attempt at cleaning wp-env before run
* Attempt at destroying wp-env before run. Disabled E2E.
* Attempt at destroying wp-env before run.
* debug wp-env data
* attempt at deleting wp-env data (destroy won't work due to prompt)
* re-enable E2E
* Fix deprecation warnings
* Cleaned wp-env data for E2E
* Fix perms for E2E
* Updated RateLimitsTests
* debug
* Force 7.4 for wp-env
* Run sh outside of npm
* Reverted E2E flow
* reverted wp-env-config.sh debug test
* reverted .wp-env.json phpVersion force
* Update tests/php/StoreApi/Utilities/ProductQueryFilters.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/CartExtensions.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/CartItems.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/Products.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/ProductCollectionData.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/Batch.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/Checkout.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/CartCoupons.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/ProductAttributes.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/Cart.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* downgraded @wordpress/env to v4
* Reverted back to reflection class for pivate attribs manipulation on tests
* reverted JS unit testing job name
* Update tests/php/StoreApi/Formatters/TestMoneyFormatter.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Typo fix
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Import Currency type from correct location
* Add type for productPriceValidation argument
* Default tabIndex to undefined
null is not an acceptable value for the tabIndex prop, but undefined is, so we should use that.
* Explicitly set type of CartLineItemRow to ForwardRefExoticComponent
* bot: update checkstyle.xml
* Change CartLineItemRow to extend React.RefAttributes
* bot: update checkstyle.xml
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* 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>