* 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>
* Account for products without variations in the prime_product_variations function
* Update src/BlockTypes/AbstractProductGrid.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Fix whitespace
* Remove unnecessary variable declaration
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Gutenberg 12.1.0 has changed the convention for the directory paths from
`block-templates` and `block-template-parts` to `templates` and `parts` respectively.
Allow compatibility with themes which follow both conventions and also make sure that
we remain backwards-compatible.
Fixeswoocommerce/woocommerce-blocks#5450
Some of this fix has a dependency on WooCore
See: WooCommerce/woocommercewoocommerce/woocommerce-blocks#31522
* Fix custom templates with fallback being incorrectly attributed
Category and tags templates can fallback to the generic archive if, e.g., the theme
provides one for the latter but not for the former. However, since Gutenberg is not
aware of this fallback mechanism, it would incorrectly attribute the custom template
to the user instead of the theme.
Here we are explicitly setting the `has_theme_file` to make sure Gutenberg knows
we do, in fact, have a theme fail (if not what it expects).
Also skip the loop if template is duplicate but has no fallback
Fixeswoocommerce/woocommerce-blocks#5441
* Add clear and fill input test util
* Add tests for Filter Products by Price
* Add class name to filter products by price block in editor
* Update wp-env
* Fix formatting
* Update lock
* Revert "Update lock"
This reverts commit f4e809e000430eea3972c94fd2aea0a19ba6961b.
* Create product attributes during setup
* Remove product attributes during teardown
* Add attributes in fixture-data
* Add two new products, for attribute testing
* Load attributes into store and apply them to products
* Add class to Filter by Attribute when editing
This is so it can be targeted in E2E tests more easily.
* Add tests for Filter Product by Attribute
* Fix formatting in attribute-filter.test.js
* Add tests for active filters block
* Add doc block for ensuteCleanAttributes
* Update wording of title test in all filter block E2E
* Update test wording to read better
* Update snapshots
* Use pptr-testing-library selectors to click elements
This makes the tests easier to reason with, and lets us take a step back from the implementation details (classnames etc.)
* Add saveOrPublish test util
* Use pptr-testing-library selectors to click elements in attribute filter
* Use pptr-testing-library selectors to click elements in price filter
* Add `puppeteer-testing-library`
* Use puppeteer-testing-library API to look for H6 button
* Use correct argument in jest-puppeteer.dev.config
* Update package.json & package-lock.json
* remove tests for 5.3
* remove snapshots
* Remove ensureCleanAttributes
* Remove puppeteer-testing-library, install missing expect-puppeteer package and update tests
The puppeteer-testing-library, although added by gutenberg is not actively used.
I have removed it and realised that the added functionality can be easily replaced by expect-puppeteer.
This is a package that we specify in the jest configuration but it was not part of our package.json.
The selectors from puppeteer-testing-library have been replaced with .toClick and the utility clearAndFillInput with .toFill
The Filter by Attribute block has been skiped until tests are fixed.
* Add back setupPageSettings to jest setup
* Fix filter by attribute block test
* Fix linting error
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
* Add isCheckout prop to NoShippingPlaceholder and TotalsShipping
* Pass isCheckout to TotalsShipping in Checkout sidebar
* Show the NoShippingPlaceholder if no rates are found
* Show better error message when no shipping is available in checkout
* Remove Storybook knobs
They are now fully replaced by controls
* Update Storybook to 6.4.9
* Add Storybook documentation and VSCode snippets
* Add VSCode snippets
* Convert stories from checkout packages and include them in Storybook
* Empty commit for release pull request
* Add changelog and version info
* 6.6.0 testing notes
* Remove mini cart from testing instructions
* Clarify testing instructions
* Remove experimental feature from changelog
* fix not found template for the template editor
* update zip
* Remove test instructions for icon
* Testing steps for 5425
* Link order controller to cart routes
* Remove order controller from checkout route
* Fix PHP warnings in abstract schema
* Fix PHP warnings in abstract route
* Update shipping phone handling
* Includes are handled in core now
* Remove maybe_update_order_from_customer
* Add cart_updated routine to all cart routes
* Remove abstract method
* Remove test for woocommerce_blocks_cart_update_order_from_customer_request
* Remove do_order_callback
* Update readme
* Update tests
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Luigi <gigitux@gmail.com>
* Link order controller to cart routes
* Remove order controller from checkout route
* Fix PHP warnings in abstract schema
* Fix PHP warnings in abstract route
* Update shipping phone handling
* Includes are handled in core now
* Remove maybe_update_order_from_customer
* Add cart_updated routine to all cart routes
* Remove abstract method
* Remove test for woocommerce_blocks_cart_update_order_from_customer_request
* Remove do_order_callback
* Add archive-product template into block template hieachy
* Add archive-product condition to product tag block template render method
* Move taxonomy hierarchy filter to WC core
* Undo template amends
* Duplicate the themes archive-product template if it has one for taxonomy block templates
* Review feedback
* Use TextDomain instead of Name
* use correct if/else syntax
* Remove unncessary boolean syntax
* Add full documentation to the component props in Storybook
* Fix `FormattedMonetaryAmount` TypeScript errors
Since this component is passing on props to `NumberFormat`,
it needs to extend all of its original props, except for `onValueChange`
which we wrap in order to accept only `number`s.
* Convert `constrainRangeSliderValues` to TypeScript
* Add docs to `Currency` types
* Convert `PriceSlider` to TypeScript
*Note:* All TypeScript errors were fixed during the conversion,
except for the IE workaround which wasn't clear to me at this time.
Opened an issue: woocommerce/woocommerce-blocks#5276
* Fix Price Slider story (https://github.com/woocommerce/woocommerce-blocks/pull/5253)
* Migrate stories for `ProductName` to latest Storybook
Also add props documentation and add named export.
* Migrate stories for `ProductName` to latest Storybook. Also add props
documentation and add named export.
* Migrate `TotalsFooterItem` to TypeScript and latest Storybook
* Add a `LooselyMustHave` utility type.
* Export `allSettings` so that they can be manipulated in stories and tests
* Implement a way to easily define and reuse Storybook controls
Implement a currency control for a common use-case of selecting currencies.
It currently implements EUR and USD as they have different properties.
* Migrate `TotalsDiscount` to TypeScript and implement stories
* Migrate `TotalsCoupon` to TypeScript and fix stories
* Change Coupon name within Storybook
* Nicer handling of removal of a coupon from Storybook
It now dynamically calculates the discount from the actual coupons.