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

Commit 7c6a5a5

Browse files
authored
Include Cart and Checkout Blocks when included in WC Core (#6805)
* Remove all inbox notifications about cart and checkout blocks * Remove feature flag check from CreateAccount class * Remove feature plugin check to register PaymentsApi class * Comment out is_feature_plugin_build function We might need this later, so keeping it around seems useful. * Remove feature plugin check when adding resource hints * Import registerBlockType and use it over registerFeaturePLuginBlockType * Ensure Cart and Checkout inner blocks register even if not feature plugin * Comment out registerFeaturePluginBlockType * Remove duplicate import * Revert "Comment out registerFeaturePluginBlockType" This reverts commit bec6ed8. * Align PHPDoc correctly * Update feature flag doc to remove Cart and Checkout blocks + PaymentApi
1 parent 2eb3b63 commit 7c6a5a5

File tree

47 files changed

+312
-525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+312
-525
lines changed

assets/js/blocks/cart/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import classnames from 'classnames';
66
import { InnerBlocks } from '@wordpress/block-editor';
77
import { cart } from '@woocommerce/icons';
88
import { Icon } from '@wordpress/icons';
9-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
10-
import { createBlock } from '@wordpress/blocks';
9+
import { registerBlockType, createBlock } from '@wordpress/blocks';
1110
/**
1211
* Internal dependencies
1312
*/
@@ -111,4 +110,4 @@ const settings = {
111110
],
112111
};
113112

114-
registerFeaturePluginBlockType( blockName, settings );
113+
registerBlockType( blockName, settings );
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
/**
22
* External dependencies
33
*/
4-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
4+
import { registerBlockType } from '@wordpress/blocks';
55
import { Icon, payment } from '@wordpress/icons';
66

77
/**
88
* Internal dependencies
99
*/
1010
import { Edit, Save } from './edit';
1111

12-
registerFeaturePluginBlockType(
13-
'woocommerce/cart-accepted-payment-methods-block',
14-
{
15-
icon: {
16-
src: (
17-
<Icon
18-
icon={ payment }
19-
className="wc-block-editor-components-block-icon"
20-
/>
21-
),
22-
},
23-
edit: Edit,
24-
save: Save,
25-
}
26-
);
12+
registerBlockType( 'woocommerce/cart-accepted-payment-methods-block', {
13+
icon: {
14+
src: (
15+
<Icon
16+
icon={ payment }
17+
className="wc-block-editor-components-block-icon"
18+
/>
19+
),
20+
},
21+
edit: Edit,
22+
save: Save,
23+
} );

assets/js/blocks/cart/inner-blocks/cart-express-payment-block/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* External dependencies
33
*/
44
import { Icon, payment } from '@wordpress/icons';
5-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
5+
import { registerBlockType } from '@wordpress/blocks';
66

77
/**
88
* Internal dependencies
99
*/
1010
import { Edit, Save } from './edit';
1111

12-
registerFeaturePluginBlockType( 'woocommerce/cart-express-payment-block', {
12+
registerBlockType( 'woocommerce/cart-express-payment-block', {
1313
icon: {
1414
src: (
1515
<Icon

assets/js/blocks/cart/inner-blocks/cart-items-block/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* External dependencies
33
*/
44
import { Icon, column } from '@wordpress/icons';
5-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
5+
import { registerBlockType } from '@wordpress/blocks';
66

77
/**
88
* Internal dependencies
99
*/
1010
import { Edit, Save } from './edit';
1111

12-
registerFeaturePluginBlockType( 'woocommerce/cart-items-block', {
12+
registerBlockType( 'woocommerce/cart-items-block', {
1313
icon: {
1414
src: (
1515
<Icon

assets/js/blocks/cart/inner-blocks/cart-line-items-block/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* External dependencies
33
*/
44
import { Icon, column } from '@wordpress/icons';
5-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
5+
import { registerBlockType } from '@wordpress/blocks';
66

77
/**
88
* Internal dependencies
99
*/
1010
import { Edit, Save } from './edit';
1111

12-
registerFeaturePluginBlockType( 'woocommerce/cart-line-items-block', {
12+
registerBlockType( 'woocommerce/cart-line-items-block', {
1313
icon: {
1414
src: (
1515
<Icon

assets/js/blocks/cart/inner-blocks/cart-order-summary-block/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
*/
44
import { totals } from '@woocommerce/icons';
55
import { Icon } from '@wordpress/icons';
6-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6+
import { registerBlockType } from '@wordpress/blocks';
77

88
/**
99
* Internal dependencies
1010
*/
1111
import { Edit, Save } from './edit';
1212

13-
registerFeaturePluginBlockType( 'woocommerce/cart-order-summary-block', {
13+
registerBlockType( 'woocommerce/cart-order-summary-block', {
1414
icon: {
1515
src: (
1616
<Icon

assets/js/blocks/cart/inner-blocks/cart-order-summary-coupon-form/index.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22
* External dependencies
33
*/
44
import { Icon, tag } from '@wordpress/icons';
5-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
5+
import { registerBlockType } from '@wordpress/blocks';
66

77
/**
88
* Internal dependencies
99
*/
1010
import { Edit, Save } from './edit';
1111

12-
registerFeaturePluginBlockType(
13-
'woocommerce/cart-order-summary-coupon-form-block',
14-
{
15-
icon: {
16-
src: (
17-
<Icon
18-
icon={ tag }
19-
className="wc-block-editor-components-block-icon"
20-
/>
21-
),
22-
},
23-
edit: Edit,
24-
save: Save,
25-
}
26-
);
12+
registerBlockType( 'woocommerce/cart-order-summary-coupon-form-block', {
13+
icon: {
14+
src: (
15+
<Icon
16+
icon={ tag }
17+
className="wc-block-editor-components-block-icon"
18+
/>
19+
),
20+
},
21+
edit: Edit,
22+
save: Save,
23+
} );

assets/js/blocks/cart/inner-blocks/cart-order-summary-discount/index.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,22 @@
33
*/
44
import { totals } from '@woocommerce/icons';
55
import { Icon } from '@wordpress/icons';
6-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6+
import { registerBlockType } from '@wordpress/blocks';
77

88
/**
99
* Internal dependencies
1010
*/
1111
import { Edit, Save } from './edit';
1212

13-
registerFeaturePluginBlockType(
14-
'woocommerce/cart-order-summary-discount-block',
15-
{
16-
icon: {
17-
src: (
18-
<Icon
19-
icon={ totals }
20-
className="wc-block-editor-components-block-icon"
21-
/>
22-
),
23-
},
24-
edit: Edit,
25-
save: Save,
26-
}
27-
);
13+
registerBlockType( 'woocommerce/cart-order-summary-discount-block', {
14+
icon: {
15+
src: (
16+
<Icon
17+
icon={ totals }
18+
className="wc-block-editor-components-block-icon"
19+
/>
20+
),
21+
},
22+
edit: Edit,
23+
save: Save,
24+
} );

assets/js/blocks/cart/inner-blocks/cart-order-summary-fee/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
*/
44
import { totals } from '@woocommerce/icons';
55
import { Icon } from '@wordpress/icons';
6-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6+
import { registerBlockType } from '@wordpress/blocks';
77

88
/**
99
* Internal dependencies
1010
*/
1111
import { Edit, Save } from './edit';
1212

13-
registerFeaturePluginBlockType( 'woocommerce/cart-order-summary-fee-block', {
13+
registerBlockType( 'woocommerce/cart-order-summary-fee-block', {
1414
icon: {
1515
src: (
1616
<Icon

assets/js/blocks/cart/inner-blocks/cart-order-summary-heading/index.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,22 @@
33
*/
44
import { totals } from '@woocommerce/icons';
55
import { Icon } from '@wordpress/icons';
6-
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6+
import { registerBlockType } from '@wordpress/blocks';
77

88
/**
99
* Internal dependencies
1010
*/
1111
import { Edit, Save } from './edit';
1212

13-
registerFeaturePluginBlockType(
14-
'woocommerce/cart-order-summary-heading-block',
15-
{
16-
icon: {
17-
src: (
18-
<Icon
19-
icon={ totals }
20-
className="wc-block-editor-components-block-icon"
21-
/>
22-
),
23-
},
24-
edit: Edit,
25-
save: Save,
26-
}
27-
);
13+
registerBlockType( 'woocommerce/cart-order-summary-heading-block', {
14+
icon: {
15+
src: (
16+
<Icon
17+
icon={ totals }
18+
className="wc-block-editor-components-block-icon"
19+
/>
20+
),
21+
},
22+
edit: Edit,
23+
save: Save,
24+
} );

0 commit comments

Comments
 (0)