woocommerce/plugins/woocommerce-blocks
Manish Menaria bb3f38a3d8
Fix: Product Collection block does not display when editing template/post (#47871)
* Fix issue where Product Collection wasn't showing anything

- Moved queryId logic to a new `useQueryId` custom hook to encapsulate the logic.
- Simplified attribute setting in `useEffect` by using a default attributes value.
- Utilized `fastDeepEqual` to check for attribute equality

These changes fix the issue where the Product Collection block did not display properly in the template editor, ensuring consistent rendering of products.

* Add comment

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Remove leftover comment

* Add e2e tests for Product Collection block visibility after refresh

Added end-to-end tests to verify the visibility of the Product Collection block after page refresh in both Product Archive and Post contexts.

- Added tests to ensure the Product Collection block remains visible after refreshing the template or post editor.
- Updated existing tests to use `BLOCK_LABELS` for better readability and maintainability.

* Improve E2E tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-05-29 16:35:36 +05:30
..
.github clear out unneeded github files from block folder (#44895) 2024-02-29 13:30:56 -04:00
.sources
.vscode
.wordpress-org
assets Fix: Product Collection block does not display when editing template/post (#47871) 2024-05-29 16:35:36 +05:30
bin [Experimental] Product Filters Redesign: Add the Product Filters block (#47294) 2024-05-15 18:09:48 -03:00
changelog clear out unneeded github files from block folder (#44895) 2024-02-29 13:30:56 -04:00
docs Fix typo in some tests and comments: 'blockbased' > 'block-based' (#47851) 2024-05-27 19:21:10 +02:00
packages Change Checkout form step numbering so it can only be toggled for all blocks, not individually per-step (#47479) 2024-05-22 07:03:48 -07:00
patches
storybook Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
tests Fix: Product Collection block does not display when editing template/post (#47871) 2024-05-29 16:35:36 +05:30
.distignore
.editorconfig
.env
.eslintignore
.eslintrc.js Blocks E2E: Streamline E2E utils implementation (#47660) 2024-05-27 14:54:06 +00:00
.gitattributes
.gitignore More block package cleanup (#45256) 2024-03-04 10:27:58 -08:00
.markdownlint.json
.markdownlintignore
.prettierignore
.prettierrc.js
.stylelintrc.json
.wp-env.json Blocks E2E: Streamline E2E utils implementation (#47660) 2024-05-27 14:54:06 +00:00
LICENSE
README.md Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
babel.config.js
composer.json Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
composer.lock Fix Component Project Changelog Checking (#42794) 2023-12-13 15:41:11 -08:00
docker-compose.yml
global.d.ts
package.json [testing workflows] Add workflow_call trigger in CI workflow - support daily and other types of runs (#47612) 2024-05-22 11:04:44 -07:00
phpcs.xml Introduce Additional Fields extensibility API (#42695) 2023-12-15 13:45:38 +01:00
phpunit.xml.dist
postcss.config.js
readme.txt Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
tsconfig.base.json Blocks E2E: Streamline E2E utils implementation (#47660) 2024-05-27 14:54:06 +00:00
tsconfig.json Add a stock filter block powered by the interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/11663) 2023-11-15 16:50:05 +13:00
webpack.config.js Fix: load blocks style separately for classic themes (https://github.com/woocommerce/woocommerce-blocks/pull/10758) 2023-09-08 11:15:48 +07:00
wp-cli.yml

README.md

WooCommerce Blocks

This is the client for WooCommerce + Gutenberg. This package serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the Block Editor.

Table of Contents

Documentation

To find out more about the blocks and how to use them, check out the documentation on WooCommerce.com.

If you want to see what we're working on for future versions, or want to help out, read on.

Code Documentation

  • Blocks - Documentation for specific Blocks.
  • Editor Components - Shared components used in WooCommerce blocks for the editor (Gutenberg) UI.
  • WooCommerce Blocks Handbook - Documentation for designers and developers on how to extend or contribute to blocks, and how internal developers should handle new releases.
  • WooCommerce Blocks Storybook - Contains a list and demo of components used in the plugin.

Getting started with block development

Run through the "Writing Your First Block Type" tutorial for a quick course in block-building.

For deeper dive, try looking at the core blocks code, or see what components are available.

Other useful docs to explore:

Long-term vision

WooCommerce Blocks are the easiest, most flexible way to build your store's user interface and showcase your products.