Dashboard: Rename class/feature to remove conflict with legacy dashboard widget (https://github.com/woocommerce/woocommerce-admin/pull/2138)
* Dashboard: Rename class/feature to remove conflict with legacy dashboard class * Updates per feedback, and fixes.
This commit is contained in:
parent
d4f1e6bbd8
commit
d51845930a
|
@ -36,7 +36,7 @@ class SectionControls extends Component {
|
|||
render() {
|
||||
const { onRemove, isFirst, isLast } = this.props;
|
||||
|
||||
if ( ! window.wcAdminFeatures[ 'dashboard/customizable' ] ) {
|
||||
if ( ! window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class DashboardCharts extends Component {
|
|||
label={ __( 'Choose which charts to display', 'woocommerce-admin' ) }
|
||||
renderContent={ ( { onToggle } ) => (
|
||||
<Fragment>
|
||||
{ window.wcAdminFeatures[ 'dashboard/customizable' ] && (
|
||||
{ window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] && (
|
||||
<div className="woocommerce-ellipsis-menu__item">
|
||||
<TextControl
|
||||
label={ __( 'Section Title', 'woocommerce-admin' ) }
|
||||
|
|
|
@ -36,7 +36,7 @@ export default class Dashboard extends Component {
|
|||
|
||||
// @todo When the customizable dashboard is ready to be launched, we can pull `CustomizableDashboard`'s render
|
||||
// method into `index.js`, and replace both this feature check, and the existing dashboard below.
|
||||
if ( window.wcAdminFeatures[ 'dashboard/customizable' ] ) {
|
||||
if ( window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] ) {
|
||||
return <CustomizableDashboard query={ query } path={ path } />;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ class Leaderboards extends Component {
|
|||
) }
|
||||
renderContent={ ( { onToggle } ) => (
|
||||
<Fragment>
|
||||
{ window.wcAdminFeatures[ 'dashboard/customizable' ] && (
|
||||
{ window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] && (
|
||||
<div className="woocommerce-ellipsis-menu__item">
|
||||
<TextControl
|
||||
label={ __( 'Section Title', 'woocommerce-admin' ) }
|
||||
|
|
|
@ -57,7 +57,7 @@ class StorePerformance extends Component {
|
|||
) }
|
||||
renderContent={ ( { onToggle } ) => (
|
||||
<Fragment>
|
||||
{ window.wcAdminFeatures[ 'dashboard/customizable' ] && (
|
||||
{ window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] && (
|
||||
<div className="woocommerce-ellipsis-menu__item">
|
||||
<TextControl
|
||||
label={ __( 'Section Title', 'woocommerce-admin' ) }
|
||||
|
|
|
@ -38,7 +38,7 @@ const getPages = () => {
|
|||
} );
|
||||
}
|
||||
|
||||
if ( window.wcAdminFeatures.dashboard ) {
|
||||
if ( window.wcAdminFeatures[ 'analytics-dashboard' ] ) {
|
||||
pages.push( {
|
||||
container: Dashboard,
|
||||
path: '/',
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"features": {
|
||||
"activity-panels": false,
|
||||
"analytics": false,
|
||||
"dashboard": false,
|
||||
"dashboard/customizable": false,
|
||||
"analytics-dashboard": false,
|
||||
"analytics-dashboard/customizable": false,
|
||||
"devdocs": false,
|
||||
"onboarding": false,
|
||||
"store-alerts": false
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"features": {
|
||||
"activity-panels": true,
|
||||
"analytics": true,
|
||||
"dashboard": true,
|
||||
"dashboard/customizable": true,
|
||||
"analytics-dashboard": true,
|
||||
"analytics-dashboard/customizable": true,
|
||||
"devdocs": true,
|
||||
"onboarding": true,
|
||||
"store-alerts": true
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"features": {
|
||||
"activity-panels": true,
|
||||
"analytics": true,
|
||||
"dashboard": true,
|
||||
"dashboard/customizable": false,
|
||||
"analytics-dashboard": true,
|
||||
"analytics-dashboard/customizable": false,
|
||||
"devdocs": false,
|
||||
"onboarding": false,
|
||||
"store-alerts": true
|
||||
|
|
|
@ -166,7 +166,7 @@ class WC_Admin_Loader {
|
|||
$page_title = null;
|
||||
$menu_title = null;
|
||||
|
||||
if ( self::is_feature_enabled( 'dashboard' ) ) {
|
||||
if ( self::is_feature_enabled( 'analytics-dashboard' ) ) {
|
||||
$page_title = __( 'WooCommerce Dashboard', 'woocommerce-admin' );
|
||||
$menu_title = __( 'Dashboard', 'woocommerce-admin' );
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* WooCommerce Dashboard.
|
||||
* WooCommerce Analytics Dashboard.
|
||||
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
|
||||
*
|
||||
* @package Woocommerce Admin
|
||||
|
@ -9,11 +9,11 @@
|
|||
/**
|
||||
* Contains backend logic for the dashboard feature.
|
||||
*/
|
||||
class WC_Admin_Dashboard {
|
||||
class WC_Admin_Analytics_Dashboard {
|
||||
/**
|
||||
* Class instance.
|
||||
*
|
||||
* @var WC_Admin_Dashboard instance
|
||||
* @var WC_Admin_Analytics_Dashboard instance
|
||||
*/
|
||||
protected static $instance = null;
|
||||
|
||||
|
@ -66,4 +66,4 @@ class WC_Admin_Dashboard {
|
|||
}
|
||||
}
|
||||
|
||||
new WC_Admin_Dashboard();
|
||||
new WC_Admin_Analytics_Dashboard();
|
Loading…
Reference in New Issue