From d51845930ac2f2bbce86385f42f196cbe3f3ddf7 Mon Sep 17 00:00:00 2001 From: Timmy Crawford Date: Wed, 8 May 2019 09:10:05 -0700 Subject: [PATCH] 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. --- .../client/dashboard/components/section-controls/index.js | 2 +- .../client/dashboard/dashboard-charts/index.js | 2 +- plugins/woocommerce-admin/client/dashboard/index.js | 2 +- .../client/dashboard/leaderboards/index.js | 2 +- .../client/dashboard/store-performance/index.js | 2 +- plugins/woocommerce-admin/client/layout/controller.js | 2 +- plugins/woocommerce-admin/config/core.json | 4 ++-- plugins/woocommerce-admin/config/development.json | 4 ++-- plugins/woocommerce-admin/config/plugin.json | 4 ++-- .../woocommerce-admin/includes/class-wc-admin-loader.php | 2 +- .../class-wc-admin-analytics-dashboard.php} | 8 ++++---- 11 files changed, 17 insertions(+), 17 deletions(-) rename plugins/woocommerce-admin/includes/features/{dashboard/class-wc-admin-dashboard.php => analytics-dashboard/class-wc-admin-analytics-dashboard.php} (90%) diff --git a/plugins/woocommerce-admin/client/dashboard/components/section-controls/index.js b/plugins/woocommerce-admin/client/dashboard/components/section-controls/index.js index 8c5932a9ae0..870bb18996a 100644 --- a/plugins/woocommerce-admin/client/dashboard/components/section-controls/index.js +++ b/plugins/woocommerce-admin/client/dashboard/components/section-controls/index.js @@ -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; } diff --git a/plugins/woocommerce-admin/client/dashboard/dashboard-charts/index.js b/plugins/woocommerce-admin/client/dashboard/dashboard-charts/index.js index 26f69e1e8eb..3813bf74100 100644 --- a/plugins/woocommerce-admin/client/dashboard/dashboard-charts/index.js +++ b/plugins/woocommerce-admin/client/dashboard/dashboard-charts/index.js @@ -64,7 +64,7 @@ class DashboardCharts extends Component { label={ __( 'Choose which charts to display', 'woocommerce-admin' ) } renderContent={ ( { onToggle } ) => ( - { window.wcAdminFeatures[ 'dashboard/customizable' ] && ( + { window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] && (
; } diff --git a/plugins/woocommerce-admin/client/dashboard/leaderboards/index.js b/plugins/woocommerce-admin/client/dashboard/leaderboards/index.js index 6b2d0d034ea..514db7a8231 100644 --- a/plugins/woocommerce-admin/client/dashboard/leaderboards/index.js +++ b/plugins/woocommerce-admin/client/dashboard/leaderboards/index.js @@ -62,7 +62,7 @@ class Leaderboards extends Component { ) } renderContent={ ( { onToggle } ) => ( - { window.wcAdminFeatures[ 'dashboard/customizable' ] && ( + { window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] && (
( - { window.wcAdminFeatures[ 'dashboard/customizable' ] && ( + { window.wcAdminFeatures[ 'analytics-dashboard/customizable' ] && (
{ } ); } - if ( window.wcAdminFeatures.dashboard ) { + if ( window.wcAdminFeatures[ 'analytics-dashboard' ] ) { pages.push( { container: Dashboard, path: '/', diff --git a/plugins/woocommerce-admin/config/core.json b/plugins/woocommerce-admin/config/core.json index c22718742d5..fbe7589ca25 100644 --- a/plugins/woocommerce-admin/config/core.json +++ b/plugins/woocommerce-admin/config/core.json @@ -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 diff --git a/plugins/woocommerce-admin/config/development.json b/plugins/woocommerce-admin/config/development.json index 45b05766574..f07fe454530 100644 --- a/plugins/woocommerce-admin/config/development.json +++ b/plugins/woocommerce-admin/config/development.json @@ -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 diff --git a/plugins/woocommerce-admin/config/plugin.json b/plugins/woocommerce-admin/config/plugin.json index d93bef7e214..97c8785343e 100644 --- a/plugins/woocommerce-admin/config/plugin.json +++ b/plugins/woocommerce-admin/config/plugin.json @@ -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 diff --git a/plugins/woocommerce-admin/includes/class-wc-admin-loader.php b/plugins/woocommerce-admin/includes/class-wc-admin-loader.php index 38f37fdb077..b341804fa1c 100644 --- a/plugins/woocommerce-admin/includes/class-wc-admin-loader.php +++ b/plugins/woocommerce-admin/includes/class-wc-admin-loader.php @@ -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' ); } diff --git a/plugins/woocommerce-admin/includes/features/dashboard/class-wc-admin-dashboard.php b/plugins/woocommerce-admin/includes/features/analytics-dashboard/class-wc-admin-analytics-dashboard.php similarity index 90% rename from plugins/woocommerce-admin/includes/features/dashboard/class-wc-admin-dashboard.php rename to plugins/woocommerce-admin/includes/features/analytics-dashboard/class-wc-admin-analytics-dashboard.php index aa5d208570f..518f01d654f 100644 --- a/plugins/woocommerce-admin/includes/features/dashboard/class-wc-admin-dashboard.php +++ b/plugins/woocommerce-admin/includes/features/analytics-dashboard/class-wc-admin-analytics-dashboard.php @@ -1,6 +1,6 @@