* Expose products settings in wcSettings
For the time being we expose only what is used by the blocks
which is `cartRedirectAfterAdd`. In the future more can be added
as needed. Setting is accessible via `getSetting( 'productsSettings' )`.
We namespace the settings under productsSettigns to reflect
the domain and how settings are organised in Woo admin and to
inform that this is an object with more settings within.
This setting normally was available **only** if AJAX add to cart was set
as a js global `wc_add_to_cart_params.cart_redirect_after_add`.
By accessing the option directly we ensure it’s exposed
to blocks regardless of if AJAX option is enabled.
* update AddToCartButton to respect cartRedirectAfterAdd
This adds the redirect directly on the AddToCartButton after succesful
add to cart action. This follows convention that redirects or other side
effects shouldn’t happen as part of the action but rather be part of the
control that triggers such flow.
* Update release-initial-checklist.md
This PR creates a new section `If this release is deployed to WordPress.org...` similar to the one in `patch-initial-checklist.md`
* Update patch release checklist
* fix: exclude Mini Cart from the blocks editor
* fix: explicitly register Mini Cart blocks for Site Editor and Widgets
* add check to loading the block on frontend
* add e2e tests for widget area
* improve test title
Co-authored-by: Luigi <gigitux@gmail.com>
* Add stories for Button component woocommerce/woocommerce-blocks#5250
Add stories for Button component
Co-authored-by: gigitux <gigitux@gmail.com>
* Button: Change With Spinner story title to Loading
When output with php the block had correct accessibility on
the frontend but in the editor or when rendered as block
the correct aria label was missing because of misspelled
aria-label attribute.
Also fixed wrong value type provided for tabIndex in editor
while at it.
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* move hooks in a specific folder
* fix crash on WP 5.8
* Featured Category block: Add support for global style woocommerce/woocommerce-blocks#4965
Featured Category block: Add support for global style
* fix border color
* Attribute Filter block: enable global style woocommerce/woocommerce-blocks#4965
Attribute Filter block: enable global style woocommerce/woocommerce-blocks#4965
* fix eslint error
* fix test
* add comments about !important
* fixes products by category added to cart style
fixeswoocommerce/woocommerce-blocks#5285 - View cart after adding item to cart was squeezed
in on the same line as the Add to Cart button
* fixes products by category sale price styles
fixeswoocommerce/woocommerce-blocks#5286 - sale price was underlined because of the default
styles on the used ins HTML element
* Add links to single routes in main index woocommerce/woocommerce-blocks#4473
* Footer
* Feedback template
* Remove footer from existing MD files
* Add doc footer script
* Apply script to all docs
* Fix examples
fixeswoocommerce/woocommerce-blocks#5674 - item edit relied on data from @woocommerce/previews
productsPreview which was missing mock data for product category
* Remove atom icon
* Swap icon usage to WordPress package
* remove unused icons from library
* Use @wordpress/primitives
* Product cats block to listView
* On-sale to use percent instead of tag icon
* add to cart button use button icon
* on sale products block icon
* Handpicked products use stack icon
* Products by stock box icon
* Make sparkles woo purple
* Fix icon name
* Correct more tag name
* fix path to icons
* Update snaps
* Update readme to explain updated usage
* Import SVG and path from primitives
* Missing isFeaturePluginBuild
* Update assets/js/icons/README.md
Co-authored-by: Raluca Stan <raluca.stan@automattic.com>
* Update assets/js/icons/README.md
Co-authored-by: Raluca Stan <raluca.stan@automattic.com>
* Update assets/js/icons/README.md
Co-authored-by: Raluca Stan <raluca.stan@automattic.com>
* update lock
Co-authored-by: Raluca Stan <raluca.stan@automattic.com>
* fix: add wrapper for empty mini cart contents inner blocks. Allow inner content to be scrollable
* fix overflow issue for the editor
* add padding for the empty cart view
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* move hooks in a specific folder
* fix crash on WP 5.8
* Featured Category block: Add support for global style woocommerce/woocommerce-blocks#4965
Featured Category block: Add support for global style
* fix border color
* Featured Product block: enable global style woocommerce/woocommerce-blocks#4965
Featured Product block: enable global style
* fix border color
* fix eslint error
* fix opacity
* fix border radius
* fix opacity
* disable font-size support
* restore height for featured product and featured category
* Remove unnecessary setup step and use node v16 in E2E action
* Ensure storefront is active
* Use new checkout fixture
* Try with only checkout test
* Update package.json
* Run all tests, not just checkout
* Add inner wrapper div in td.wc-block-cart-item__product
Adding this wrapper element is necessary in order to be able to "fake" item grouping in a theme-agnostic manner: https://user-images.githubusercontent.com/1783726/118831630-97855600-b8c8-11eb-8906-c7f9ada769e7.png
* Whoops
* Remove classnames function
* Update indentation for QuantitySelector
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Update payment-method-data-context tests to use userEvent
* Update mini cart block tests to use userEvent
* Update payment methods tests to use userEvent
* Add fake items fixture
* Add test for rendering items in sidebar
* Add test for items with addons
* Add textContentMatcherAccrossSiblings helper
This is needed to match text when it's spread over a few elements
* Add test to ensure subtotal renders correctly
* Add test to ensure discounts are rendered correctly
* Add test to ensure fees are shown correctly
* Add test to check coupon entry form isn't present when coupons disabled
* Add more mock data to useStoreCart
* Mock useShippingDataContext
* Rename useStoreCartValue to useStoreCartReturnValue
* Remove unnecessary coupon button test
This should be tested within the TotalsCoupon component
* Add tests for shipping presence
* Add test for coupons
* Remove cart items fixtures
These are no longer needed
* Move the findByText utils to the utils folder
* Move inner blocks test to correct directory
* Add block title to AbstractBlock class
* Add block title to Checkout block
* Include all block.json files in tsconfig
* Add get_block_title method to Checkout.php
* Remove redundant block_title field
* Add block.json and remove static attributes from attributes.ts
* Register block using attributes from block.json
* Add metadata_path to AbstractBlock
* Add function to AssetsApi to get the metadata path from the plugin root
* Register the block using metadata if it's set in the block's class
* Remove get_block_title method
* Only add supports and attributes to the block when not registering with metadata
* Change get_block_metadata to get_block_metadata_path
* Change indentation to tabs in block.json
* Update comment to clarify why attributes and supports are set later
* Check if path to metadata is not empty instead of set and not empty
* Move checkout block out of cart-checkout directory
* Update get_block_metadata_path function to find block.json automatically
* Remove metadata path from AbstractBlock
* Check if there's a metadata file and register blocks with metadata if so
* Move deprecated attributes out of metadata and into attributes.ts
* Re-add deprecated attributes to checkout index
* Move order notes test
* Move test for checkout phone number in edito
* Fix indentation in checkout/block.json
* Move checkout terms tests
* Try forcing storefront theme in e2e tests
* Revert "Try forcing storefront theme in e2e tests"
This reverts commit 5b0fd47a2c39aadb0141a4ed28cbc0e6baa89625.
* Try capturing screenshot on test failures
* Try uploading error in try catch
* Try uploading artefacts on error
* Test uploading artefacts
* Screenshot just before looking for edit post layout
* Revert "Screenshot just before looking for edit post layout"
This reverts commit 61dff027789ce13a0d84e7b6f11e431637c5a450.
* Revert "Test uploading artefacts"
This reverts commit adf5cc55bcdb677f889bf5a62803b4150d98e665.
* Revert "Try uploading artefacts on error"
This reverts commit 7441a832a113a95fef89cc1b8db6dc79271be516.
* Revert "Try uploading error in try catch"
This reverts commit ca412ce505d56286b164f588a201a451f6bceeb6.
* Revert "Try capturing screenshot on test failures"
This reverts commit 0de6e97df19b116091a7bb3b8652713867d2d80f.
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Install @wordpress/block-editor package
* Add test for checkout terms frontend block
* Add tests for checkout terms in editor
* Add tests for Checkout Terms in editor
* Use void 0 as function's return type
* Update tests to use toBeInTheDocument and split checkbox test in two
* Use void 0 for empty function
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* move hooks in a specific folder
* fix crash on WP 5.8
* Featured Category block: Add support for global style woocommerce/woocommerce-blocks#4965
Featured Category block: Add support for global style
* fix border color
* fix opacity
* fix border radius
* fix order rules css