Merge pull request #32774 from woocommerce/add/32772-exp-product-tasks-feature-flag

Add experimental product task feature flag & experimental-products component
This commit is contained in:
Chi-Hsuan Huang 2022-04-26 18:54:33 +08:00 committed by GitHub
commit 61464e1af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 3 deletions

View File

@ -0,0 +1,20 @@
/**
* External dependencies
*/
import { WooOnboardingTask } from '@woocommerce/onboarding';
import { registerPlugin } from '@wordpress/plugins';
const Products = () => {
return <h1>Experimental products</h1>;
};
registerPlugin( 'wc-admin-onboarding-task-products', {
// @ts-expect-error 'scope' does exist. @types/wordpress__plugins is outdated.
scope: 'woocommerce-tasks',
render: () => (
// @ts-expect-error WooOnboardingTask is a pure JS component.
<WooOnboardingTask id="products">
<Products />
</WooOnboardingTask>
),
} );

View File

@ -4,9 +4,17 @@
import './PaymentGatewaySuggestions';
import './shipping';
import './Marketing';
import './products';
import './appearance';
import './connect';
import './tax';
import './woocommerce-payments';
import './purchase';
if (
window.wcAdminFeatures &&
window.wcAdminFeatures[ 'experimental-products-task' ]
) {
import( './experimental-products' );
} else {
import( './products' );
}

View File

@ -9,6 +9,7 @@ declare global {
analytics: boolean;
coupons: boolean;
'customer-effort-score-tracks': boolean;
'experimental-products-task': boolean;
homescreen: boolean;
marketing: boolean;
'minified-js': boolean;

View File

@ -0,0 +1,4 @@
Significance: patch
Type: add
Add experimental product task feature flag & experimental-products component

View File

@ -4,13 +4,14 @@
"analytics": true,
"coupons": true,
"customer-effort-score-tracks": true,
"experimental-products-task": false,
"homescreen": true,
"marketing": true,
"minified-js": false,
"mobile-app-banner": true,
"navigation": true,
"onboarding": true,
"onboarding-tasks": true,
"onboarding-tasks": true,
"remote-inbox-notifications": true,
"remote-free-extensions": true,
"payment-gateway-suggestions": true,

View File

@ -4,13 +4,14 @@
"analytics": true,
"coupons": true,
"customer-effort-score-tracks": true,
"experimental-products-task": false,
"homescreen": true,
"marketing": true,
"minified-js": true,
"mobile-app-banner": true,
"navigation": true,
"onboarding": true,
"onboarding-tasks": true,
"onboarding-tasks": true,
"payment-gateway-suggestions": true,
"remote-inbox-notifications": true,
"remote-free-extensions": true,