Filter by Rating: Remove the Feature Plugin flag (https://github.com/woocommerce/woocommerce-blocks/pull/7580)
* Filter by Rating: Remove the Feature Plugin flag
This commit is contained in:
parent
da0a5157bf
commit
ca1e65cbef
|
@ -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
|
||||
icon={ starEmpty }
|
||||
className="wc-block-editor-components-block-icon"
|
||||
/>
|
||||
),
|
||||
},
|
||||
} ),
|
||||
},
|
||||
icon: {
|
||||
src: (
|
||||
<Icon
|
||||
icon={ starEmpty }
|
||||
className="wc-block-editor-components-block-icon"
|
||||
/>
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
transforms: {
|
||||
|
|
|
@ -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: (
|
||||
<Icon
|
||||
icon={ starEmpty }
|
||||
className="wc-block-editor-components-block-icon"
|
||||
registerBlockType( metadata, {
|
||||
icon: {
|
||||
src: (
|
||||
<Icon
|
||||
icon={ starEmpty }
|
||||
className="wc-block-editor-components-block-icon"
|
||||
/>
|
||||
),
|
||||
},
|
||||
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 (
|
||||
<div
|
||||
{ ...useBlockProps.save( {
|
||||
className: classNames( 'is-loading', className ),
|
||||
} ) }
|
||||
{ ...data }
|
||||
>
|
||||
<span
|
||||
aria-hidden
|
||||
className="wc-block-product-rating-filter__placeholder"
|
||||
/>
|
||||
),
|
||||
},
|
||||
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 (
|
||||
<div
|
||||
{ ...useBlockProps.save( {
|
||||
className: classNames( 'is-loading', className ),
|
||||
} ) }
|
||||
{ ...data }
|
||||
>
|
||||
<span
|
||||
aria-hidden
|
||||
className="wc-block-product-rating-filter__placeholder"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
} );
|
||||
}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
} );
|
||||
|
|
|
@ -3261,8 +3261,8 @@
|
|||
</file>
|
||||
<file name="assets/js/blocks/filter-wrapper/index.tsx">
|
||||
<error line="8" column="25" severity="error" message="Module '"@wordpress/block-editor"' has no exported member 'useInnerBlocksProps'." source="TS2305" />
|
||||
<error line="47" column="34" severity="error" message="Parameter 'instance' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="112" column="20" severity="error" message="No overload matches this call.
|
||||
<error line="46" column="34" severity="error" message="Parameter 'instance' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="111" column="20" severity="error" message="No overload matches this call.
|
||||
Overload 1 of 2, '(metadata: BlockConfiguration<Attributes>, settings?: Partial<BlockConfiguration<Attributes>> | undefined): Block<...> | undefined', gave the following error.
|
||||
Argument of type '{ name: string; version: string; title: string; category: string; keywords: string[]; attributes: { filterType: { type: string; }; heading: { type: string; }; }; textdomain: string; apiVersion: number; $schema: string; }' is not assignable to parameter of type 'BlockConfiguration<Attributes>'.
|
||||
Type '{ name: string; version: string; title: string; category: string; keywords: string[]; attributes: { filterType: { type: string; }; heading: { type: string; }; }; textdomain: string; apiVersion: number; $schema: string; }' is not assignable to type 'Partial<Omit<Block<Attributes>, "icon">>'.
|
||||
|
@ -3271,15 +3271,15 @@
|
|||
Type '{ type: string; }' is missing the following properties from type 'Query<string>': source, selector, query
|
||||
Overload 2 of 2, '(name: string, settings: BlockConfiguration<Attributes>): Block<Attributes> | undefined', gave the following error.
|
||||
Argument of type '{ name: string; version: string; title: string; category: string; keywords: string[]; attributes: { filterType: { type: string; }; heading: { type: string; }; }; textdomain: string; apiVersion: number; $schema: string; }' is not assignable to parameter of type 'string'." source="TS2769" />
|
||||
<error line="136" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="160" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="185" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="210" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="236" column="17" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="262" column="18" severity="error" message="Property 'idBase' does not exist on type 'Attributes'." source="TS2339" />
|
||||
<error line="262" column="26" severity="error" message="Property 'instance' does not exist on type 'Attributes'." source="TS2339" />
|
||||
<error line="264" column="20" severity="error" message="Property 'idBase' does not exist on type 'Attributes'." source="TS2339" />
|
||||
<error line="264" column="28" severity="error" message="Property 'instance' does not exist on type 'Attributes'." source="TS2339" />
|
||||
<error line="135" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="159" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="184" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="209" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="234" column="16" severity="error" message="Parameter 'attributes' implicitly has an 'any' type." source="TS7006" />
|
||||
<error line="259" column="18" severity="error" message="Property 'idBase' does not exist on type 'Attributes'." source="TS2339" />
|
||||
<error line="259" column="26" severity="error" message="Property 'instance' does not exist on type 'Attributes'." source="TS2339" />
|
||||
<error line="261" column="20" severity="error" message="Property 'idBase' does not exist on type 'Attributes'." source="TS2339" />
|
||||
<error line="261" column="28" severity="error" message="Property 'instance' does not exist on type 'Attributes'." source="TS2339" />
|
||||
</file>
|
||||
<file name="assets/js/blocks/handpicked-products/block.tsx">
|
||||
<error line="4" column="30" severity="error" message="Could not find a declaration file for module '@wordpress/server-side-render'. '/home/runner/work/woocommerce-blocks/woocommerce-blocks/node_modules/@wordpress/server-side-render/build/index.js' implicitly has an 'any' type.
|
||||
|
@ -3835,7 +3835,7 @@
|
|||
Argument of type '{ name: string; title: string; category: string; keywords: string[]; description: string; supports: { align: string[]; html: boolean; }; attributes: { attributes: { type: string; default: never[]; }; attrOperator: { ...; }; ... 6 more ...; stockStatus: { ...; }; }; textdomain: string; apiVersion: number; $schema: st...' is not assignable to parameter of type 'string'." source="TS2769" />
|
||||
</file>
|
||||
<file name="assets/js/blocks/rating-filter/index.tsx">
|
||||
<error line="18" column="21" severity="error" message="No overload matches this call.
|
||||
<error line="16" column="20" severity="error" message="No overload matches this call.
|
||||
Overload 1 of 2, '(metadata: BlockConfiguration<Attributes>, settings?: Partial<BlockConfiguration<Attributes>> | undefined): Block<...> | undefined', gave the following error.
|
||||
Argument of type '{ name: string; version: string; title: string; description: string; category: string; keywords: string[]; supports: { html: boolean; multiple: boolean; color: { __experimentalDefaultControls: { text: boolean; }; }; inserter: boolean; lock: boolean; }; ... 4 more ...; $schema: string; }' is not assignable to parameter of type 'BlockConfiguration<Attributes>'.
|
||||
Type '{ name: string; version: string; title: string; description: string; category: string; keywords: string[]; supports: { html: boolean; multiple: boolean; color: { __experimentalDefaultControls: { text: boolean; }; }; inserter: boolean; lock: boolean; }; ... 4 more ...; $schema: string; }' is not assignable to type 'Partial<Omit<Block<Attributes>, "icon">>'.
|
||||
|
|
|
@ -62,7 +62,6 @@ We also have individual features or code blocks behind a feature flag, this is a
|
|||
- ⚛️ Product Price new controls ([JS flag 1](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/price/attributes.js#L13-L44) | [JS flag 2-1](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/8d2f0ad8ade2c7217769b431f93de76d6cfacf6e/assets/js/atomic/blocks/product-elements/price/block.js#L116) | [JS flag 2-2](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/8d2f0ad8ade2c7217769b431f93de76d6cfacf6e/assets/js/atomic/blocks/product-elements/price/block.js#L114) | [JS flag 2-3](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/8d2f0ad8ade2c7217769b431f93de76d6cfacf6e/assets/js/atomic/blocks/product-elements/price/block.js#L91) | [JS flag 2-4](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/8d2f0ad8ade2c7217769b431f93de76d6cfacf6e/assets/js/atomic/blocks/product-elements/price/block.js#L95) | [JS flag 2-5](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/8d2f0ad8ade2c7217769b431f93de76d6cfacf6e/assets/js/atomic/blocks/product-elements/price/block.js#L106) | [JS flag 3-1](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/price/edit.js#L59-L108) | [JS flag 3-2](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/price/edit.js#L114-L131)).
|
||||
- ⚛️ Product Title new controls ([JS flag 1](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/title/attributes.js#L21-L40) | [JS flag 2-1](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/title/block.js#L70-L72) | [JS flag 2-2](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/title/block.js#L94-L95) | [JS flag 2-3](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/title/block.js#L104) | [JS flag 3-1](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/title/edit.js#L47-L54) | [JS flag 3-2](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/title/edit.js#L77-L107) | [JS flag 3-3](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b3a9753d8b7dae18b36025d09fbff835b8365de0/assets/js/atomic/blocks/product-elements/title/edit.js#L116-L129)).
|
||||
- Utility function to pass styles to a block ([JS flag](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/9ebddbc5d21eb3cc67fedddbccbd86453313eb64/assets/js/atomic/utils/block-styling.js#L6-L12)).
|
||||
- Filter by Rating ([JS flag](https://github.com/woocommerce/woocommerce-blocks/blob/6547881939b1aa4825562d05fb06808515bf33c2/assets/js/blocks/rating-filter/index.tsx/#L19-L20)).
|
||||
|
||||
### Experimental plugin flag
|
||||
|
||||
|
|
Loading…
Reference in New Issue