Add product variation flag to hide WIP (#36311)
* Add product variations feature flag * Add changelog entry
This commit is contained in:
parent
45d157a25e
commit
04089f37e6
|
@ -199,7 +199,9 @@ export const getPages = () => {
|
|||
wpOpenMenu: 'menu-posts-product',
|
||||
capability: 'manage_woocommerce',
|
||||
} );
|
||||
}
|
||||
|
||||
if ( window.wcAdminFeatures[ 'product-variation-management' ] ) {
|
||||
pages.push( {
|
||||
container: EditProductPage,
|
||||
path: '/product/:productId/variation/:variationId',
|
||||
|
|
|
@ -130,12 +130,14 @@ const EditProductPage: React.FC = () => {
|
|||
</div>
|
||||
</ProductFormLayout>
|
||||
) }
|
||||
{ productVariation && product && (
|
||||
<ProductVariationForm
|
||||
product={ product }
|
||||
productVariation={ productVariation }
|
||||
/>
|
||||
) }
|
||||
{ window.wcAdminFeatures[ 'product-variation-management' ] &&
|
||||
productVariation &&
|
||||
product && (
|
||||
<ProductVariationForm
|
||||
product={ product }
|
||||
productVariation={ productVariation }
|
||||
/>
|
||||
) }
|
||||
{ ! isProductVariation &&
|
||||
product &&
|
||||
( product.status !== 'trash' || wasDeletedUsingAction ) && (
|
||||
|
|
|
@ -69,10 +69,14 @@ export const ProductForm: React.FC< {
|
|||
>
|
||||
<ProductShippingSection product={ product } />
|
||||
</ProductFormTab>
|
||||
<ProductFormTab name="options" title="Options">
|
||||
<OptionsSection />
|
||||
<ProductVariationsSection />
|
||||
</ProductFormTab>
|
||||
{ window.wcAdminFeatures[ 'product-variation-management' ] ? (
|
||||
<ProductFormTab name="options" title="Options">
|
||||
<OptionsSection />
|
||||
<ProductVariationsSection />
|
||||
</ProductFormTab>
|
||||
) : (
|
||||
<></>
|
||||
) }
|
||||
</ProductFormLayout>
|
||||
<ProductFormFooter />
|
||||
</Form>
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
import { Product } from '@woocommerce/data';
|
||||
|
||||
export const getDerivedProductType = ( product: Partial< Product > ) => {
|
||||
if ( ! window.wcAdminFeatures[ 'product-variation-management' ] ) {
|
||||
return 'simple';
|
||||
}
|
||||
|
||||
const hasOptions = !! product.attributes?.find(
|
||||
( attribute ) => attribute.options.length && attribute.variation
|
||||
);
|
||||
|
|
|
@ -20,6 +20,7 @@ declare global {
|
|||
onboarding: boolean;
|
||||
'onboarding-tasks': boolean;
|
||||
'payment-gateway-suggestions': boolean;
|
||||
'product-variation-management': boolean;
|
||||
'remote-inbox-notifications': boolean;
|
||||
'remote-free-extensions': boolean;
|
||||
settings: boolean;
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: add
|
||||
|
||||
Add product variations flag to only show work in development
|
|
@ -17,6 +17,7 @@
|
|||
"new-product-management-experience": false,
|
||||
"onboarding": true,
|
||||
"onboarding-tasks": true,
|
||||
"product-variation-management": false,
|
||||
"remote-inbox-notifications": true,
|
||||
"remote-free-extensions": true,
|
||||
"payment-gateway-suggestions": true,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
"onboarding": true,
|
||||
"onboarding-tasks": true,
|
||||
"payment-gateway-suggestions": true,
|
||||
"product-variation-management": true,
|
||||
"remote-inbox-notifications": true,
|
||||
"remote-free-extensions": true,
|
||||
"settings": false,
|
||||
|
|
Loading…
Reference in New Issue