* Fix local pickup price in the shipping type selector
- While calculating min and max value for local pickup, if the rate is not for local pickup, it will take already calculated lowest value instead of comparing it with the value of other shipping rate.
* Add the typecasting for price and tax to fix tax calculation
- We were concatenating the two strings instead of adding the integers. Add the typecasting for price and tax to fix it in local pickup.
---------
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Add method to get products based on filtered term
* Use convenient taxonomy name wrapper
* Add caching and switch to return array instead of object
* Remove cache and address comments
* Fix local pick-up e2e tests
- Change location_country select input to location_country_state select input in e2e tests.
- Remove location_state select input in e2e tests.
* Fix country/state value
- Change country/state value from 'US' to 'United States (US) — California'
* Add inline comment about same field for Country and State fields
- We merged the Country and State fields into the same field in the local pickup modal. Add inline comment in e2e test to avoid confusion.
* Add `renderInCartAndCheckout` attribute and toggle
* Show setting only when inserted in a template
* Don't render the mini-cart if the setting is disabled
* Stop rendering the mini-cart if the setting is false
* method to snakecase
* Make the attribute a string
In the future we may want to add more rendering styles, so a boolean wasn't the
best option, a string will allowed us more than two options
* Change toggle copy
* Fix Markdown table in payment-method-integration.md
* Update the hooks for eventRegistration
---------
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
* Get the default store state
We are merging the Country & State fields. So, we should get both
default values
* Merge the Country & State fields
We merged both fields in the Pickup Location form modal
We can see a similar example in `WooCommerce -> Settings -> General`
* Clean up the code
* Show the state text field above the country select
* Create some util functions
* Refactor the Form component
* Display a user friendly country and state in admin
* Fix country defaulting to "Afghan" bug
* Add client side postcode validation
* Prevent server-side validation
* Adjust translation
* Only validate postcode if country is available
* Specify return type of isPostcode()
* Convert function to static variable set
* Refactor <ValidatedTextInput> for postcode validation
* Refactor customValidationHandler
* Use customValidationHandler as intermediate function
* Hyphenate file names
* Update packages/checkout/utils/validation/is-postcode.ts
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Normalise postcode on input
* Fix usage of out of date value from input field
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Add ExperimentalOrderLocalPickupPackages slot fill
* Render ExperimentalOrderLocalPickupPackages in local pickup block
* Update docs to include ExperimentalOrderLocalPickupPackages
* Use LocalPickupSelect component when rendering local pickup options
* Add CartCheckoutUtils class
This class will store reusable methods relating to Cart/Checkout Blocks, i.e. whether they are used on the Cart/Checkout page.
* Update ShippingController to use the new CartCheckoutUtils function
This will reduce code duplication when checking if the Cart/Checkout blocks are in use on the Cart/Checkout page.
* Add filter to remove shipping settings when Cart/Checkout are default
* Ensure setting displays correctly if cart is default but not checkout
* Add tests to ensure core shipping settings update correctly
* Add setCartCheckoutPages function to update set the cart/checkout page
* Force shipping to be enabled if the Checkout block is in use.
* Add filter to override cost requires address option
* Add shippingCostRequiresAddress option
* Check if the address is required before showing rates
* Show shipping rates in editor
* Add shippingCostRequiresAddress attribute to shipping methods block
* Update frontend type to show shippingCostRequiresAddress is a prop
* Add control to toggle shippingCostRequiresAddress option
* Show address notice in the correct scenario
* Send shippingCostRequiresAddress to Block in front end context
* Add e2e test for editor control
* Add e2e tests for shipping options on the front end
* Add updateAttributeInSiblingBlock function
* Add shippingCostRequiresAddress to shipping method block
* Ensure attribute is updated in both blocks when editing
* In Shipping Methods Block, show correct component based on block setting
* Show correct block in editor
* Remove broken test from PR
* Clean up updateAttributeInSiblingBlock
* Add setCartCheckoutPages function to update set the cart/checkout page
* Add tests to ensure core shipping settings update correctly
* Add isAddressComplete function
Borrowed from woocommerce/woocommerce-blocks#8141
* Check if the address is required before showing rates
* Show shipping rates in editor
* Show address notice in the correct scenario
* Add e2e tests for shipping options on the front end
* Ensure errorId is passed to StateInput
* Add fullShippingAddressPushed action to wc/store/cart
* Add fullShippingAddressPushed case to reducer
* Ensure fullShippingAddressPushed is set when initialising cart store
* Add fullShippingAddressPushed selector and default state entry
* Add shippingAddressHasValidationErrors util function
* Do not overwrite addresses when selecting a rate
* Set whether full address has been pushed when saving address changes
* In Shipping Methods Block, show correct component based on block setting
* Don't show from price if rates should be hidden until address entered
* Check city validation errors to assert if shipping address is valid
* Rename merchant.js to merchant.ts
* Move local pickup functions to common merchant util
* Update local pickup tests to use common merchant utils
* Add test to ensure setting toggles in both blocks
* Add navigating to settings and saving in merchant util
* Create addPickupLocation merchant util
* Add test for local pickup and require full address
* Make sure correct conditions are met to show shipping options
* Ensure checkbox is checked during local pickup tests
* Unset the checkbox when tests are finished running
* Update checkout block fixture
* Prevent error in unit tests
* Import validation store key from constants
Required because importing from the index causes the validation data store to register twice
* Update checkout terms test to wait for button not to be disabled
* Revert "Add isAddressComplete function"
This reverts commit 9967dc0d4f10cf638859ae085e6f4cc2901dd299.
* Fix up typescript of checkout filters
* Clear cached values when adding new filters
* Allow href on WPButton type
* Specify generic type of getSetting for checkout page link
* Apply filters to Proceed to Checkout button
* Add unit tests for proceed to checkout button and link filters
* Make cart extend a plain object
* Pass cart in args for proceed to checkout filters
* Add documentation for proceed to checkout filters
* Add unit test for multiple filter registration
* Change word to bump stuck GitHub actions
* Apply consistent casing to test names
* Add third party local pickup method to woo-test-helper plugin
* Add test to check for checkout with local pickup
* Ensure local pickup is disabled when done with tests
* Add a more reliable selector for the "use same address for billing" box
* Prevent local pickup rates showing if local pickup is not enabled
* Check billing details after placing local pickup order
* Change local pickup unit test so rates dont show if localPickup disabled
* Use existing const instead of getSetting
* Update tests to mock constant from @woocommerce/block-settings
---------
Co-authored-by: Niels Lange <info@nielslange.de>
* Add LocalPickupSelect component
This will be used to render the local pickup options and also display a title if there are more than one package (e.g. if WC subs adds them)
* Add tests for LocalPickupSelect component
* Make title optional
* Add packageCount as an option to LocalPickupSelect
* Revert "Add packageCount as an option to LocalPickupSelect"
This reverts commit 10b1dc9497aa6c4329aee7e74e1404cb9645c3b9.
* Add ackage count to LocalPickupSelect
* Add package count and remove unused variable from renderPickupLocation
* Add border support to mini cart contents
* Fix buttons in firefox when logged out
* Fix mini cart in all browsers
* Fix border not visible on mobile because of the admin bar
* Add feature flag to the experimental border
---------
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Product Rating: Normalize the height of rating icons and the Add review link
* Products: Update inner blocks margins.
* Product Rating: Remove css changes from this PR.
* Products patterns: Remove px values and update the default pattern template.
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Add minimum structure for Single Product Details block
* Add Product Image Gallery woocommerce/woocommerce-blocks#8233
Add Product Image Gallery
* Add tests for Single Product Details block
* Add the initial basis for the Add to Cart button
* Trigger the single product add to cart action for each product type.
* wip: create block structure and add initial styles
* Add block details to the SingleProductDetails.php file
* Rename the block from add-to-cart-button to add-to-cart-form
* Update to use the cart icon.
* Implement the skeleton for the editor preview.
* Render tabs title with empty content
* Use woocommerce_output_product_data_tabs function to retrieve tabs data
* Update styles and add Notice for the display in the Editor.
* Update CSS.
* Add base tests for the new Add to Cart Form component.
* Add Product Image Gallery block
* remove support global styles
* remove support global styles
* Update the button CSS.
* Remove customizations for the Single Product Details block
* Update styles for the cart form.
* update td style.
* Update divs and CSS.
* Use conventional input instead of the experimental InputControl
* address CSS feedback
* add support for the custom classname
* remove save function
* Remove unnecessary console.log from the Edit.tsx file
* Remove block classname from block wrapper
* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController
* Remove attributes property from the block registration
* Remove isExperimental flag for the Single Product Details block
* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block
* Prevent Single Product Details block from apppearing in Pages or Posts
* add second parameter to the subscribe function
* Implement the new design and copy provided for the editor.
* Make the notice compatible with dark themes.
* Some additional CSS tweaks
* adjust the padding for the input
* wrap the Single Product Template in a div with the product class
* Fix PHP Coding Standards warnings
* improve logic and increase coverage of unit test
* improve logic and increase coverage of unit test
* fix test
* format HTML
* fix edge case
* update @types/wordpress__data package
* update placeholder, icon and description
* update tsconfig
* update block name
* fix SCSS linter error
* address feedback
* create SingleProductTemplateCompatibility class
* Add Hooks compatibility
* remove not used file
* remove not used files
* Add compatibility layer for the Single Product template
* fix check
* implement Product meta template header
* Product Price Block: Add support Single Product Template
* fix missing import
* add comment
* return a value
* improve comment
* fix import
* Add Product Meta block
* remove unnecessary change
* fix compatibility layer when the Single Product template has the classic block
---------
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Make Mini Cart drawer close button inherit the color
* Fix Mini Cart drawer close button alignment
* Increase opacity when Mini Cart drawer close icon is hover, focused or active
This PR is meant to improve the UI and UX behind the Attributes filter
within the Inspector Controls of the “Products (Beta)“ block.
Also included:
* Refactor `useProductAttributes` hook
* Move it into the shared hooks.
* Fetch both terms AND attributes via the API (previously,
we got the attributes from the settings, but we'd get
partial objects compared to the API? Maybe a follow-up
to this could be to check why the attributes stored in
the settings are incomplete?)
* Make sure the return values match the ones expected
from search items.
* Remove attribute-related types from PQ directory
* Improve functionality of `SearchListControl`
* Allow the search input to be a Token based input.
* Allow for search input to search even collapsed properties.
* Use core `CheckboxControl` instead of radio buttons for
items having children (includes undeterminated state).
* Enable removal of tokens from the input
* Improve styles:
* Refactor classnames for `SearchItem`.
* Add more semantic classes.
* Align count label and caret to the right.
* Make caret switch direction on expanded.
* `cursor: pointer` on collapsible items.
* Indent children of collapsible items.
* Correctly pass through class names to search item
* Enable keyboard navigation for collapsible items
* Add link to manage attributes
* Change label inside the inspector controls
* Make search list attached when token type
* Implement more sophisticated behavior of parent checkbox
* If indeterminate or unchecked, it will check all children.
* If checked, it will uncheck all children.
* Remove hardcoded `isSingle` from `expandableSearchListItem`
* Remove old view switcher component (not used)
* Switch in list view
* useSelect
* Optional selection of parent block on changing view
---------
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Add tests for pushChanges and dirty props
* Update assets/js/data/cart/test/push-changes.ts
Co-authored-by: Mike Jolley <mike.jolley@me.com>
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* use correct path when running php unit tests
* Update package.json
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
---------
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Merge tax_query of attributes and visibility taxonomies when building Products query
* Add tests confirming the tax_query is merged correctly
* Improve syntax after code review
* Update release steps mentioning the version on the WooCommerce.com plugin page takes some hours to update
* Replace 'tomorrow' with 'the following day'
* Make the customer account icon bigger to match the mini-cart one
* Add variation to increase the icon size for new blocks
* Improve class name
* Add variation explanation
* Add default attributes
* Check if WordPress version is 6.1.1 and higher to allow for template conversion
* Change the version the conversion is available from, from 6.1.1 to 6.1
* Empty commit for release pull request
* update 9.7.0 changelog for readme.txt
* bump WC versions
* 9.7.0 testing notes
* Update 970.md
* remove 7945 and update 8489 testing note
* Remove 8264 testing notes
* remove 8482 from testing instructions
* Fix alignment of Add to Cart form block (https://github.com/woocommerce/woocommerce-blocks/pull/8578)
* update testing zip after cherry-picking 8578
* update changelog
* Move testing steps woocommerce/woocommerce-blocks#8438 to experimental section (https://github.com/woocommerce/woocommerce-blocks/pull/8580)
* Fix image is not showing at correct position (https://github.com/woocommerce/woocommerce-blocks/pull/8585)
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* fix 8478 testing note
* fix md error cause the last section hidden
* Add to Cart Form Block > Ensure the editor preview is properly displayed with the Gutenberg plugin disabled (https://github.com/woocommerce/woocommerce-blocks/pull/8582)
* Update the editor styles for the add to cart form button so it is properly displayed with the Gutenberg plugin disabled.
* update for the input height.
* update the min-height
* update testing zip link
* Bumping version strings to new version.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Update the editor styles for the add to cart form button so it is properly displayed with the Gutenberg plugin disabled.
* update for the input height.
* update the min-height
* Update the editor styles for the add to cart form button so it is properly displayed with the Gutenberg plugin disabled.
* update for the input height.
* update the min-height
* Update Interactivity API
* Change `wp` prefixes to `woo`
* Use `woo` prefix for the directives runtime bundle
* Update Interactivity API runtime
* Hardcode php from interactivity API
* Temporarily add gutenberg plugin as dependency
* Exclude Interactivity API files from phpcs checks
* Update Interactivity API js files
* Update Interactivity API php files
* Remove gutenberg from wp-env plugins
* Fix registered runtime paths
* Fix prefixes when getting attributes in directives
* Fix directive prefix in constants
* Avoid a Fatal error when importing `wp-html`
* Remove TODO comments from Interactivity API files
* Add missing prefix to some global functions
* Use true as value for boolean attributes
* Add `wp-html` file
* Change requires in `wp-html` with includes
* Add minimum structure for Single Product Details block
* Add Product Image Gallery woocommerce/woocommerce-blocks#8233
Add Product Image Gallery
* Add tests for Single Product Details block
* Add the initial basis for the Add to Cart button
* Trigger the single product add to cart action for each product type.
* wip: create block structure and add initial styles
* Add block details to the SingleProductDetails.php file
* Rename the block from add-to-cart-button to add-to-cart-form
* Update to use the cart icon.
* Implement the skeleton for the editor preview.
* Render tabs title with empty content
* Use woocommerce_output_product_data_tabs function to retrieve tabs data
* Update styles and add Notice for the display in the Editor.
* Update CSS.
* Add base tests for the new Add to Cart Form component.
* Add Product Image Gallery block
* remove support global styles
* remove support global styles
* Update the button CSS.
* Remove customizations for the Single Product Details block
* Update styles for the cart form.
* update td style.
* Update divs and CSS.
* Use conventional input instead of the experimental InputControl
* address CSS feedback
* add support for the custom classname
* remove save function
* Remove unnecessary console.log from the Edit.tsx file
* Remove block classname from block wrapper
* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController
* Remove attributes property from the block registration
* Remove isExperimental flag for the Single Product Details block
* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block
* Prevent Single Product Details block from apppearing in Pages or Posts
* add second parameter to the subscribe function
* Implement the new design and copy provided for the editor.
* Make the notice compatible with dark themes.
* Some additional CSS tweaks
* adjust the padding for the input
* wrap the Single Product Template in a div with the product class
* Fix PHP Coding Standards warnings
* improve logic and increase coverage of unit test
* improve logic and increase coverage of unit test
* fix test
* format HTML
* fix edge case
* update @types/wordpress__data package
* update placeholder, icon and description
* update tsconfig
* update block name
* fix SCSS linter error
* address feedback
* create SingleProductTemplateCompatibility class
* Add Hooks compatibility
* remove not used file
* remove not used files
* Add compatibility layer for the Single Product template
* fix check
* address feedback
* remove unused import
* double empty line
* remove logic in the constructor
* remove hook
* generate the docs
* add missing hooks
* fix docs
* address feedback
* fix linter
* fix import
* Disable compatibility layer when the WooCommerce Product Grid Block block and WooCommerce Single Product Block are used (https://github.com/woocommerce/woocommerce-blocks/pull/8538)
* disable compatibility layer via hook
* update docs
* generate the docs
* fix version
* fix import
* fix code after merge
---------
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Add Store Breadcrumbs block to the blockified archive-product and product-search-results templates
* Make Product Title a link by default
This has been changed in the Products block, so it should be relfected here as well
* Move get_local_pickup_method_ids to LocalPickupUtils file
This is because we need it to be accessible by other classes.
* Remove pickup_location strings & get all collectable methods dynamically
---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Empty commit for release pull request
* Add changelog in readme.txt
* Add testing notes
* Remove change from testing notes
This requires AvaTax credentials for testing. So, we'll test for
regressions instead
* Check for null session before going forward (https://github.com/woocommerce/woocommerce-blocks/pull/8537)
* Fix Payment Options settings crash in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/8535)
* Ensure express payment buttons are visible next to each other (https://github.com/woocommerce/woocommerce-blocks/pull/8548)
* Update ZIP file
* Bumping version strings to new version.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
* Empty commit for release pull request
* update readme
* Switch to select instead of resolveSelector (https://github.com/woocommerce/woocommerce-blocks/pull/8356)
* Mini Cart block - Fix the drawer content height to allow checkout button to show. (https://github.com/woocommerce/woocommerce-blocks/pull/8351)
* Add max-height to Mini Cart drawer.
By giving the Mini Cart contents a max height with the
-webkit-fill-available property, we can ensure that the browser chrome
is accounted for on mobile devices.
* Add `dvh` and keep `vh` as a fallback for height.
By adding `dvh`, we also account for non-webkit mobile browsers that
have the same hidden button issue.
See
https://github.com/woocommerce/woocommerce-blocks/pull/8351#pullrequestreview-1278867767
Keeping `vh` as a fallback, along with `-webkit-fill-available` gives us
the widest range of support.
* update readme with changelog
* add testing steps
* add pr links to readme
* Bumping version strings to new version.
* Check for null session before going forward (https://github.com/woocommerce/woocommerce-blocks/pull/8537)
* add testing instructions
* Empty commit for release pull request
* add zip link
* Update zip link
* update zip link for testing
* Bumping version strings to new version.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Extract a blockified Product Archive Template to the templates
* Add templates to tsconfig.json so the files are resolved as part of the core code
* Add a encouragement note to use blockified version IF migration is available
* Add a Row block wrapping Product Results Count and Catalog Sorting blocks
* Move blockified product-archive from templates/ to assets/ directory
* Remove unnecessary margin from Product Results Count block
When used in a Row block in a blockified Archive Product template, Product Results Count had additional unnecessary margin which caused misalignment with the Catalog Sorting block
* Update the description of the Classic Template Editor placeholder
* Remove unnecessary entry in tsconfig.json to include templates directory
It was added couple of commits earlier, since the template was kept there, but it was decided to move it to assets directory, so entry is no longer necessary
* Differentiate the Classic Template placeholder description depending on the availability to convert to Products block
* Set margin for Catalog Sorting to 0, so it aligns properly when used in blockified Archive Product template
* Make the blockification config, so it covers the Product Archive as well as Single Product templates
* Move the product-archive specific functions from classic-template/index.tsx to the product-archive.ts
* Add alignment option to the Store Notices block and make the blockified template blocks aligned wide
That is required, so the Classic Template layout is preserved
* Create single-product.ts file which is a placeholder for the blockified Single Product template
* Make Blockified Product Archive template inherit the align attibute
* Simplify the interface of blockified templates
Expose function instead of two functions for allowing and disallowing conversion
* Add a BlockifiedTemplate type
* Rename and simplify the function checking if conversion of classic template to block version is possible
* Align the variable naming to use instead of
* Pass the Classic Template attributes to the blockified template instead of getting it from data store
* Include Breadcrumbs block in the Blockified Product Archive Template
* Consume alignment attributes of Catalog Sorting in the PHP render function
* Consume alignment attributes of Breadcrumbs in the PHP render function
* Remove align support from Catalog Sorting and add to Store Notices block
* Extend the get_classes_and_styles_by_attributes method with align and text_align attributes
* Add Archive Title block to the Blockified Classic Template
* Minor getRowBlock function refactor
* Add property to the classic templates and base the config on it instead of placeholder
* Add separate blockified template for a Product Search Results
* Pass attribute from classic template to No Results block in Product Search Results
* Extract the common functions between blockified archive-template and product-search-results to utils
* Enable 'Inherit query from template' in Products block by default when converting the Classic Template to blockified one
* Improve the naming of BlockifiedTemplateConfig type
* Differentiate Product Catalog and Products By * templates. The latter include Term Description block
* Change unclear ProductsBy to ProductTaxonomy in regards to classic template conversion
* Revert the margin fix which was added already on trunk
* Move the surrounding blocks as inner blocks of Products
* Hide the conversion behind the experimental build flag (as it was before)
* Restrict usage to the single product template.
* Update class prefix from wc to wp
* Move the add-to-cart-form block to atomic blocks so it is aligned with the updated structure adopted for single product related blocks.
* Address CR
* ditch woocommerce class.
* remove attributes key
* Add new styles to account for the removal of the .summary and .entry-summary selectors
* Narrow down the styles to the add-to-cart-form class.
* Wait for push changes before clicking place order
* Blur last field and wait for network requests when entering addresses
* Use correct quote style
* Add address_2 to fake test address
* Use correct property names when filling test address
* Use correct comment style
* Update address values to reflect what is in the config file
* Remove unnecessary waits
* Improve batch request checking when filling shipping and billing address
* Wait for network idle before selecting shipping address
* Add checkCustomerPushCompleted function
* Override checkout data with test email
* Fill in the checkout data when testing for terms and conditions text
* Improve comments
---------
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Fix notice persistence after dismissal
- This fix applied to the `incompatible payment gateway notice`.
- We used the same dismissal logic in the `sidebar compatibility notice`
* Get incompatible payments when initialized
We initially get the list of `globalPaymentMethods` shared from
the back-end as incompatible payments, because the front-end
`availablePaymentMethods` is empty before the
`paymentMethodsInitialized` state
* Introduce advanced notice dismissal handling
We want to display a dismissed incompatible gateways notice, when the
list of incompatible gateways is updated (e.g., a new incompatible
gateway is enabled)
* Use the full block name for the `Cart` & `Checkout`
* Update variable name for comprehension
* Fix TS errors
* Remove unused imports
* Add workflow to check valid links in all documentations
* Disable issue create link
* Correct storybook multiple components link
* Fix links
* Limit checks to certain paths
* Revert changes to contributors readme
* Empty commit for release pull request
* Add changelog to readme.txt
* Unset default customer state if it doesn't match country (https://github.com/woocommerce/woocommerce-blocks/pull/8460)
* Unset default state
* add controller for customers
* rename validation file
* explain fix inline
* address feedback
* revert back state logic
* Update src/StoreApi/Utilities/ValidationUtils.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update readme.txt
* Add testing notes
* Update testing notes
* Fix Customer account sidebar link incorrect margin in WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8437)
* Fix Customer account sidebar link incorrect margin in WP 6.2
* Update class name to match the guidelines
* Prevent cart from breaking when item_data contains an array (https://github.com/woocommerce/woocommerce-blocks/pull/8440)
* Ensure array item data is removed
* Remove unused key
* Clean up code and add comments
* Check for null instead of empty
* Use plain foreach to filter and map arrays
* Add minimum height to Mini Cart Contents block in the Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8458)
* Update testing notes zip file
* Update testing notes
* Update testing notes file
* Bumping version strings to new version.
* Empty commit for release pull request
* Empty commit for release pull request
* disable compatibilty layer (https://github.com/woocommerce/woocommerce-blocks/pull/8507)
* update changelog and testing instructions
* add zip link
* Bumping version strings to new version.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* pin node version in nighlty build
* trigger action for this PR
* move step to its own file
* remove workflow_dispatch
* revert original trigger
---------
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* wip: update blockified archive templates
* Update product archive title to Shop
* Update product search template to blockified version
* new default templates, all blocks are Products block inner blocks
* revert change to fallack eligible archive templates
* remove unneccessary translated strings
* only filter the archive title on the shop page
* add missing categories header for patterns
* remove the term description block on the fly
* explain the reason for removing the term description block
---------
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
* Fix e2e tests which use the insertBlock function
* Move more instances of insertBlock to insertWCBlock
* Ensure block inserter is open before searching for a block
* Get rid of openWidgetsEditorBlockInserter
* Rename insertWCBlocks to insertBlockDontWaitForInsertClose
* Fix e2e tests of the Product Details block
* Migrate to insertBlockDontWaitForInsertClose instead of insertBlock
* Go to single product template
* Fix Product Details classname and slug in tests
* Replace usage of 'foo' variable name
* Fix typo in 'can not be inserted in a post' test
* Product Rating and Price: Re-add alignment controls in the All Products context.
* Add default values to align attributes for price and rating product elements
---------
Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
* Fix product categories & keyword filter not working
* Fix Product tags filter not working
* Make code readable by creating functions for the different parts of the query.
Functions:
- get_filter_by_product_categories_or_tags_query
- get_filter_by_keyword_query
Also rename the function `get_queries_by_attributes` to `get_queries_by_custom_attributes` to make it more clear what it does.
* Make function generic by including all taxonomies
As user can add custom taxonomies, we need to make sure that we include all taxonomies in the query.
To fetch all product taxonomies, I used following function:
```php
get_taxonomies( array( 'object_type' => array( 'product' ) ), 'names' )
```
* Minor improvements based on PR feedback
* Move null check for tax_query to function
* Update ataylorme/eslint-annotate-action to use node 16
* Update preactjs/compressed-size-action to use node 16
* Update actions/upload-artifact to v3
* Fix e2e tests which use the insertBlock function
* Move more instances of insertBlock to insertWCBlock
* Ensure block inserter is open before searching for a block
* Get rid of openWidgetsEditorBlockInserter
* Rename insertWCBlocks to insertBlockDontWaitForInsertClose
* Empty commit for release pull request
* Add changelog to readme.txt
* Unset default customer state if it doesn't match country (https://github.com/woocommerce/woocommerce-blocks/pull/8460)
* Unset default state
* add controller for customers
* rename validation file
* explain fix inline
* address feedback
* revert back state logic
* Update src/StoreApi/Utilities/ValidationUtils.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update readme.txt
* Add testing notes
* Update testing notes
* Fix Customer account sidebar link incorrect margin in WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8437)
* Fix Customer account sidebar link incorrect margin in WP 6.2
* Update class name to match the guidelines
* Prevent cart from breaking when item_data contains an array (https://github.com/woocommerce/woocommerce-blocks/pull/8440)
* Ensure array item data is removed
* Remove unused key
* Clean up code and add comments
* Check for null instead of empty
* Use plain foreach to filter and map arrays
* Add minimum height to Mini Cart Contents block in the Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8458)
* Update testing notes zip file
* Update testing notes
* Update testing notes file
* Bumping version strings to new version.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Ensure array item data is removed
* Remove unused key
* Clean up code and add comments
* Check for null instead of empty
* Use plain foreach to filter and map arrays
* WIP
* Deprecate isPaymentPristine and undeprecate isPaymentStarted
* Set payment status to FAILED or SUCCESS when the storeAPI fetch returns
* Remove FINISHED as a status
* Remove ready status
* Revert "Remove FINISHED as a status"
This reverts commit 38d66ed1d9565756d2373533c7a7c5b107a68ddd.
* Add payment status READY
* Removed payment statuses pristine, failed and success
* Remove deprecated selectors and update docs
* Rename the checkout events
* Merge conflicts
* Update test observer
* Update deprecation notice
* deprecation versions
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Ensure array item data is removed
* Remove unused key
* Clean up code and add comments
* Check for null instead of empty
* Use plain foreach to filter and map arrays
* Add support for woocommerce_loop_add_to_cart_args filter in Products block
* Reuse placeholder
* Use isset() instead of array_key_exists() to keep code consistent
* Add aria-label attribute to Add to Cart button
* Add the initial basis for the Add to Cart button
* Trigger the single product add to cart action for each product type.
* Rename the block from add-to-cart-button to add-to-cart-form
* Update to use the cart icon.
* Implement the skeleton for the editor preview.
* Update styles and add Notice for the display in the Editor.
* Update CSS.
* Add base tests for the new Add to Cart Form component.
* Update the button CSS.
* Update styles for the cart form.
* update td style.
* Update divs and CSS.
* Use conventional input instead of the experimental InputControl
* Implement the new design and copy provided for the editor.
* Make the notice compatible with dark themes.
* Some additional CSS tweaks
* adjust the padding for the input
* Update the icon for the block to match the core icon button
* Add minimum structure for Single Product Details block
* Add tests for Single Product Details block
* wip: create block structure and add initial styles
* Add block details to the SingleProductDetails.php file
* Render tabs title with empty content
* Use woocommerce_output_product_data_tabs function to retrieve tabs data
* Remove customizations for the Single Product Details block
* Remove unnecessary console.log from the Edit.tsx file
* Remove block classname from block wrapper
* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController
* Remove attributes property from the block registration
* Remove isExperimental flag for the Single Product Details block
* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block
* Prevent Single Product Details block from apppearing in Pages or Posts
* Fix PHP Coding Standards warnings
* update block name
* fix SCSS linter error
* move blocks into product-elements folder and rename to product-details
* avoid 404 error
* disable js asset enqueue
---------
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* Empty commit for release pull request
* Add the changelog entries to readme.txt
* Remove internal change from testing notes
* Add testing notes for the release
* Update docs/internal-developers/testing/releases/960.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/960.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/960.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update docs/internal-developers/testing/releases/960.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update testing notes (960.md)
* Update images size in release notes (960.md)
* Update release notes (960.md) — images size
* Checkout/Store API - Allow partial pushes without country (https://github.com/woocommerce/woocommerce-blocks/pull/8425)
* Support partial push without country field
* Increase timeout to prevent excessive pushes
* Push on focusout
* Only flush inputs
* change debounce timer to 1s
---------
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Add link to PR that deprecated experimental functions (https://github.com/woocommerce/woocommerce-blocks/pull/8430)
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Update ZIP link after cherry-picking
* Add testing notes for the cherry picked PR
* Add changelog entry of the cherry picked PR
* Bumping version strings to new version.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Support partial push without country field
* Increase timeout to prevent excessive pushes
* Push on focusout
* Only flush inputs
* change debounce timer to 1s
---------
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Support partial push without country field
* Increase timeout to prevent excessive pushes
* Push on focusout
* Only flush inputs
* change debounce timer to 1s
---------
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* wrap the Single Product Template in a div with the product class
* improve logic and increase coverage of unit test
* improve logic and increase coverage of unit test
* fix test
* format HTML
* fix edge case
* address feedback
* fix name block and fix check
* wrap single product template only on the frontend
* Add Product Image Gallery woocommerce/woocommerce-blocks#8233
Add Product Image Gallery
* Add Product Image Gallery block
* remove support global styles
* remove support global styles
* address CSS feedback
* add support for the custom classname
* remove save function
* add second parameter to the subscribe function
* update @types/wordpress__data package
* update placeholder, icon and description
* update tsconfig
* WIP
* Change payment status from pristine to idle
* Deprecate isPaymentStarted and isPaymentFinished
* Correct comments
* Deprecate isPaymentPristine and undeprecate isPaymentStarted
* Set payment status to FAILED or SUCCESS when the storeAPI fetch returns
* Remove FINISHED as a status
* Remove ready status
* Revert "Remove FINISHED as a status"
This reverts commit 38d66ed1d9565756d2373533c7a7c5b107a68ddd.
* Add payment status READY
* Update use-payment-interface
* Removed payment statuses pristine, failed and success
* Remove deprecated selectors and update docs
* Deprecate isPaymentStarted in favour of isExpressPaymentStarted
* Fix tests
* Update assets/js/base/context/providers/cart-checkout/payment-events/index.tsx
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Mikes suggestions
* Change since version
* Fix tests
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Reset margin on result count block
* Reset margin for catalog sort block
* reset margin and other fixes for breadcrumb block.
* Move styles to relevant files
* Remove newsletter repo example from the docs
The newsletter is not maintained anymore and we use the @woocommerce/extend-cart-checkout-block to showcase our extensibility points
* Update docs/README.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
---------
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Set inherit default to true when products is inserted on archive products templates
* Create new query attributes object
Co-authored-by: kmanijak <karol.manijak@automattic.com>
* Extract the products registration to a separate function
* Bring back variation name
* Move variation name
* Unregister the block before registering it again
* Use subscribe only on the site editor
* Undo change
* Try fixing tests
* Fix test
* Revert test only
---------
Co-authored-by: kmanijak <karol.manijak@automattic.com>
* Allow observers to set billingAddress by returning billingData
This is required since we didn't correctly deprecate billingData when we changed the name to billingAddress
* Add tests for shippingAddress and paymentMethodData
* Add mocked __internalSetPaymentMethodData to correct object
It was in registry, but should be in dispatch as the action is on the same store as the thunk. Registry is used for actions on other stores.
* Re-add FieldValidationStatus type
* Add FieldValidationStatus back
* Remove empty file
* Import FieldValidationStatus from correct place
* Remove import of deleted types file
* Add isObserverResponse type guard
* Use error constant instead of magic string in event emitter
* Remove composite project tsconfig
* Add ObserverResponse type
* Add types to emitEventWithAbort
* Check if paymentmethod data is an object before dispatching
* Set types on observer responses
* Add validationErrors type guards
* Add tests for validation typeguards
* Add validation errors as option on observer response
* Add more granular observer response types
* Check observer response has correct types before dispatching actions
* Force type on deprecated billingData and shippingData
* Remove unnecessary comment
* Add wrapper for __experimentalRegisterCheckoutFilters and deprecate it
* Update internal references from __experimentalRegisterCheckoutFilters
* Add wrapper for deprecated __experimentalApplyCheckoutFilter
* Update references from `__experimentalApplyCheckoutFilter`
With WordPress 6.2, the inspector controls are going to be
tabbed into a “Styles” and “Setting” section (where applicable).
Previously, in order to display our Feedback Prompt at the bottom
of the controls, we had hooked it into the “Colors” section
as a temporary/hacky solution to the problem.
Now that the styles sections are all moved, the problem
doesn't really exist anymore, and we can just place it
at the bottom of the controls.
* Prevent coupon error disappearing on blur if value unchanged
* Check for inline selector on coupon error
* Prevent coupon error disappearing on blur if value unchanged
* Check for inline selector on coupon error
* Update selector for coupon E2E test
* Empty commit for release pull request
* update readme
* Switch to select instead of resolveSelector (https://github.com/woocommerce/woocommerce-blocks/pull/8356)
* Mini Cart block - Fix the drawer content height to allow checkout button to show. (https://github.com/woocommerce/woocommerce-blocks/pull/8351)
* Add max-height to Mini Cart drawer.
By giving the Mini Cart contents a max height with the
-webkit-fill-available property, we can ensure that the browser chrome
is accounted for on mobile devices.
* Add `dvh` and keep `vh` as a fallback for height.
By adding `dvh`, we also account for non-webkit mobile browsers that
have the same hidden button issue.
See
https://github.com/woocommerce/woocommerce-blocks/pull/8351#pullrequestreview-1278867767
Keeping `vh` as a fallback, along with `-webkit-fill-available` gives us
the widest range of support.
* update readme with changelog
* add testing steps
* add pr links to readme
* Bumping version strings to new version.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
- Revert the label change to "Add a coupon" so that it will be merged to WC Core and translation for the new string will be available.
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Capture notices from hidden block into siblings block
* switch to using a single context
* make change bwc
* support context as array in StoreNotice
* Handle single context use cases
* Capture notices from hidden block into siblings block
* switch to using a single context
* make change bwc
* add tests
* support context as array in StoreNotice
* move filter logic to Notice component
* Fix the alert icon's name
* Add "status" to the Alert's API
* Update the incompatible gateways notice's design
* Set the list's bullet points from CSS
Currently, the Cart block doesn't fully support Global Styles,
so, in orderto avoid providing the users with a confusing
or broken experience, we have decided to remove it
for the time being, until proper support has been added.
* Add get_collectible_method_ids function
* Add collectibleMethodIds to asset data registry
* Check whether method id is pickup_location/in collectibleMethodIds
* Allow selectShippingRate to be called without a package id
* Prevent collectible methods showing in the main shipping area
* Remove unnecessary pluck and add pickup_location to returned array
* No longer insert pickup_location in collectibleMethodIds
* Allow third party methods to influence low/high collection price
* Update useShippingData to consider any collectible method
* Add hasSelectedLocalPickup to shipping types
* Add dependency to selectShippingRate in useShippingData
* Register collectibleMethodIds as a callback
This is so the shipping methods get change to register before this is called. Passing a callback to `add` means it won't be called until just before it is output.
* Update supports key to 'local_pickup'
* Rename utils/shipping-rates to TS
* Convert to TS, add isPackageRateCollectible & hasCollectableRate
* Add tests for hasCollectableRate and isPackageRateCollectible
* Update shipping controller to output only method names
* Make PickupLocation shipping method support local_pickup
* Set prefersCollection based on rate ID being collectible
* Remove need to retrieve settings and use helper function instead
* rename hasCollectableRate to hasCollectibleRate
* Use array_reduce and update comments in get_local_pickup_method_ids
* Switch order of array_unique and array_values
* Remove unneeded dependency
* Hyphenate local-pickup so it follows the same format as other features
* Update use of collectible to collectable
* Change supports feature to be hyphenated
* Update __internalSetExtensionData to require namespaces
* Test coverage for __internalSetExtensionData
* Rename of select is no longer needed
* Update doc
* Global Styles: Add support for text settings
* StyleAttributesUtils: Change function order
* Global Styles: Remove redundant isFeaturePluginBuild() from useTypographyProps().
* Add max-height to Mini Cart drawer.
By giving the Mini Cart contents a max height with the
-webkit-fill-available property, we can ensure that the browser chrome
is accounted for on mobile devices.
* Add `dvh` and keep `vh` as a fallback for height.
By adding `dvh`, we also account for non-webkit mobile browsers that
have the same hidden button issue.
See
https://github.com/woocommerce/woocommerce-blocks/pull/8351#pullrequestreview-1278867767
Keeping `vh` as a fallback, along with `-webkit-fill-available` gives us
the widest range of support.
* Store breadcrumbs block: Gate global styles added via experimental flags to the feature plugin.
* Rename the const to featurePluginSupport and invoke it on block registration.
* Address CR
* Initial structure for the breadcrumbs block
* ditch inline comment
* Fine-tune the store breadcrumbs
* Disable the breadcrumbs block for regular posts & pages
* Update the breadcrumbs block details.
* Add tests
* rely on sprintf to render the breadcrumb
* Ditch usesContext.
* Add a link to the breadcrumb editor preview
* Disable all pointer-events for the breadcrumb link in the editor preview
* Add the align attribute
* Use the Disabled component to prevent interactions and update the copy for the block description.
* Subscribe only to changes on core/block-editor
* Improve performance of useForcedLayou
This is because by the time we reach this line, innerBlocks will be an empty array (or we wouldn't make it this far) and if nextBlocks contains ANY items it will, by definition be unequal, so a length check is simpler and more performant. Also we can remove the dependence on yet another lodash function by doing it this way.
* Check if templates synced before doing it again in useForcedLayout
* Style Book: Fix Featured Product and Featured Category Blocks
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Subscribe only to changes on core/block-editor
* Improve performance of useForcedLayou
This is because by the time we reach this line, innerBlocks will be an empty array (or we wouldn't make it this far) and if nextBlocks contains ANY items it will, by definition be unequal, so a length check is simpler and more performant. Also we can remove the dependence on yet another lodash function by doing it this way.
* Check if templates synced before doing it again in useForcedLayout
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Empty commit for release pull request
* add testing instructions
* add zip file for testing
* update readme
* upload new zip
* Bumping version strings to new version.
* Empty commit for release pull request
* Remove feature flag from Element variations (https://github.com/woocommerce/woocommerce-blocks/pull/8297)
Removes feature flag from:
* Product Summary
* Product Template
* Product Title
* Empty commit for release pull request
* add testing instructions
* add zip link for testing
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
* Add Interactivity API scripts
* Enqueue scripts if Products exists for testing
* Test client-side transitions
* Remove script enqueue
* Remove hpq dependency
* Update Interactivity scripts to latest version
* Remove interactivity scripts from core entries
* Create webpack config for interactivity api
A plugin for optional chaining is required as the repo uses Webpack 4 for now.
* Enqueue the directives runtime
* Updated wp directives code
* Use a filter to enque the directives runtime
* Remove base-interactivity alias for now
* Add path for modules inside base-interactivity
* Revert "Remove base-interactivity alias for now"
This reverts commit 7c6cbee372c65e430590d98c1819b6b4b0a97d93.
* Remove unnecessary filter and enqueue
* Update router code
* Update Interactivity location and alias
* Use hook `init` for script registering
Co-authored-by: Mario Santos <santosguillamot@gmail.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
* Refresh on back
* Move refresh code to a hook in useStoreCart
* Load mini cart scripts when page is invalid
* Update code comments
* refreshDataIfPersisted->refreshCachedCartData
* Avoid deprecated code
* Only notify if cart resolution has finished
* Fix tests to check for cart resolution
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Make Notice component color black
The Notice component text is not legible in dark themes since the background color
is light and and the text color is too. With this change we are setting the color
always to black for our blocks, so it's always legible.
* Make the text black for notices displayed on the editor
* Import editor.scss
* Fixes a bug where cart response only reflects variation data submitted and not full variation data with default values.
* Sort variation data by attribute alphabetically
* PHP unit test for checking variation data.
* support partial updates
* revised error ids to reference in validation class
* Validate before push
* Fix logic + TS
* Avoid need for PUT by delaying validation/sanitization
* $cart change was not needed
* Revert changes in schema - fix is handled at route level
* Put back wc_do_deprecated_action
* Extra validation is not needed
* No need to export isValidAddressKey - its not used anywhere
* No longer using RouteException in customer update route
* Fix setting shipping to billing with changes
* Update error ids
* Only validate posted props
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Updated package-lock.json
* fixed method sig
* PHP versions matrix
* removed extra space
* renamed step
* Update E2E and coding standards to use PHP 8.0
* Un-linted unit-tests.yml. Github flows use 4 spaces indent, while our .editorconfig file enforces 2 spaces.
* Refactor unit-tests.yml
* Linted unit-tests.yml to proper 2 space indents
* Removed composer caching
* Test without hacky permissions step
* Concurrency disable.
Jobs renaming.
* Add step to install wp-env for PHP unit tests.
* Another try at fixing perms for wp-env
* Another try at fixing perms for wp-env
* Restore missing steps
* Move notices to corresponding context
* Change `errorMessageContext` to `context`
* Fix MD lint errors
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Allow observers to set billingAddress by returning billingData
This is required since we didn't correctly deprecate billingData when we changed the name to billingAddress
* Add link to original PR
* Set billingAddress when observer errors
* Rename shippingData to shippingAddress
* Add isBillingAddress and isShippingAddress type guards
* Add tests for new type guards
* Only set billing and shipping if they are valid objects
* Add tests for __internalEmitPaymentProcessingEvent thunk
* Update deprecated version
* Return promise from this function to aid with testability
* Add tests for shippingAddress and paymentMethodData
* Ensure correct value is used to set shipping address
* Move test data out of tests to aid with reusability
* Improve success callback name
* Add mocked __internalSetPaymentMethodData to correct object
It was in registry, but should be in dispatch as the action is on the same store as the thunk. Registry is used for actions on other stores.
* Add test for failed observers
* Add test for mixed observers
* Add comments explaining the destructure & deprecation
* use cart item key instead of index
* Update src/StoreApi/Schemas/V1/CartShippingRateSchema.php
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
The "Coupon code" text was changed to "Add a coupon" and it resulted in the failing of an e2e test as it couldn't find the translated text for "Coupon code". The translation for "Add a coupon" is not available so changing the text to "Apply a coupon code" until the next WC Core release since the translation for the text "Apply a coupon code" is already available.
* Empty commit for release pull request
* add testing instructions
* add zip file for testing
* update readme
* upload new zip
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
* Product Rating: Transition from using CSS margin to Global Styles
* Product Rating: Re-add css margins for Product Rating inside of the All Products block.
* Product Rating: Change bottom margin to 1rem
* Product Rating: Re-add the Classic Template fix.
* Product Rating: Remove the Classic Template fix.
* Product Price: Transition from using CSS margin to Global Styles
* Product Price: Re-add css margins for Product Price inside of the All Products block.
* Product Price: Change bottom margin to 1rem
* Product Price: Fix the margin typescript declaration.
* wip: initial BlockTemplatesCompatibility class
* full support for archive template
* early return
* fix early return using wc conditional functions
* address code review
* remove_default_hooks is only called with inherited block
* refactor the data structure
* shorter hook name
* Move additional hooks to remove_default_hooks
* Update src/Templates/BlockTemplatesCompatibility.php
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Add check that is an array
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Scroll to errors when interacting with radio buttons
* Fix full stop wrapping in checkout
* Make type guard for api response reusable
* Merge useShippingData and useSelectShippingRate
Overlapping functionality and responsibility easily merged into a single hook.
* ShippingDataProvider Typescript
* Create errors when receiving errors via thunk
* Update DEFAULT_ERROR_MESSAGE
* Update tests since all errors are set via new action
* Correct SET_ERROR_DATA
* Update json error text and allow it to be dismissed
* Add back missing comment in types
* Put back typedef
* Allow Store Notice Containers to display subContexts without changing original context
* receiveError handles cart
* Update assets/js/data/cart/notify-errors.ts
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update assets/js/base/context/hooks/shipping/types.ts
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Remove debug
* Revise type (remove as)
* rename to unregisteredSubContexts
* getNoticeContexts comment
* Add test for unregistered errors
* Update comment
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Allow the context to be overridden when processing errors
* Export all error functions
* Allow customer data update if not editing fields
* removeNoticesWithContext Helper
* Hide rates when editing the address
* New update address logic
* Handle cancel for the form
* Block scaffolding
* Rename to store notices
* Register only in the site editor
* Update description
* Add woocommerce class
* Add tests
* Delete old test file
* Update notices message in the editor
* Remove customization
* Disable the block server side
* Fix TS error
* Add custom classes
* Reprashed test description
* Escape notices
* Remove unnecessary disabled component
* Only allow to insert the block once
* Improve class name
* Merge edit and block files
* Fix copy
* Simplify test case
* Remove align support
* Remove attributes
* Change editor markup
* Use the Notice component to display the notice placeholder on the editor
* Use sprintf to improve readability
* Inline component
* Remove styles and unregister scripts
* Use ordered placeholders
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Use info as the notices status
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix php lint error
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* WIP
* Render in editor and add styles
* Simplify select
* Undo change
* Update titles and description
* Wrapped text for translation
* Remove from products inner blocks
* Allow the block in the inserter
* Rename test file and add new tests for catalog-sorting block
* Register on the site editor only
* Fix tests
* Disable block server side
* Override the `enqueue_assets`
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix TS error
* Simplify edit
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Disable background color
* Add custom classes
* Remove alignment
* Inherit color and font properties
* Merge edit and block files
* Use sprintf to improve code readability
* Make fontsize small by default
* Add order placeholders and woocommerce class
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix floating issue
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add woocommerce class
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Init setup to add a new block Results Count
* Render template part as a content of ResultsCount block
* Switch to template part rendering
* Rename the block to ProductResultsCount
* Fix typo in BlockTypesController
* Change the ProductResultsCount class name
* Remove Product Results Count block from Product Query template
* Improve the way Product Results Count is rendered in the editor
* Add prefix to places that missed renaming from ResultsCount to ProductResultsCount
* Remove unnecessary frontend.tsx file for ProductResultsCount
* Make sure global styles are applied and respected by Product Results Count block
* Make sure the Product Results Count is available inly in Product Catalog template
* Add basic tests to Product Results Count
* Remove empty line in style file
* Fix TS issue in Product Results Count
* Fix typo
* Override the enqueue_assets method to prevent unnecessary enqueue and 404 error on the frontend
* Add necessary property to block's metadata
* Address code review feedback
* Update description
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove disabled component
* Improve test description
* Merge edit and block files
* Remove align support
* Remove background support
* Simplify edit component
* Improve readability with sprintf and add custom class
* Simplify test case
* Add styles and order placeholders
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix markup to match with the frontend
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Empty commit for release pull request
* update WooCommerce compatibility
* adding testing instructions
* add zip file testing for the release 9.4.0
* add gif to testing instructions
* remove add to cart testing instructions
* Correctly detect compatible express payment methods (https://github.com/woocommerce/woocommerce-blocks/pull/8201)
* Remove unused action and type action
* Derive the incompatible payment methods with selector
Instead of adding the incompatiblePaymentMethods to the payment state.
Let's simply derive it using a selector to keep a minimal state.
* Check compatibility with express payments
* update testing instructions
* add new zip file for testing
* Refresh shipping cache when saving Local Pickup (https://github.com/woocommerce/woocommerce-blocks/pull/8203)
* invalidate cache on page load
* always flesh settings after save
* use correct prefix
* Account for local pickup rates before disabling shipping in editor (https://github.com/woocommerce/woocommerce-blocks/pull/8207)
* Account for local pickup rates before disabling
* check for local pickup before disabling shipping in editor
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Add coupon link instead of dropdown in Cart and Checkout blocks
* Fix state names used for displaying the link and coupon form
* Fix storybook for coupon block
* Fix unit test for coupon block
* Fix css and accessibility
* Fix coupon block position on Checkout
* Update e2e test cases for coupon block (https://github.com/woocommerce/woocommerce-blocks/pull/8022)
* Update e2e test cases for coupon block
* Fix perfomance test for coupon block
* Fix double await typo
* Fix perfomance test for coupon block
* Remove CSS
* Use classnames to add and remove classes
Improved the code to use classnames to add and remove classes. Also, moved the logic to handle click and submit to separate functions.
* Remove unused action and type action
* Derive the incompatible payment methods with selector
Instead of adding the incompatiblePaymentMethods to the payment state.
Let's simply derive it using a selector to keep a minimal state.
* Check compatibility with express payments
* Remove unused action and type action
* Derive the incompatible payment methods with selector
Instead of adding the incompatiblePaymentMethods to the payment state.
Let's simply derive it using a selector to keep a minimal state.
* Check compatibility with express payments
Variable products would get added to cart via the button, even
when the button said “Select options” and contained a link.
This was because the button was automatically hydrated
through a CSS class.
Updating the package-lock.json file to fix the nightly build release failed error: npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
* Custom validation strings using a new function named getValidityMessageForInput
* getValidityMessageForInput tests
* Added integration test for error message
* Clear value
* update test strings
* Shipping and collection method block package support (https://github.com/woocommerce/woocommerce-blocks/pull/7383)
* Shipment wordage
* Hide panel if collection is not available for an item
* Update selection when displayed
* Register a global local pickup method for the block based checkout (https://github.com/woocommerce/woocommerce-blocks/pull/7414)
* Register a blocks local pickup method globally
* Remove local pickup plucking from store api
* Multiple pickup locations
* Unused code
* Translate meta data
* Update UI to match zones table
* Description
* Handle new shipping method in client
* Improve location rendering
* Only split out pickup location methods
* Fix enabled toggle
* Show and hide shipping text in sidebar based on pickup
* No need for "from" when min and max are the same price
* Update sample data for the editor
* fix errors
* Force method/pickup in the checkout layout (https://github.com/woocommerce/woocommerce-blocks/pull/7910)
* Split up ShippingRatesControl for readability
* Alignment styling
* Split tidy packages for readability
* Combine hooks to prevent circular dependency
* Notice styling
* Conflict
* Hide notice with 1 package
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* add notice when there are existing enabled legacy local pickups
* Fix PHP warning
* Link though to the settings page
* Fix setting save
* Enabling this will produce duplicate options at checkout.
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Avoid duplicates in selected shipping method display
* Correct types
* Render pickup locations - not rates
* Always show "from" when there are multiple packages
* Pickup must be available for all packages
* Derive locations from rates
* Improve code style/docs
* Packagecount
* Introduce woocommerce_store_api_cart_select_shipping_rate
* Update docblock
* Move payment methods
* Setup entrypoints
* Sortable implementation
* Sortable
* Basic UI in place for settings
* Hydrate real settings
* Form updates values
* Styling and save button placement
* useSettings hook
* Prepare for save
* delete
* Add location button
* Remove className
* Conditional display of taxes
* Save via API
* Update general settings to designs
* Modal styles
* Style table
* Border colors and radius
* Added e2e tests
* use node 16
* Enqueue states in admin
* Use render from wordpress/element
* Missing handle style
* Enable translations
* Remove curried function
* Todo for inline settings
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Hide form step descriptions when empty unless block has focus
* Make editor style match frontend
* Add links to settings in sidebar
* update sample costs
* phpcs
Break address into multiple pieces for pickup Break address into multiple pieces for pickup Break address into multiple pieces for pickup locations
Apply taxes based on location
Require locations
Customer location tax logic
Improved editing
* Shipment wordage
* Hide panel if collection is not available for an item
* Update selection when displayed
* Register a global local pickup method for the block based checkout (https://github.com/woocommerce/woocommerce-blocks/pull/7414)
* Register a blocks local pickup method globally
* Remove local pickup plucking from store api
* Multiple pickup locations
* Unused code
* Translate meta data
* Update UI to match zones table
* Description
* Handle new shipping method in client
* Improve location rendering
* Only split out pickup location methods
* Fix enabled toggle
* Show and hide shipping text in sidebar based on pickup
* No need for "from" when min and max are the same price
* Update sample data for the editor
* prefersCollection controls shipping visibility
* Remove log
* Create skeleton pickup options block based on shipping methods
* Filter locations to local pickup methods
* Correct case of block name
* Location styling
* Pull pickup details from new core fields
* Fix linting warnings on new types
* Remove blocks_local_pickup check (this does not exist yet)
* Move enable_local_pickup_without_address so it works under all contexts
* Fix display of FREE when there are a mix of prices
* Remove undefined return value
* Update block descriptions
* fix message
* Correct case
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Remove cart notices before showing new ones
* bot: update checkstyle.xml
* Update deps for useEffect
* Remove outdated notices from mini cart
* Add comment to note that this functionality is also present in mini cart
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Convert tabs component to TypeScript
* Add tabs component story
* Add desciptions in comments to the Tab props
* Rename and export tabs component to display descriptions in Storybook
Renamed Tabs component to __Tabs as a sign it should not be used directly. Since we were using withInstanceId as the default export and were not exporting the Tabs component, Storybook could not retrieve the description and default values. We have renamed and exported the component to make sure Storybook can pick up the descriptions and default values.
* Rename exported Tabs component
Changed the exported Tabs component from __Tabs to __TabsWithoutInstanceId to make it more descriptive.
* Use local package rather than WP package in base components
* Missing type on imports
* Move hasSpecingStyleSupport inline to avoid polluting utils with the block-editor external
* Use local wordpress-block-editor import to avoid the external
* Add readme to base directory to warn against using editor/components externals
* Check functions exist
* Revert "Check functions exist"
This reverts commit ce95800b79ddb48369cd22d2b7854384db0d8891.
* Revert wordpress-block-editor import
* Add todos to the hooks that need refactoring
* Update assets/js/atomic/blocks/product-elements/button/supports.ts
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Update assets/js/atomic/blocks/product-elements/image/supports.ts
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Update assets/js/atomic/blocks/product-elements/rating/support.ts
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Update assets/js/atomic/blocks/product-elements/sale-badge/support.ts
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Update assets/js/atomic/blocks/product-elements/title/index.ts
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Reference issue
* Update assets/js/base/README.MD
Co-authored-by: kmanijak <karol.manijak@automattic.com>
* spacing
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
* Remove the Products block from WP < 6.0
Too many APIs which are required for the Products block experience
are just plainly unavailable in versions lower than 6.0.
(cherry picked from commit ccfb1210bcbdb14ab52f6f240916fb4fcaa3ff18)
(cherry picked from commit 8c7bcce8218a83a9498943b23c971de1199bcad7)
* 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.