* fix bug with add to cart
* prettier
* migrate to Event
* prettier
* Update assets/js/atomic/components/product/button/index.js
update to fix on sequential adds
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Avoid dispatching cart update event on initial mount
* add condition to check if Event is defined
* Add context for collection data query
* Introduce useCollectionData hook
* Implement hook in filter blocks
* Update API to handle nuances of counts instead of client side
* Clone requests so original is untouched
* Prevent dupe requests is working
* Cleanup
* Update assets/js/base/hooks/use-collection-data.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update assets/js/base/hooks/use-collection-data.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Feedback
* Remove context
* Helper to get namespace routes from the REST Api
* Add routes to store settings
* HydrateRestApiData component
* Correct usage of useSelect
* Remove lodash
* Move code to HOC
* Remove language files and po2json generation scripts
* Add action filter and function to load core translations
* Use pre_load_script_translations
* Remove script actions
* docblock
There was no need to have a const for the default state and also needed to make sure we’re not mutating it because it would result in the mutation of the default state. This in turn meant that on the initial reducing action, the default state in the store would have a ghost value.
* Only do instant updates if filter button is disabled
* Update assets/js/blocks/price-filter/block.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Remove minConstraint and maxConstraint from price filter state
* Remove 'useMemo' from minConstraint and maxConstraint
* Make sure minConstraint and maxConstraint are numbers before updating min/max prices
* Make sure non-valid price constraints don't make it to usePrevious
* Remove again track min/max constraint useEffect
* All Products block with filters: avoid showing loading placeholders if there are no results
* Hide sort select and show message when no products are available
* Add no result templates
* Remove product-grid
* Move images to assets dir
* Update images
* Switch functions to Components
* Capitals
* add missing context
* Add reviews to Category endpoint
* add option to show categories with reviews
* update label text if we're using reviews for counting
* update reviews count to use raw sql
* add flag before querying review count
* add review_count to collection data & schema
* fix PR code review problems
* update tests to it expects the new collection param
* add note about review_count is schema
* Use same query for headers collection
* All Products: avoid pagination disappearing when switching pages/changing sort value (take 2)
* Cleanup
* fixes after rebase
* Make it work after last rebase
* only do page change when queryState.page has changed.
* Fixwoocommerce/woocommerce-blocks#1198 again
* Remove previousPage and isInitialized checks
* Enable preview for price filter block
Using the defaults works fine, so no options required.
* Attribute preview via block attribute
* Add sample content for preview
* remove unnecessary key
* remove unneeded export
* Basic block construction
* Register on PHP side
* wc-active-filters script
* Price utils
* Refactor price slider so state reflects the query
Moves some logic from the component to the block so that min and max price can change (via query) and be reflected by the price sliders.
This allows the active filters block to change the query and have those new values reflected by the slider.
* Fix type checking of numbers
* Styles for filter block
* Improved attribute helper for getting attribute taxonomy data from ID/taxonomy
* Refactor attribute filter to use updateAttributeFilter helper
* Disable checkboxes when loading to avoid multiple queries
* Add todos - this is blocked
* Remove checked state from Attribute Filter so it gets updated from the store (https://github.com/woocommerce/woocommerce-blocks/pull/1170)
* isLoading check
* active price filtering rendering
* Block heading
* Implement block options; chip display with clear button
* Clear all should remove all attributes
* Enable previews
* Introduce a component to look up terms from slugs using collections (which are cached)
* Correct all docblocks
* activePriceFilters null return
* renderRemovableListItem
* Remove useMemo for hasFilters
* Switch classnames notation
* Ensure slug is array in removeAttributeFilterBySlug
* null -> undefined return types for attributes
* Remove fragment
* Check we have a termObject in ActiveAttributeFilters
* Refactor formatPriceRange return statements
* Ensure query array index will exist
* Only sort when adding a query
* Remove aria-label with dupe text
* hasFilters is function
* Update useQueryStateByKey usage
* More doc block fixes
* Update getAttributeFromTaxonomy return and docblock
* getAttributeFromID return/docblock
* Add block error boundary to All Products and Reviews blocks
* Add block error boundary to Price Filter and Attributes Filter blocks
* Add image
* Make block error component use props instead of hardcoded values
* Add props to BlockErrorBoundary
* Change 'text' prop to 'content'
* Add docs to proptypes
* Replace 'content' prop with 'text'
* Show notices when PHP or WP versions are not met
* Update version-changes.sh so it updates versions in woocommerce-gutenberg-products-block.php
* Convert constants to normal variables
* Remove error_log calls
* Remove button with PHP update link
* Show notices only in plugins and WooCommerce pages