* Remove X- Prefixes from custom headers
* Fix docs
* Handle deprecated X-WC-Store-API-Nonce header if received
* Send old nonce until future version removes this
* Add todo and cut off date
* wc_deprecated_argument
* Update todo name
* typo
* Back compat in batch
* Flip Nonce logic to make it easier to support both in client bw compat logic
* Remove not used attributes woocommerce/woocommerce-blocks#5952
remove not used attributes
* remove not necessary jsdoc comments
Co-authored-by: Tomasz Tunik <tomasztunik@gmail.com>
* Remove expected warnings from test suite
* Switch dispatch and select usage to `controls`, from `@wordpress/data`
* Wrap render with act
* resolveSelect to wait for resolution
* resolveSelect
* Change atomic blocks to not use custom webpack build paths
we want to always load lazy loaded components from their default paths
to avoid having to handle importing components in different ways for
regular and atomic component packages
* Add footer parts to test themes
The Site Editor is expecting the footer parts to be there or it will try to
load them anyways and throw a 404. It's not breaking, but it's polluting
the console.
* Use REST API to tear down the templates
Previously, we used a util called `trashAllPosts` which navigated to the post UI
and deleted all the posts to tear down any side-effects of template editing tests.
However, with a [recent change](14e20f72b5),
WP Core removed the UI for those and that made our tests meet a 500 error.
Using the REST API should also make everything faster.
* Remove deprecated pupeteer waitFor usage
was still present in attribute-filter.test.js
* Update package-lock.json
* pin package versions
* Unify all atomic blocks to register on php side
* Remove Atomic Blcoks chunk_translation handling from AllBlocks
Before it was responsible for enabling translations for all the atomic blocks
* Add per atomic block chunk_translation registration
* update @wordpress/e2e-test-utils to 6.0.2
* add optional puppeteer
* pin workflows node version to 16.13.2
* upgrade package-lock
* upgrade package-lock
* set react and react-dom as peerDeps
* remove atomic block registration
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Luigi <gigitux@gmail.com>
* Refactor e2e tests slightly for better efficiency
* Add "proceedToCheckout" shopper method & refactor code
* Use "beforeEach" in case we add more test cases
I've kept the "afterAll" function to reset any side effects at the end
of this file's tests
* Use "beforeEach" in "checkout-place-order-as-guest" file
* Use BASE_URL in shopper.block.goToBlockPage
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Tax is displayed correctly e2e test
* Add extra utils to shopper
* add single e2e test script oin package.json
* Feedback changes from Niels
* Test tax is correct on summary page
* Check if CI test passes
* Longer timeout for tax test
* change timeout in jest config
* increate jest timeout
* Test
* Test
* Test
* setTimeout outside of tests to 120000
* Address raluca's feedback and timeout everywheregaa
* Increase timeout on for search box
* set jest timeout to 120000
* Raluca's suggestions
* Debug
* Increase search timeout to 5000
* Only run Tax e2e tests in CI for quicker debug - REMOVE THIS
* use waitforSelector
* 30s delay for toMatchElement
* Let'shope this works
* Remove toMatchElement
* waitForSelector
* Run debug test only
* Debug tax test
* debug taxes
* shopper using toMatchElement again
* Remove the 30000 timeout delay from toMatchElement
* Run all tests but only once
* Remove tax test
* Revert "Remove tax test"
This reverts commit 7db34120e1e91f4fd26514fdb9525cac2a6066bb.
* Delete the minicart test
* Revert "Revert "Remove tax test""
This reverts commit 31dd654e52f37fcd02ccd25336958248bef495c6.
* Revert "Delete the minicart test"
This reverts commit 5595f0834a975d097a300bc0c7cbf643caa8b764.
* tax test
* block addToCart
* Put back block functions
* Refactor block.addToCart
* mini-cart e2e test uses shopper.block.emptyCart()
* only run shopper tests in CI
* Run frontend and shopper tests and change waitFor -> waitForTimeout
* Run frontend tests in CI
* Run CI e2e tests again
* Skip legacy template blocks
* Skip legacy template test but run all others
* Switch to storefront instead of twentytwentyone after legacy-template-blocks tests finish
* Tidy up
* fix typo
* Fix ESLint issue
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Add "goToCheckout" method in "shopper.block"
Instead of using "shopper.goToCheckoutBlock" method, it will much easier
to maintain the following structure "shopper.block.goToCheckout"
* Create a constant for billing details
* Create "fillBillingDetails" shopper method
* Add "placeOrder" method to "shopper"
* Enable "Cash on delivery" payment method for our test
* Update "@woocommerce/e2e-utils" package
Some new useful e2e utility functions weren't avaiable in the previous version
* Add E2E test for "Can place an order as guest"
* Fix mini-cart failing E2E tests
In case this fixwoocommerce/woocommerce-blocks#6006 isn't merged yet, this commit can be used to pass all
E2E tests
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Add feature gate for the global styles for Product Sale Badge block woocommerce/woocommerce-blocks#6007
Add feature gate for the global styles for Product Sale Badge block
* add a check for the spacing support
* Hide Mini Cart Block on cart and checkout page woocommerce/woocommerce-blocks#5931
hide Mini Cart Block on cart and checkout page
* instead to not render nothing, use visibility hidden
* install ndb as a development dependency
* Add "debug" script to package.json to launch "ndb"
* Create a minimal test example
This test file is used as an example, we will add later a script in
package.json to call only this file
* Create a temporary npm script to run it from "ndb"
We want to be able to run only a selected file using "ndb", so we need to
create an npm script for it
* Clean up test file
* Clean up & ready PR to merge
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Shopper → Cart → Can proceed to checkout
* Refactor the code for E2E testing
Introduce some discussed solution to structure and optimize the code
* Resolve some conflicts with the trunk branch
* Remove method overriding and refactor code
We are trying to avoid overriding exiting E2E Woo's utility functions
Instead we can use our own "shopper.block"
* Use a consistent constant naming convention
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Add address-related items to wc/store/cart data store
* Add useUpdateCustomerData hook
This allows us to have a single hook responsible for updating the customer information on the server.
* Add useUpdateCustomerData hook in Checkout block
* Remove shippingAsBilling from previousCustomerData ref type
* Add useShippingAsBillingCheckbox hook
* Remove checkbox handling from useCheckoutAddress
* Merge with woocommerce/woocommerce-blocks#5810 changes
* Move shipping as billing to checkout state context provider
* Subscribe to changes
* Cache customerDataToUpdate
* Combine customerDataType and customerDataContextType
* Fix notice context
* Clean up inline docs for push changes
* Add useShippingData hook
* Add shipping related selectors to cart store
* Update useShippingDataContext to useCustomerData hook
* Update uses of useShippingDataContext to get data from hook instead
* Remove rogue linebreak
* Re-add linebreak
* Re-add linebreak, remove shippingAsBilling
* Re-add linebreak
* Use useShippingData and useCustomerData instead of context
* Fix fromEntriesPolyfill to use number or undefined as an index option
* Convert derive-selected-shipping-rates to TS
* Add SelectShippingRateType
* Get needsShipping from new hook and not context
* Get address data from useCustomerData instead of useShippingDataContext
* Move selectedRates, selectShippingRate and isSelectingRate
* Remove items from ShippingDatacontext that are available in data stores
* Get shipping data from stores, not context in payment method interface
* Consider shipping rates to be loading if customer data is updating
* Get rates from useShippingData hook instead of context
* Fix incorrect TypeScript types and incorrectly named destructure
* Move useShippingData into shipping folder
* Update tests to mock useShippingData instead of context
* Remove empty string fallback from shipping phone
* Get types from Cart declaration instead of Picking them
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Add memoized/cached filter runs
* Add function to check equality of object's members
* Add function to check equality of arg and extensions vs prev values for a filter name
* Memoize/Cache values of previously run filters
* Add docs and null check to shallow equality check
* Update packages/checkout/filter-registry/index.ts
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
This PR adds a block-enabled theme with templates for WooCommerce
which is intended to be used when testing the more complex scenarios
such as template fallbacks.
Additionally, since theme-dependent logic seems to be becoming more
and more useful (see woocommerce/woocommerce-blocks#5913), this PR also adds a utility function used to
explicitly declare theme dependencies of a test (`useTheme`).
Said function will activate the theme before running a given suite and then
reactivate the previous theme, as to make sure to not have any side-effects
(such as the ones described in woocommerce/woocommerce-blocks#5913 above).
Closeswoocommerce/woocommerce-blocks#5660
* Avoid calling plugin_dir_url a lot
* Fix crash if woocommerce admin is disabled
With Woocommerce's PR
https://github.com/woocommerce/woocommerce/pull/31991 applied, if
woocommerce admin is disabled via the woocommerce_admin_disabled
filter, the InboxNotifications block could crash.
* Fix coding style
* Simplify code path
* Remove unused initialization
* Introduce 'wooocommerce_store_api_validate_cart' action
This action can be used by third party developers to add extra 'errors' in cart route responses. This is meant to function as a replacement of the legacy 'woocommerce_check_cart_items' hook.
* Introduce a new 'wooocommerce_blocks_draft_order_updated' action
The new action can be used to modify the finalized draft order object.
Additionally, developers can use it to throw a RouteException in order to prevent access to the checkout block.
The PR also shuffles some existing code that checks the order instance and sets the draft order ID before the 'woocommerce_blocks_checkout_update_order_meta' gets fired.
* Fix PHPCS
* Revert changes to Checkout route
* Add some extra content to the 'woocommerce_blocks_checkout_update_order_meta' docblock on the effect of exceptions thrown from callbacks
* Add __experimental prefix to 'wooocommerce_store_api_validate_cart' action
* Remove long ooo
* Add example
* Refactor cart error getters as wrappers to the validate functions
* Refactor stock_exceptions_to_wp_errors to return a single wp error.
* Add type hint in custom exception
* Fix namespace versioning and some minor improvements
* Move InvalidCartException catcher from AbstractCartRoute to AbstractRoute
* Introduce the __experimental_woocommerce_store_api_cart_errors filter
* Handle all notices and group them into a single WP_Error instance
* Cleanup doc and update example
* Cleanup NoticeHandler
* Fix doc
* Fix WP_Error namespace
* Update NoticeHandler unit tests
* Fix Unit tests typo
* Add docs to tests to bypass precommit scripts
* Refactor wp error grouping with merge_from
* Remove previous cart getters and refactor the get_cart_errors
* Fix CartSchema error getter and minor fixes
* Revert NoticeHandler exception namespace
* Unit test fix for get_cart_errors
* Switch back to do_action
* Update the example doc
* Duplicate use statement
* Update docblock in validate_cart() method for validation hooks
* Update action docs
* Remove __experimental prefix
Co-authored-by: Manos Psychogyiopoulos <psyx@somewherewarm.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* templates README and block-template-controller README
* Add execution scenario to block template controller readme
* Amend return value to block template controller readme
* Add source file link to block template controller docs
* LegacyTemplate.php overview
* Legacy Template JavaScript block README
* Update requirements of templates feature
* Doc updates based on feedback, and change Legacy Template references to Classic Template in anticipation of naming convention updates
* Update classic-template.md README
* Reword part of the add_block_templates section
* Update assets/js/blocks/legacy-template/README.md
Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
* Update docs/readme.md
Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
* Update docs/templates/README.md
Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
* Update docs/templates/README.md
Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
* Update README for blocktemplatecontroller
* Review feedback for Woo FSE technical documentation
Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
* Empty commit for release pull request
* Add Changelog to readme.txt
* Update allow-plugins list as release build doesnt work otherwise
* Add testing instructions
* Update testing instructions
* Update version number in README.md
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
* Add phpcodesniffer to Composer allow-plugins
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Michael P. Pfeiffer <michael@cssconf.eu>
Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
* Add margin support on the Product Image block woocommerce/woocommerce-blocks#5671
Add margin support on the Product Image block
* fix tests
* more specific selector
* update mixin
* Add Global Styles support to product price block
- This comes sat a cost of losing control over regular vs sale price
- This includes refactor of attribute from align to textAlign
which is a reserved supports feature attribute and textAlign is
used across the Gutenberg project
* Add experimentalSelector and register as PHP block
This is required to make the GlobalStyles work inside of
the InnerContent block. Ie. All Products block.
* move sharedConfig supports outside of isFeaturePluginBuild check
* restore regularPriceClassName
* remove douplicated block registration on php side
* Add constants for C & C pages in our E2E tests
Inspired by WC E2E this will avoid going to admin to find out the links for these pages.
* Select C & C pages by using the main navigation links
* Fix function calls
* Revert back to using constants for C & C block pages' URLs
reverts 9587a0bd5efa5d97b484cd8d1bf927ff50f8e014 and bd7e2f996792d887756c0a0f4a10e6886574e77b
* Revise Storybook entries for Checkout Blocks/totals components
Revise Storybook entries for Checkout Blocks/totals components
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* Fix a typo in the Item label value
* set disable value for description and disable control for 'showRateAfterTaxName' prop
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* Add Global Styles support for the Add To Cart Button block woocommerce/woocommerce-blocks#5666
Add Global Styles support for the Add To Cart Button block
* remove support to font size
* try: fix the style override issue for add to cart button (https://github.com/woocommerce/woocommerce-blocks/pull/5843)
* restore typography support
* fix font weight
* add support for font weight
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Ensure screenshots can be attached in jest html report
* Force tests to fail in ci
* Console log for testing
* Console log for testing
* Check on hook failure as well as test failure
* Revert "Force tests to fail in ci"
This reverts commit 6efebd63bba4792214f5b24824fb405cf38b1367.
* Take full page screenshot only when error type is not hook_failure
* Remove console log
* adds toolbar option to remove custom image
removing custom image will reset it back to the default
product image if available
* update copy as per discussion
went with just Reset as it is commonly used in WordPress
and will have translation available
* Add address-related items to wc/store/cart data store
* include shippingAsBilling in return value of useCustomerData
* Add useUpdateCustomerData hook
This allows us to have a single hook responsible for updating the customer information on the server.
* Add useUpdateCustomerData hook in Checkout block
* Remove the updating customer data work from the useCustomerData hook
* Remove shippingAsBilling from previousCustomerData ref type
* Add useShippingAsBillingCheckbox hook
* Control shippingAsBilling from single hook
* Remove checkbox handling from useCheckoutAddress
* Remove CustomerDataContext typedef
* Merge with woocommerce/woocommerce-blocks#5810 changes
* Move shipping as billing to checkout state context provider
* Unused import
* Subscribe to changes
* Only receiveCartContents when updating customer data via checkout
* Cache customerDataToUpdate
* rename debounced function
* Combine customerDataType and customerDataContextType
* Change case of CustomerDataType
* debouncedUpdateCustomerData typo
* Fix notice context
* Clean up inline docs for push changes
* Comment on dirty state
* Phone is always set
* shippingAddress is never undefined
* setBillingPhone
* receiveCartContents explanation
* Tweak customerData to avoid null
* useShippingAsBilling
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* fix Global Styles for Product Image, Product Category List and Product Tag List blocks
fix Global Styles for Product Image, Product Category List and Product Tag List blocks
* Block style font-size was applying wrong value for fontSize
* Add missing __experimentalSkipSerialization to Category List
Co-authored-by: Tomasz Tunik <tomasztunik@gmail.com>
* Pass context information about containing block to the existing Slots
* Fix images added to the Slots docs
* Use the parent's block name for the context prop passed to Slot fills
Also:
* Refactors the function to add a custom paragraph
* Add front-end test for archive template
* Use WordPress data to guarantee block presence
* Use WordPress data instead of selectors to match blocks
* Add wc-block-mini-cart__contents class for the Mini Cart block woocommerce/woocommerce-blocks#5418
Add wc-block-mini-cart__contents class for the Mini Cart block
* removed comment
* Fix All Products block pagination not showing up (https://github.com/woocommerce/woocommerce-blocks/pull/5850)
* Fix regression for Twenty Twenty-Two theme with sale prices being underlined (https://github.com/woocommerce/woocommerce-blocks/pull/5851)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tomasz Tunik <tomasztunik@gmail.com>
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* Rating Product block: add support for global style woocommerce/woocommerce-blocks#4965
Rating Product block: add support for global style
* add feature flag
* fix import after merge
* fix global style css generation
* restore css for classic product rating html element
* don't apply the global style to PHP blocks
* remove registration
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* move hooks in a specific folder
* Tag List block: add support for global style woocommerce/woocommerce-blocks#4965
Tag List Block: add support for global style
* add feature flag
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* Enable global style for category list block woocommerce/woocommerce-blocks#4965
Enable global style for category list block
* fix import after merge
* add save function
* add feature flag
* Refactor maybe_return_blocks_template to get_woocommerce_block_file_template
* Remove unused method and rename get_woocommerce_block_file_template to get_block_file_template
* Account for product-archive template fallbacks
* Fix bug with clearing customizations of templates using the deprecated plugin ID
* Convert radio component to TS and support uncontrolled components
* Further radio control to typescript changes
* Combine useSelectShippingRate and useSelectShippingRates
* Remove useSelectShippingRate hook
* Move local radio checked state to PackageRates
* This is a Controlled component - update inline docs
* useSelectShippingRates -> useSelectShippingRate rename
* Add the correct appender button for non empty groups
* Revert "Add the correct appender button for non empty groups"
This reverts commit 4b41d7d7f82461813b3464d1b4f931c442bce3be.
* Force position relative for custom InnerBlocks.ButtonBlockAppender appenders.
Removing InnerBlocks.ButtonBlockAppender from renderAppender = {InnerBlocks.ButtonBlockAppender } results in the black appender button beeing shown only when the block is selected, and we need the appender to be visible by default.
* Remove api hydration for the Mini Cart Block woocommerce/woocommerce-blocks#5729
Remove api hydration for the Mini Cart Block
* fix PHP error
* send event when the button is clicked
* fix import order
* Add hover & focus styles for component buttons
We are using an old version of the "@wordpress/component" package,
that's why we are not getting the latest style fixes from Gutenberg.
The reason to not using the latest version is that we had some issues
with the bundle size.
The current solution is to set our own focus & hover styles
* Replace raw value with Sass variable
* Fix hover style for the mini cart block
We don't have the outlined button yet. This styles is unique for the
mini cart button.
To refactor this code, maybe we should create a reusable outlined button
* Add variant to the Woo Block Button component
To refactor our code, adding a "variant" prop looks logical since we are
have already "contained" & "outlined" buttons. So, for future need for an
outlined button, no need to manually apply the same style again.
The "contained" variant is set by default for legacy reasons. Our Button
component was first built as a contained one.
* Fix height difference: oulined & contained buttons
The outlined buttons have more height because of the added border value.
To fix it we can replace the border with the inner shadow.
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* 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
* Prevent third party blocks from breaking the entire checkout block
* Fixed types and block error boundary around forced blocks
* Move InnerBlocksComponentWrapper and remove extra }
* Allow HTML nodes to be rendered in the component tree, not just eleents
* Empty commit for release pull request
* Update readme.txt with 6.8.0 changelog
* initialize_session if it does not yet exist before calling the session class (https://github.com/woocommerce/woocommerce-blocks/pull/5577)
* Add testing notes for 6.8.0
* update testing release notes
* update testing notes
* Fix default `stockStatusOptions` in tag and attribute blocks (https://github.com/woocommerce/woocommerce-blocks/pull/5590)
* Fix default stockStatusOptions in tag and attribute blocks
These should be an array of keys, not objects.
* Fix stockStatus definition on PHP side
* Swap state to debounce.
* Improve presentation of stock filters
* Remove state usage for display options
* Remove debounce
* Consistent panel titles
* Fix global style for Product Summary block, Product Stock Indicator block, and Product Title block (https://github.com/woocommerce/woocommerce-blocks/pull/5595)
* Fix global style for Product Summary block, Product Stock Indicator block, and ProductTitle block
Fix global style for Product Summary block, Product Stock Indicator block, and ProductTitle block
* add feature flag
* fix lint errors
* fix global style bugs on Product Title block
* update testing release notes
* update new build with fixes
* Restore correct font style when the block is loaded in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/5600)
* Restore correct font style when the block is loaded in the editor
Restore correct font style when the block is loaded in the editor
* fix style on Twenty Twenty theme
* update link for download the zip of the new release
* update readme.txt
* 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: Mike Jolley <mike.jolley@me.com>
* Reset redirectUrl to blank if not included in response.
* Force redirect URL for successful responses
* Revert "Force redirect URL for successful responses"
This reverts commit 61aae8b459843237b5428be8fa0cdb9500cd0485.
* Restore correct font style when the block is loaded in the editor
Restore correct font style when the block is loaded in the editor
* fix style on Twenty Twenty theme
* Fix global style for Product Summary block, Product Stock Indicator block, and ProductTitle block
Fix global style for Product Summary block, Product Stock Indicator block, and ProductTitle block
* add feature flag
* fix lint errors
* fix global style bugs on Product Title block
* Fix default stockStatusOptions in tag and attribute blocks
These should be an array of keys, not objects.
* Fix stockStatus definition on PHP side
* Swap state to debounce.
* Improve presentation of stock filters
* Remove state usage for display options
* Remove debounce
* Consistent panel titles
* Set attribute of legacy template block when block is inserted
* Allow inserter on Woo templates only
* Allow correct legacy block straight from the inserter
* Use WP Data store outside component to register block
* Pass in all attribute data when registering block
* Accommodate templates targetted at specific products or taxonomies
* Replace beginsWith with startsWith
* Replace test data with production data
* Conditionally use stores selector if it exists
* Unsubscribe if the store does not exist
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* Stock indicator block: add support for global style woocommerce/woocommerce-blocks#4965
Stock indicator block: add support for global style
* fix import after merge
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* Summary Product block: add support for global style woocommerce/woocommerce-blocks#4965
Summary Product block: add support for global style
* add color global style under feature flag
* fix import after merge
* fix typo
* add min and step to Store API
* add min and step support
* typo
* Update assets/js/base/components/quantity-selector/index.tsx
* Update assets/js/base/components/quantity-selector/index.tsx
* Fix debounce callback
* Style qty input to show steps
* Implement quantity_limits in API
* Quantity validation
* Update product API
* Normalize on + -
* Separate add to cart events from cart item events in regards to limits
* Prevent qty change for editable line items
* Unify filters
* Remove step number indicator from buttons ¯\_(ツ)_/¯
* Normalize on mount
* Update docs
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Force a string token property for the activePaymentMethod
* Empty commit for release pull request
* Update readme.txt with 6.7.1 info
* Add testing notes for 6.7.1
* Bumping version strings to new version.
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
* Update release initial checklist template
This PR includes more information about updating the Woo Blocks version in the WooCommerce repository:
- it updates the PR used as an example
- it updates the url for the composer.json file in WC repo
- it add info about how to update the composer.json and lock files
* Update .github/release-initial-checklist.md
* add align wide and full support for legacy template block
* fix PHP warning
* add a comment on get_markup_with_classes_by_attributes
* rename function
* add align wide and full support for legacy template block
* fix PHP warning
* add a comment on get_markup_with_classes_by_attributes
* rename function
* fix regex
* update regex
* update regex
* fix code styling
* Don't allow to insert negative values on input for Filter Products By Price block woocommerce/woocommerce-blocks#2695
Don't allow to insert negative values on input for Filter Products By Price block
* renaming util functions and add comments
* Align Woo Block template locations with the newest convention
While we now support both the old and new conventions for the templates
paths, our own repo should be aligned with the latest convention.
See: woocommerce/woocommerce-blocks#5455Fixes: woocommerce/woocommerce-blocks#5343
* Simplify `generate_template_slug_from_path` function
* Change `BlockTemplatesController` constructor to get correct dir names
* Update Mini Cart template path
Legacy blocks were previous locked for removal to avoid unintended
consequences. However, this would lock the ability to move the block within
other e.g. layout blocks and unnecessarily limit merchant customization ability.
Now that we have reverted this decision, merchants could delete this block,
which is likely **not** what they want to do. While we investigate other, more
long-term, solutions, we are adding a warning notice.
Refs woocommerce/woocommerce-blocks#5180. Fixeswoocommerce/woocommerce-blocks#5207.
* Rename legacy blocks to avoid confusion with the term “Template”
* Fix duplicated error notices
StoreNoticeProvider is already being used within Block component. This
removal prevents duplicated error notices within the Payment Options
section
* Move StoreNoticeProvider from payment block
Remove StoreNoticeProvider from payment block and move it to the parent
frontend block to avoid unnecessarily loading the notice provider
* Update wp-hooks-generator
* Update inline hook documentation into consistent format
1. Hook docs for the same hook should be identical
2. Prefix with `Hook: ` so the case of the hook is not changed.
3. Use `@see` instead of `@hooked`. Hooked is not a standard PHP Doc tag.
cc @Aljullu
* Update hook doc script to support duplicate hooks across files
* Remove unused variables in function
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Empty commit for release pull request
* Update readme.txt with 6.7.0 changelog
* Add testing notes for the 6.7.0 release
* Fix typo in testing notes
* Update Testing Notes
* Remove item from testing notes for 6.7.0
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>