From 4b8a142a241d96b420caf62f774fe1fee923454e Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Mon, 7 Nov 2022 17:36:33 +0100 Subject: [PATCH 1/3] Fix CartCrossSellsBlock inspector's translation --- .../inner-blocks/cart-cross-sells-block/block.json | 1 + .../inner-blocks/cart-cross-sells-block/index.tsx | 3 +-- src/BlockTypes/Cart.php | 1 + src/BlockTypes/CartCrossSellsBlock.php | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 src/BlockTypes/CartCrossSellsBlock.php diff --git a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-block/block.json b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-block/block.json index 4fd84e1420e..8ddaae21761 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-block/block.json +++ b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-block/block.json @@ -13,5 +13,6 @@ }, "parent": [ "woocommerce/cart-items-block" ], "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2 } diff --git a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-block/index.tsx b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-block/index.tsx index 60630fb161a..8551d3d897b 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-block/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-block/index.tsx @@ -8,9 +8,8 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; -import metadata from './block.json'; -registerBlockType( metadata, { +registerBlockType( 'woocommerce/cart-cross-sells-block', { icon: { src: ( Date: Mon, 7 Nov 2022 17:41:35 +0100 Subject: [PATCH 2/3] Fix CartCrossSellsProductsBlock inspector's translation --- .../cart-cross-sells-products/block.json | 1 + .../cart-cross-sells-products/index.tsx | 3 +-- src/BlockTypes/Cart.php | 1 + src/BlockTypes/CartCrossSellsProductsBlock.php | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 src/BlockTypes/CartCrossSellsProductsBlock.php diff --git a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.json b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.json index f12c4b3abf0..a2dce15c648 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.json +++ b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.json @@ -27,5 +27,6 @@ }, "parent": [ "woocommerce/cart-cross-sells-block" ], "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2 } diff --git a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx index 60630fb161a..552ad127e34 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx @@ -8,9 +8,8 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; -import metadata from './block.json'; -registerBlockType( metadata, { +registerBlockType( 'woocommerce/cart-cross-sells-products-block', { icon: { src: ( Date: Tue, 8 Nov 2022 17:17:48 +0000 Subject: [PATCH 3/3] bot: update checkstyle.xml --- checkstyle.xml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/checkstyle.xml b/checkstyle.xml index 97f819fa1c6..c22f3f5b5ed 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -2381,26 +2381,25 @@ Type '{ icon: { src: Element; }; edit: ({ attributes, }: { attributes: { className: string; }; }) => Element; save: () => Element; }' is missing the following properties from type 'Pick<Block<{ className: string; }>, "title" | "category" | "attributes">': title, category, attributes" source="TS2769" /> - + Argument of type '{ icon: { src: JSX.Element; }; edit: () => JSX.Element; save: () => JSX.Element; }' is not assignable to parameter of type 'BlockConfiguration<{}>'. + Type '{ icon: { src: Element; }; edit: () => Element; save: () => Element; }' is missing the following properties from type 'Pick<Block<{}>, "title" | "category" | "attributes">': title, category, attributes" source="TS2769" /> - + Argument of type '{ icon: { src: JSX.Element; }; edit: ({ attributes, setAttributes }: Props) => JSX.Element; save: () => JSX.Element; }' is not assignable to parameter of type 'BlockConfiguration<{ className?: string; columns: number; }>'. + Type '{ icon: { src: Element; }; edit: ({ attributes, setAttributes }: Props) => Element; save: () => Element; }' is missing the following properties from type 'Pick<Block<{ className?: string; columns: number; }>, "title" | "category" | "attributes">': title, category, attributes" source="TS2769" />