Remove not used feature flags (#47150)
* Remove product-virtual-downloadable * Remove product-variation-management * Remove product-external-affiliate * Remove product-grouped * Remove product-linked * Remove customer-effort-score-tracks * Add beta tester changelog * Add changelogs
This commit is contained in:
parent
7c1da8129d
commit
fdb4069566
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Remove not used feature flags #47150
|
|
@ -63,9 +63,6 @@ export function ShippingMenuItem( {
|
|||
renderContent={ () => (
|
||||
<div className="components-dropdown-menu__menu">
|
||||
<MenuGroup>
|
||||
{ window.wcAdminFeatures[
|
||||
'product-virtual-downloadable'
|
||||
] && (
|
||||
<MenuItem
|
||||
onClick={ () => {
|
||||
recordEvent(
|
||||
|
@ -77,12 +74,10 @@ export function ShippingMenuItem( {
|
|||
}
|
||||
);
|
||||
onChange(
|
||||
selection.map(
|
||||
( { id, virtual } ) => ( {
|
||||
selection.map( ( { id, virtual } ) => ( {
|
||||
id,
|
||||
virtual: ! virtual,
|
||||
} )
|
||||
)
|
||||
} ) )
|
||||
);
|
||||
recordEvent(
|
||||
'product_variations_menu_shipping_update',
|
||||
|
@ -97,7 +92,6 @@ export function ShippingMenuItem( {
|
|||
>
|
||||
{ __( 'Toggle shipping', 'woocommerce' ) }
|
||||
</MenuItem>
|
||||
) }
|
||||
<MenuItem
|
||||
onClick={ () => {
|
||||
recordEvent(
|
||||
|
|
|
@ -120,14 +120,12 @@ export function VariationActions( {
|
|||
onClose={ onClose }
|
||||
supportsMultipleSelection={ supportsMultipleSelection }
|
||||
/>
|
||||
{ window.wcAdminFeatures[ 'product-virtual-downloadable' ] && (
|
||||
<DownloadsMenuItem
|
||||
selection={ selection }
|
||||
onChange={ onChange }
|
||||
onClose={ onClose }
|
||||
supportsMultipleSelection={ supportsMultipleSelection }
|
||||
/>
|
||||
) }
|
||||
</MenuGroup>
|
||||
<VariationQuickUpdateMenuItem.Slot
|
||||
group={ 'secondary' }
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
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
|
||||
);
|
||||
|
|
|
@ -97,19 +97,11 @@ if ( appRoot ) {
|
|||
}
|
||||
}
|
||||
|
||||
// Render the CustomerEffortScoreTracksContainer only if
|
||||
// the feature flag is enabled.
|
||||
if (
|
||||
window.wcAdminFeatures &&
|
||||
window.wcAdminFeatures[ 'customer-effort-score-tracks' ] === true
|
||||
) {
|
||||
// Set up customer effort score survey.
|
||||
( function () {
|
||||
const root = appRoot || embeddedRoot;
|
||||
|
||||
render(
|
||||
<CustomerEffortScoreTracksContainer />,
|
||||
root.insertBefore( document.createElement( 'div' ), null )
|
||||
);
|
||||
} )();
|
||||
}
|
||||
|
|
|
@ -273,7 +273,6 @@ export const getPages = () => {
|
|||
} );
|
||||
}
|
||||
|
||||
if ( window.wcAdminFeatures[ 'product-variation-management' ] ) {
|
||||
pages.push( {
|
||||
container: ProductVariationPage,
|
||||
layout: {
|
||||
|
@ -290,7 +289,6 @@ export const getPages = () => {
|
|||
wpOpenMenu: 'menu-posts-product',
|
||||
capability: 'edit_products',
|
||||
} );
|
||||
}
|
||||
|
||||
if ( window.wcAdminFeatures.onboarding ) {
|
||||
if ( ! window.wcAdminFeatures[ 'core-profiler' ] ) {
|
||||
|
|
|
@ -134,9 +134,7 @@ const EditProductPage: React.FC = () => {
|
|||
</div>
|
||||
</ProductFormLayout>
|
||||
) }
|
||||
{ window.wcAdminFeatures[ 'product-variation-management' ] &&
|
||||
productVariation &&
|
||||
product && (
|
||||
{ productVariation && product && (
|
||||
<ProductVariationForm
|
||||
product={ product }
|
||||
productVariation={ productVariation }
|
||||
|
|
|
@ -104,7 +104,6 @@ const Tabs = () => {
|
|||
fillProps={ { product } }
|
||||
/>
|
||||
</WooProductTabItem>
|
||||
{ window.wcAdminFeatures[ 'product-variation-management' ] ? (
|
||||
<WooProductTabItem
|
||||
id={ TAB_OPTIONS_ID }
|
||||
templates={ [ { name: TAB_GENERAL_ID, order: 9 } ] }
|
||||
|
@ -115,7 +114,6 @@ const Tabs = () => {
|
|||
<ProductVariationsSection />
|
||||
</>
|
||||
</WooProductTabItem>
|
||||
) : null }
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -29,7 +29,6 @@ declare global {
|
|||
'activity-panels': boolean;
|
||||
analytics: boolean;
|
||||
coupons: boolean;
|
||||
'customer-effort-score-tracks': boolean;
|
||||
homescreen: boolean;
|
||||
marketing: boolean;
|
||||
'minified-js': boolean;
|
||||
|
@ -39,11 +38,6 @@ declare global {
|
|||
onboarding: boolean;
|
||||
'onboarding-tasks': boolean;
|
||||
'payment-gateway-suggestions': boolean;
|
||||
'product-variation-management': boolean;
|
||||
'product-virtual-downloadable': boolean;
|
||||
'product-external-affiliate': boolean;
|
||||
'product-grouped': boolean;
|
||||
'product-linked': boolean;
|
||||
'product-pre-publish-modal': boolean;
|
||||
'product-custom-fields': boolean;
|
||||
'remote-inbox-notifications': boolean;
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Remove not used feature flags #47150
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Remove not used feature flags #47150
|
|
@ -6,7 +6,6 @@
|
|||
"coupons": true,
|
||||
"core-profiler": true,
|
||||
"customize-store": true,
|
||||
"customer-effort-score-tracks": true,
|
||||
"import-products-task": true,
|
||||
"experimental-fashion-sample-products": true,
|
||||
"shipping-smart-defaults": true,
|
||||
|
@ -20,11 +19,6 @@
|
|||
"onboarding": true,
|
||||
"onboarding-tasks": true,
|
||||
"pattern-toolkit-full-composability": false,
|
||||
"product-variation-management": true,
|
||||
"product-virtual-downloadable": true,
|
||||
"product-external-affiliate": true,
|
||||
"product-grouped": true,
|
||||
"product-linked": true,
|
||||
"product-pre-publish-modal": true,
|
||||
"product-custom-fields": true,
|
||||
"remote-inbox-notifications": true,
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
"coupons": true,
|
||||
"core-profiler": true,
|
||||
"customize-store": true,
|
||||
"customer-effort-score-tracks": true,
|
||||
"import-products-task": true,
|
||||
"experimental-fashion-sample-products": true,
|
||||
"shipping-smart-defaults": true,
|
||||
|
@ -21,11 +20,6 @@
|
|||
"onboarding-tasks": true,
|
||||
"pattern-toolkit-full-composability": false,
|
||||
"payment-gateway-suggestions": true,
|
||||
"product-variation-management": true,
|
||||
"product-virtual-downloadable": true,
|
||||
"product-external-affiliate": true,
|
||||
"product-grouped": true,
|
||||
"product-linked": true,
|
||||
"product-pre-publish-modal": true,
|
||||
"product-custom-fields": true,
|
||||
"remote-inbox-notifications": true,
|
||||
|
|
|
@ -49,17 +49,9 @@ class Init {
|
|||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( Features::is_enabled( 'product-variation-management' ) ) {
|
||||
array_push( $this->supported_product_types, 'variable' );
|
||||
}
|
||||
|
||||
if ( Features::is_enabled( 'product-external-affiliate' ) ) {
|
||||
array_push( $this->supported_product_types, 'external' );
|
||||
}
|
||||
|
||||
if ( Features::is_enabled( 'product-grouped' ) ) {
|
||||
array_push( $this->supported_product_types, 'grouped' );
|
||||
}
|
||||
|
||||
$this->redirection_controller = new RedirectionController();
|
||||
|
||||
|
|
|
@ -86,11 +86,8 @@ class RedirectionController {
|
|||
}
|
||||
|
||||
if ( isset( $product_data_type ) ) {
|
||||
if ( Features::is_enabled( 'product-virtual-downloadable' ) ) {
|
||||
return true;
|
||||
}
|
||||
return ! $digital_product;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -176,5 +173,4 @@ class RedirectionController {
|
|||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ trait DownloadableProductTrait {
|
|||
*/
|
||||
private function add_downloadable_product_blocks( $parent_block ) {
|
||||
// Downloads section.
|
||||
if ( Features::is_enabled( 'product-virtual-downloadable' ) ) {
|
||||
$product_downloads_section_group = $parent_block->add_section(
|
||||
array(
|
||||
'id' => 'product-downloads-section-group',
|
||||
|
@ -45,7 +44,6 @@ trait DownloadableProductTrait {
|
|||
'label' => __( 'Include downloads', 'woocommerce' ),
|
||||
'checkedHelp' => __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info.', 'woocommerce' ),
|
||||
'uncheckedHelp' => __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info.', 'woocommerce' ),
|
||||
|
||||
),
|
||||
)
|
||||
);
|
||||
|
@ -78,4 +76,3 @@ trait DownloadableProductTrait {
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -441,7 +441,6 @@ class ProductVariationTemplate extends AbstractProductFormTemplate implements Pr
|
|||
)
|
||||
);
|
||||
// Virtual section.
|
||||
if ( Features::is_enabled( 'product-virtual-downloadable' ) ) {
|
||||
$shipping_group->add_section(
|
||||
array(
|
||||
'id' => 'product-variation-virtual-section',
|
||||
|
@ -461,7 +460,6 @@ class ProductVariationTemplate extends AbstractProductFormTemplate implements Pr
|
|||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
// Product Shipping Section.
|
||||
$product_fee_and_dimensions_section = $shipping_group->add_section(
|
||||
array(
|
||||
|
|
|
@ -78,18 +78,13 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
);
|
||||
|
||||
// Variations tab.
|
||||
if ( Features::is_enabled( 'product-variation-management' ) ) {
|
||||
$variations_hide_conditions = array();
|
||||
if ( Features::is_enabled( 'product-grouped' ) ) {
|
||||
$variations_hide_conditions[] = array(
|
||||
'expression' => 'editedProduct.type === "grouped"',
|
||||
);
|
||||
}
|
||||
if ( Features::is_enabled( 'product-external-affiliate' ) ) {
|
||||
$variations_hide_conditions[] = array(
|
||||
'expression' => 'editedProduct.type === "external"',
|
||||
);
|
||||
}
|
||||
|
||||
$this->add_group(
|
||||
array(
|
||||
|
@ -101,7 +96,6 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
'hideConditions' => $variations_hide_conditions,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$this->add_group(
|
||||
array(
|
||||
|
@ -119,11 +113,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
'attributes' => array(
|
||||
'title' => __( 'Pricing', 'woocommerce' ),
|
||||
),
|
||||
'hideConditions' => Features::is_enabled( 'product-grouped' ) ? array(
|
||||
'hideConditions' => array(
|
||||
array(
|
||||
'expression' => 'editedProduct.type === "grouped"',
|
||||
),
|
||||
) : null,
|
||||
),
|
||||
)
|
||||
);
|
||||
$this->add_group(
|
||||
|
@ -136,16 +130,12 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
)
|
||||
);
|
||||
$shipping_hide_conditions = array();
|
||||
if ( Features::is_enabled( 'product-grouped' ) ) {
|
||||
$shipping_hide_conditions[] = array(
|
||||
'expression' => 'editedProduct.type === "grouped"',
|
||||
);
|
||||
}
|
||||
if ( Features::is_enabled( 'product-external-affiliate' ) ) {
|
||||
$shipping_hide_conditions[] = array(
|
||||
'expression' => 'editedProduct.type === "external"',
|
||||
);
|
||||
}
|
||||
|
||||
$this->add_group(
|
||||
array(
|
||||
|
@ -159,7 +149,6 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
);
|
||||
|
||||
// Linked Products tab.
|
||||
if ( Features::is_enabled( 'product-linked' ) ) {
|
||||
$this->add_group(
|
||||
array(
|
||||
'id' => $this::GROUP_IDS['LINKED_PRODUCTS'],
|
||||
|
@ -170,7 +159,6 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the general group blocks to the template.
|
||||
|
@ -279,7 +267,6 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
);
|
||||
|
||||
// External/Affiliate section.
|
||||
if ( Features::is_enabled( 'product-external-affiliate' ) ) {
|
||||
$buy_button_section = $general_group->add_section(
|
||||
array(
|
||||
'id' => 'product-buy-button-section',
|
||||
|
@ -347,10 +334,8 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
'order' => 20,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Product list section.
|
||||
if ( Features::is_enabled( 'product-grouped' ) ) {
|
||||
$product_list_section = $general_group->add_section(
|
||||
array(
|
||||
'id' => 'product-list-section',
|
||||
|
@ -377,7 +362,6 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Images section.
|
||||
$images_section = $general_group->add_section(
|
||||
|
@ -827,11 +811,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
'</a>'
|
||||
) : null,
|
||||
),
|
||||
'hideConditions' => Features::is_enabled( 'product-external-affiliate' ) || Features::is_enabled( 'product-grouped' ) ? array(
|
||||
'hideConditions' => array(
|
||||
array(
|
||||
'expression' => 'editedProduct.type === "external" || editedProduct.type === "grouped"',
|
||||
),
|
||||
) : null,
|
||||
),
|
||||
'disableConditions' => array(
|
||||
array(
|
||||
'expression' => 'editedProduct.type === "variable"',
|
||||
|
@ -844,11 +828,9 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
'expression' => 'editedProduct.manage_stock === false',
|
||||
),
|
||||
);
|
||||
if ( Features::is_enabled( 'product-grouped' ) ) {
|
||||
$product_inventory_quantity_hide_conditions[] = array(
|
||||
'expression' => 'editedProduct.type === "grouped"',
|
||||
);
|
||||
}
|
||||
$product_inventory_inner_section->add_block(
|
||||
array(
|
||||
'id' => 'product-inventory-quantity',
|
||||
|
@ -862,11 +844,9 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
'expression' => 'editedProduct.manage_stock === true',
|
||||
),
|
||||
);
|
||||
if ( Features::is_enabled( 'product-grouped' ) ) {
|
||||
$product_stock_status_hide_conditions[] = array(
|
||||
'expression' => 'editedProduct.type === "grouped"',
|
||||
);
|
||||
}
|
||||
$product_inventory_section->add_block(
|
||||
array(
|
||||
'id' => 'product-stock-status',
|
||||
|
@ -922,11 +902,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
'initialCollapsed' => true,
|
||||
'persistRender' => true,
|
||||
),
|
||||
'hideConditions' => Features::is_enabled( 'product-grouped' ) ? array(
|
||||
'hideConditions' => array(
|
||||
array(
|
||||
'expression' => 'editedProduct.type === "grouped"',
|
||||
),
|
||||
) : null,
|
||||
),
|
||||
)
|
||||
);
|
||||
$product_inventory_advanced_wrapper = $product_inventory_advanced->add_block(
|
||||
|
@ -1026,7 +1006,6 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
)
|
||||
);
|
||||
// Virtual section.
|
||||
if ( Features::is_enabled( 'product-virtual-downloadable' ) ) {
|
||||
$shipping_group->add_section(
|
||||
array(
|
||||
'id' => 'product-virtual-section',
|
||||
|
@ -1051,7 +1030,6 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
// Product Shipping Section.
|
||||
$product_fee_and_dimensions_section = $shipping_group->add_section(
|
||||
array(
|
||||
|
|
|
@ -73,9 +73,6 @@ function reset_feature_flags() {
|
|||
function enable_experimental_features( $features ) {
|
||||
$stored_features = get_option( 'e2e_feature_flags', array() );
|
||||
|
||||
// We always enable this for tests at the moment.
|
||||
$features['product-variation-management'] = true;
|
||||
|
||||
return array_merge( $features, $stored_features );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue