diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-02-18 11:09:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-18 11:09:39 +0300 |
commit | df5c324cde50c473ad2cab4e117333d2803983c6 (patch) | |
tree | 9626dc344afecf5a52cbb2bda316ee70690eb016 /plugins/Dashboard | |
parent | e8cb9c2ae10dceec3fde93acb58569bb8d9c1b59 (diff) |
Add movers and shakers widget to dashboard (#15578)
* Add movers and shakers widget to dashboard
* few fixes
* show movers first
* move dashboard position again
* tests should be fixed
Diffstat (limited to 'plugins/Dashboard')
3 files changed, 12 insertions, 5 deletions
diff --git a/plugins/Dashboard/Dashboard.php b/plugins/Dashboard/Dashboard.php index cf027c6c64..069e6cb969 100644 --- a/plugins/Dashboard/Dashboard.php +++ b/plugins/Dashboard/Dashboard.php @@ -150,9 +150,11 @@ class Dashboard extends \Piwik\Plugin $defaultLayout = $this->getLayoutForUser('', 1); if (empty($defaultLayout)) { + $pluginManager = Plugin\Manager::getInstance(); + $advertisingWidget = ''; $advertising = StaticContainer::get('Piwik\ProfessionalServices\Advertising'); - if ($advertising->areAdsForProfessionalServicesEnabled() && Plugin\Manager::getInstance()->isPluginActivated('ProfessionalServices')) { + if ($advertising->areAdsForProfessionalServicesEnabled() && $pluginManager->isPluginActivated('ProfessionalServices')) { $advertisingWidget = '{"uniqueId":"widgetProfessionalServicespromoServices","parameters":{"module":"ProfessionalServices","action":"promoServices"}},'; } if (Piwik::hasUserSuperUserAccess()) { @@ -160,6 +162,10 @@ class Dashboard extends \Piwik\Plugin } else { $piwikPromoWidget = '{"uniqueId":"widgetCoreHomegetPromoVideo","parameters":{"module":"CoreHome","action":"getPromoVideo"}}'; } + $insightsWidget = ''; + if ($pluginManager->isPluginActivated('Insights')) { + $insightsWidget = '{"uniqueId":"widgetInsightsgetOverallMoversAndShakers","parameters":{"module":"Insights","action":"getOverallMoversAndShakers"}},'; + } $defaultLayout = '[ [ {"uniqueId":"widgetLivewidget","parameters":{"module":"Live","action":"widget"}}, @@ -168,6 +174,7 @@ class Dashboard extends \Piwik\Plugin [ {"uniqueId":"widgetVisitsSummarygetEvolutionGraphforceView1viewDataTablegraphEvolution","parameters":{"forceView":"1","viewDataTable":"graphEvolution","module":"VisitsSummary","action":"getEvolutionGraph"}}, ' . $advertisingWidget . ' + ' . $insightsWidget . ' {"uniqueId":"widgetVisitsSummarygetforceView1viewDataTablesparklines","parameters":{"forceView":"1","viewDataTable":"sparklines","module":"VisitsSummary","action":"get"}} ], [ diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png index 0758e86dee..476dd842f2 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dd7a915297b1e0133b9a4ea0f2582e08de7b25dca0d6e31bc6907bb74aebb31a -size 287727 +oid sha256:3fb778b95d00d90336df9679e96014f513ff058df9f76ea502d023a757bf1285 +size 305893 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_reset.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_reset.png index 32c1ff560d..dffc459de3 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_reset.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_reset.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:66ce0f6234d80c90741d0e9ff99d871c141b403101fee5616a2257bb945c2cc0 -size 281686 +oid sha256:6718ef832b90b5fc4334fdd9f71769931495b0bdcac16a97a726e6cccf64052d +size 350683 |