From 1f49f712b55e29abfa0afc6f20de1c0a8a6a7c12 Mon Sep 17 00:00:00 2001 From: Karol Manijak <20098064+kmanijak@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:04:13 +0200 Subject: [PATCH] Unify Product Elements inserter category to "WooCommerce Product Elements" (#46064) * Unify the category for all Product Elements * Add changelog * Bring back category to product elements that don't use shared confiug * Add specific category to some Product Elements blocks registered only for Single Product template --- .../blocks/product-elements/add-to-cart-form/block.json | 4 ++-- .../blocks/product-elements/average-rating/block.json | 2 +- .../js/atomic/blocks/product-elements/button/block.json | 6 ++---- .../blocks/product-elements/product-details/block.json | 2 +- .../product-elements/product-image-gallery/block.json | 2 +- .../atomic/blocks/product-elements/product-meta/block.json | 2 +- .../blocks/product-elements/product-reviews/block.json | 2 +- .../blocks/product-elements/rating-counter/block.json | 2 +- .../atomic/blocks/product-elements/rating-stars/block.json | 2 +- .../js/atomic/blocks/product-elements/rating/block.json | 1 - ...add-change-product-elements-category-to-product-elements | 4 ++++ 11 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 plugins/woocommerce/changelog/add-change-product-elements-category-to-product-elements diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart-form/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart-form/block.json index 438429b8300..7eff52de309 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart-form/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart-form/block.json @@ -3,15 +3,15 @@ "version": "1.0.0", "title": "Add to Cart with Options", "description": "Display a button so the customer can add a product to their cart. Options will also be displayed depending on product type. e.g. quantity, variation.", + "category": "woocommerce-product-elements", "attributes": { "isDescendentOfSingleProductBlock": { "type": "boolean", "default": false } }, - "category": "woocommerce", "keywords": [ "WooCommerce" ], - "usesContext": ["postId"], + "usesContext": [ "postId" ], "textdomain": "woocommerce", "apiVersion": 2, "$schema": "https://schemas.wp.org/trunk/block.json" diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/average-rating/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/average-rating/block.json index 8cc355d80f2..a3785daacac 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/average-rating/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/average-rating/block.json @@ -3,12 +3,12 @@ "version": "1.0.0", "title": "Product Average Rating (Beta)", "description": "Display the average rating of a product", + "category": "woocommerce-product-elements", "attributes": { "textAlign": { "type": "string" } }, - "category": "woocommerce", "keywords": [ "WooCommerce" ], "ancestor": [ "woocommerce/single-product" ], "textdomain": "woocommerce", diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/block.json index 54b851181ec..26a3c2478df 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/block.json @@ -3,7 +3,7 @@ "version": "1.0.0", "title": "Add to Cart Button", "description": "Display a call to action button which either adds the product to the cart, or links to the product page.", - "category": "woocommerce", + "category": "woocommerce-product-elements", "keywords": [ "WooCommerce" ], "usesContext": [ "query", "queryId", "postId" ], "textdomain": "woocommerce", @@ -58,9 +58,7 @@ "label": "Outline" } ], - "viewScript": [ - "wc-product-button-interactivity-frontend" - ], + "viewScript": [ "wc-product-button-interactivity-frontend" ], "apiVersion": 2, "$schema": "https://schemas.wp.org/trunk/block.json" } diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-details/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-details/block.json index 5860df01856..586c17fc76f 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-details/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-details/block.json @@ -4,7 +4,7 @@ "icon": "info", "title": "Product Details", "description": "Display a product's description, attributes, and reviews.", - "category": "woocommerce", + "category": "woocommerce-product-elements", "keywords": [ "WooCommerce" ], "supports": { "align": true, diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-image-gallery/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-image-gallery/block.json index c69250aa500..59f926dd28c 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-image-gallery/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-image-gallery/block.json @@ -4,7 +4,7 @@ "title": "Product Image Gallery", "icon": "gallery", "description": "Display a product's images.", - "category": "woocommerce", + "category": "woocommerce-product-elements", "supports": { "align": true, "multiple": false diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-meta/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-meta/block.json index 2a3c806b780..6ffe742562c 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-meta/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-meta/block.json @@ -4,7 +4,7 @@ "title": "Product Meta", "icon": "product", "description": "Display a product’s SKU, categories, tags, and more.", - "category": "woocommerce", + "category": "woocommerce-product-elements", "supports": { "align": true, "reusable": false diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-reviews/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-reviews/block.json index cc9d95357d2..7a7fe4fb2db 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-reviews/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/product-reviews/block.json @@ -4,7 +4,7 @@ "icon": "admin-comments", "title": "Product Reviews", "description": "A block that shows the reviews for a product.", - "category": "woocommerce", + "category": "woocommerce-product-elements", "keywords": [ "WooCommerce" ], "supports": {}, "attributes": {}, diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating-counter/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating-counter/block.json index 185d88842ac..cc78687bb2f 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating-counter/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating-counter/block.json @@ -3,6 +3,7 @@ "version": "1.0.0", "title": "Product Rating Counter", "description": "Display the review count of a product", + "category": "woocommerce-product-elements", "attributes": { "productId": { "type": "number", @@ -26,7 +27,6 @@ } }, "usesContext": [ "query", "queryId", "postId" ], - "category": "woocommerce", "keywords": [ "WooCommerce" ], "supports": { "align": true diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating-stars/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating-stars/block.json index b1f9177ec0b..829feea7a01 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating-stars/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating-stars/block.json @@ -3,6 +3,7 @@ "version": "1.0.0", "title": "Product Rating Stars", "description": "Display the average rating of a product with stars", + "category": "woocommerce-product-elements", "attributes": { "productId": { "type": "number", @@ -26,7 +27,6 @@ } }, "usesContext": [ "query", "queryId", "postId" ], - "category": "woocommerce", "keywords": [ "WooCommerce" ], "supports": { "align": true diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/block.json b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/block.json index 78496aac4d7..1c91ad42a46 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/block.json +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/block.json @@ -27,7 +27,6 @@ } }, "usesContext": [ "query", "queryId", "postId" ], - "category": "woocommerce", "keywords": [ "WooCommerce" ], "supports": { "align": true diff --git a/plugins/woocommerce/changelog/add-change-product-elements-category-to-product-elements b/plugins/woocommerce/changelog/add-change-product-elements-category-to-product-elements new file mode 100644 index 00000000000..c5be62099d4 --- /dev/null +++ b/plugins/woocommerce/changelog/add-change-product-elements-category-to-product-elements @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Product Elements: unify the Product Elements inserter category