From ab11b20c4daaca53314b05358d46a3295b6acbaa Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Thu, 14 Mar 2024 18:50:40 +0100 Subject: [PATCH 1/3] CYS - Core: fix Product Rating block renders --- .../assembler-hub/block-editor-container.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor-container.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor-container.tsx index 31896e0e27b5..8010a0c754a3 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor-container.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor-container.tsx @@ -16,6 +16,8 @@ import { useQuery } from '@woocommerce/navigation'; // @ts-expect-error No types for this exist yet. import useSiteEditorSettings from '@wordpress/edit-site/build-module/components/block-editor/use-site-editor-settings'; import { useCallback, useContext, useMemo } from '@wordpress/element'; +// @ts-expect-error No types for this exist yet. +import { store as editSiteStore } from '@wordpress/edit-site/build-module/store'; /** * Internal dependencies @@ -78,8 +80,16 @@ export const BlockEditorContainer = () => { [] ); + const { templateType } = useSelect( ( select ) => { + const { getEditedPostType } = unlock( select( editSiteStore ) ); + + return { + templateType: getEditedPostType(), + }; + }, [] ); + const [ blocks, , onChange ] = useEditorBlocks( - 'wp_template', + templateType, currentTemplate?.id ?? '' ); From a9c6410ad622f4cb750e3f158d59d37c45242aac Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Thu, 14 Mar 2024 19:01:44 +0100 Subject: [PATCH 2/3] add comment --- .../customize-store/assembler-hub/block-editor-container.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor-container.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor-container.tsx index 8010a0c754a3..6914b99416bd 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor-container.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor-container.tsx @@ -80,6 +80,8 @@ export const BlockEditorContainer = () => { [] ); + // This is necessary to avoid this issue: https://github.com/woocommerce/woocommerce/issues/45593 + // Related PR: https://github.com/woocommerce/woocommerce/pull/45600 const { templateType } = useSelect( ( select ) => { const { getEditedPostType } = unlock( select( editSiteStore ) ); From bcadab4b8f0fa3f9e1b971e35c45385ef333027d Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Mar 2024 18:07:16 +0000 Subject: [PATCH 3/3] Add changefile(s) from automation for the following project(s): woocommerce --- ...45600-45593-cys-on-core-product-rating-block-not-rendering | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/woocommerce/changelog/45600-45593-cys-on-core-product-rating-block-not-rendering diff --git a/plugins/woocommerce/changelog/45600-45593-cys-on-core-product-rating-block-not-rendering b/plugins/woocommerce/changelog/45600-45593-cys-on-core-product-rating-block-not-rendering new file mode 100644 index 000000000000..27392a715984 --- /dev/null +++ b/plugins/woocommerce/changelog/45600-45593-cys-on-core-product-rating-block-not-rendering @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +CYS - Core: fix Product Rating block renders \ No newline at end of file