Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Remove feature flag from Products block #8001

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 28 additions & 31 deletions assets/js/blocks/product-query/variations/product-query.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import { isFeaturePluginBuild } from '@woocommerce/block-settings';
import { registerBlockVariation } from '@wordpress/blocks';
import { Icon } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
Expand All @@ -19,33 +18,31 @@ import {

const VARIATION_NAME = 'woocommerce/product-query';

if ( isFeaturePluginBuild() ) {
registerBlockVariation( QUERY_LOOP_ID, {
description: __(
'A block that displays a selection of products in your store.',
'woo-gutenberg-products-block'
),
name: VARIATION_NAME,
/* translators: “Products“ is the name of the block. */
title: __( 'Products (Beta)', 'woo-gutenberg-products-block' ),
isActive: ( blockAttributes ) =>
blockAttributes.namespace === VARIATION_NAME,
icon: (
<Icon
icon={ stacks }
className="wc-block-editor-components-block-icon wc-block-editor-components-block-icon--stacks"
/>
),
attributes: {
...QUERY_DEFAULT_ATTRIBUTES,
namespace: VARIATION_NAME,
},
// Gutenberg doesn't support this type yet, discussion here:
// https://github.com/WordPress/gutenberg/pull/43632
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
allowedControls: DEFAULT_ALLOWED_CONTROLS,
innerBlocks: INNER_BLOCKS_TEMPLATE,
scope: [ 'inserter' ],
} );
}
registerBlockVariation( QUERY_LOOP_ID, {
description: __(
'A block that displays a selection of products in your store.',
'woo-gutenberg-products-block'
),
name: VARIATION_NAME,
/* translators: “Products“ is the name of the block. */
title: __( 'Products (Beta)', 'woo-gutenberg-products-block' ),
isActive: ( blockAttributes ) =>
blockAttributes.namespace === VARIATION_NAME,
icon: (
<Icon
icon={ stacks }
className="wc-block-editor-components-block-icon wc-block-editor-components-block-icon--stacks"
/>
),
attributes: {
...QUERY_DEFAULT_ATTRIBUTES,
namespace: VARIATION_NAME,
},
// Gutenberg doesn't support this type yet, discussion here:
// https://github.com/WordPress/gutenberg/pull/43632
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
allowedControls: DEFAULT_ALLOWED_CONTROLS,
innerBlocks: INNER_BLOCKS_TEMPLATE,
scope: [ 'inserter' ],
} );
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ The majority of our feature flagging is blocks, this is a list of them:

### Feature plugin flag

- Products (Beta) block ([JS flag](https://github.com/woocommerce/woocommerce-blocks/blob/b1aa635572b9639ac357bde1ff134b7ca15c00d6/assets/js/blocks/product-query/variations/product-query.tsx#L28)).
- ⚛️ Product SKU ([JS flag](https://github.com/woocommerce/woocommerce-blocks/blob/4c18b1ff8511ede063e2082316a68eddc8231b51/assets/js/atomic/blocks/product-elements/sku/index.ts#L34)).
- ⚛️ Product stock indicator ([JS flag](https://github.com/woocommerce/woocommerce-blocks/blob/4c18b1ff8511ede063e2082316a68eddc8231b51/assets/js/atomic/blocks/product-elements/stock-indicator/index.ts#L38)).

Expand Down