Disable the new navigation in the WC Admin. (#36456)
* Disable the new navigation. * Add changelog * Fix linter errors. * Disable the new_navigation option.' * Navigation: disable the opt-out modal. * Disable navigation for sites that have it turned off. Revert obsolete changes. * Navigation: Add warning before disabling the navigation in the Feature Settings. * Linter errors. * Correct the logic. * Edit the notice text. * Fixing linting errors." * Tests: fix the copy.
This commit is contained in:
parent
4341a53144
commit
b78318525b
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: update
|
||||||
|
|
||||||
|
Disable the new navigation as the feature is on hold.
|
|
@ -606,6 +606,26 @@ class FeaturesController {
|
||||||
$disabled = true;
|
$disabled = true;
|
||||||
$desc_tip = __( 'WooCommerce Admin has been disabled', 'woocommerce' );
|
$desc_tip = __( 'WooCommerce Admin has been disabled', 'woocommerce' );
|
||||||
} elseif ( 'new_navigation' === $feature_id ) {
|
} elseif ( 'new_navigation' === $feature_id ) {
|
||||||
|
$disabled = ! $this->feature_is_enabled( $feature_id );
|
||||||
|
|
||||||
|
if ( $disabled ) {
|
||||||
|
$update_text = sprintf(
|
||||||
|
// translators: 1: line break tag.
|
||||||
|
__( '%1$s The development of this feature is currently on hold.', 'woocommerce' ),
|
||||||
|
'<br/>'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$update_text = sprintf(
|
||||||
|
// translators: 1: line break tag.
|
||||||
|
__(
|
||||||
|
'%1$s This navigation will soon become unavailable while we make necessary improvements.
|
||||||
|
If you turn it off now, you will not be able to turn it back on.',
|
||||||
|
'woocommerce'
|
||||||
|
),
|
||||||
|
'<br/>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$needs_update = version_compare( get_bloginfo( 'version' ), '5.6', '<' );
|
$needs_update = version_compare( get_bloginfo( 'version' ), '5.6', '<' );
|
||||||
if ( $needs_update && current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
|
if ( $needs_update && current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
|
||||||
$update_text = sprintf(
|
$update_text = sprintf(
|
||||||
|
@ -615,8 +635,11 @@ class FeaturesController {
|
||||||
'<a href="' . self_admin_url( 'update-core.php' ) . '" target="_blank">',
|
'<a href="' . self_admin_url( 'update-core.php' ) . '" target="_blank">',
|
||||||
'</a>'
|
'</a>'
|
||||||
);
|
);
|
||||||
|
$disabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! empty( $update_text ) ) {
|
||||||
$description .= $update_text;
|
$description .= $update_text;
|
||||||
$disabled = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1702,13 +1702,12 @@ test.describe('Settings API tests: CRUD', () => {
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
})
|
})
|
||||||
]));
|
]));
|
||||||
|
|
||||||
expect(responseJSON).toEqual(
|
expect(responseJSON).toEqual(
|
||||||
expect.arrayContaining([
|
expect.arrayContaining([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
"id": "woocommerce_navigation_enabled",
|
"id": "woocommerce_navigation_enabled",
|
||||||
"label": "Navigation",
|
"label": "Navigation",
|
||||||
"description": "Adds the new WooCommerce navigation experience to the dashboard",
|
"description": expect.stringContaining("Adds the new WooCommerce navigation experience to the dashboard"),
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"value": expect.any(String),
|
"value": expect.any(String),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue