From ca1e65cbef1e11c5c1d8c023fd499230adddb93b Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Fri, 4 Nov 2022 15:53:16 +0100 Subject: [PATCH] Filter by Rating: Remove the Feature Plugin flag (https://github.com/woocommerce/woocommerce-blocks/pull/7580) * Filter by Rating: Remove the Feature Plugin flag --- .../assets/js/blocks/filter-wrapper/index.tsx | 45 ++++++------ .../assets/js/blocks/rating-filter/index.tsx | 69 +++++++++---------- plugins/woocommerce-blocks/checkstyle.xml | 24 +++---- ...ature-flags-and-experimental-interfaces.md | 1 - 4 files changed, 66 insertions(+), 73 deletions(-) diff --git a/plugins/woocommerce-blocks/assets/js/blocks/filter-wrapper/index.tsx b/plugins/woocommerce-blocks/assets/js/blocks/filter-wrapper/index.tsx index 4f105be491c..da3643bc6c3 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/filter-wrapper/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/filter-wrapper/index.tsx @@ -13,7 +13,6 @@ import { box, starEmpty, } from '@wordpress/icons'; -import { isFeaturePluginBuild } from '@woocommerce/block-settings'; /** * Internal dependencies @@ -226,31 +225,29 @@ registerBlockType( metadata, { }, }, { - ...( isFeaturePluginBuild() && { - name: 'rating-filter', - title: __( 'Filter by Rating', 'woo-gutenberg-products-block' ), - description: __( - 'Enable customers to filter the product grid by rating.', + name: 'rating-filter', + title: __( 'Filter by Rating', 'woo-gutenberg-products-block' ), + description: __( + 'Enable customers to filter the product grid by rating.', + 'woo-gutenberg-products-block' + ), + isActive: ( attributes ) => + attributes.filterType === 'rating-filter', + attributes: { + filterType: 'rating-filter', + heading: __( + 'Filter by rating', 'woo-gutenberg-products-block' ), - isActive: ( attributes ) => - attributes.filterType === 'rating-filter', - attributes: { - filterType: 'rating-filter', - heading: __( - 'Filter by rating', - 'woo-gutenberg-products-block' - ), - }, - icon: { - src: ( - - ), - }, - } ), + }, + icon: { + src: ( + + ), + }, }, ], transforms: { diff --git a/plugins/woocommerce-blocks/assets/js/blocks/rating-filter/index.tsx b/plugins/woocommerce-blocks/assets/js/blocks/rating-filter/index.tsx index d499b028481..fff3f9c2684 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/rating-filter/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/rating-filter/index.tsx @@ -1,7 +1,6 @@ /** * External dependencies */ -import { isFeaturePluginBuild } from '@woocommerce/block-settings'; import { registerBlockType } from '@wordpress/blocks'; import { Icon, starEmpty } from '@wordpress/icons'; import classNames from 'classnames'; @@ -14,39 +13,37 @@ import edit from './edit'; import metadata from './block.json'; import type { Attributes } from './types'; -if ( isFeaturePluginBuild() ) { - registerBlockType( metadata, { - icon: { - src: ( - + ), + }, + attributes: { + ...metadata.attributes, + }, + edit, + // Save the props to post content. + save( { attributes }: { attributes: Attributes } ) { + const { className, showCounts } = attributes; + const data: Record< string, unknown > = { + 'data-show-counts': showCounts, + }; + return ( +
+ - ), - }, - attributes: { - ...metadata.attributes, - }, - edit, - // Save the props to post content. - save( { attributes }: { attributes: Attributes } ) { - const { className, showCounts } = attributes; - const data: Record< string, unknown > = { - 'data-show-counts': showCounts, - }; - return ( -
- -
- ); - }, - } ); -} +
+ ); + }, +} ); diff --git a/plugins/woocommerce-blocks/checkstyle.xml b/plugins/woocommerce-blocks/checkstyle.xml index 4f1a26384f4..7c7b967f63d 100644 --- a/plugins/woocommerce-blocks/checkstyle.xml +++ b/plugins/woocommerce-blocks/checkstyle.xml @@ -3261,8 +3261,8 @@ - - + - - - - - - - - - + + + + + + + + + -