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 | |
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')
8 files changed, 19 insertions, 20 deletions
diff --git a/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page_disable.png b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page_disable.png index 04ed00d9a4..6ce75aabc9 100644 --- a/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page_disable.png +++ b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page_disable.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:182c8776bdf177945552a5845b8e47fb2473b73e274253190e8682b12c50549e -size 177521 +oid sha256:70fa580ddfa5f39ef368a4650ad3a757f7ee8ec342dcafde8da40d3d1bd82ddb +size 184451 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 diff --git a/plugins/Insights/tests/Integration/ApiTest.php b/plugins/Insights/tests/Integration/ApiTest.php index fc53973da5..5c3f616513 100644 --- a/plugins/Insights/tests/Integration/ApiTest.php +++ b/plugins/Insights/tests/Integration/ApiTest.php @@ -246,7 +246,7 @@ class ApiTest extends SystemTestCase $this->assertTrue($this->api->canGenerateInsights('2012-12-12', 'month')); $this->assertFalse($this->api->canGenerateInsights('last10', 'day')); - $this->assertFalse($this->api->canGenerateInsights('2012-11-11,2012-12-12', 'range')); + $this->assertTrue($this->api->canGenerateInsights('2012-11-11,2012-12-12', 'range')); } private function requestInsights($requestParams) diff --git a/plugins/Insights/tests/Integration/ModelTest.php b/plugins/Insights/tests/Integration/ModelTest.php index 7c3edbaf15..01643700f8 100644 --- a/plugins/Insights/tests/Integration/ModelTest.php +++ b/plugins/Insights/tests/Integration/ModelTest.php @@ -122,14 +122,6 @@ class ModelTest extends SystemTestCase $this->model->getLastDate('last10', 'day', 1); } - /** - * @expectedException \Exception - */ - public function test_getLastDate_shouldThrowExceptionInCaseOfRangePeriod() - { - $this->model->getLastDate('2012-11-11,2012-12-12', 'range', 1); - } - public function test_getTotalValue_shouldCalculateTotals() { $total = $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'nb_visits', false); diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_verified.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_verified.png index 02c9c00dbc..b23762e59e 100644 --- a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_verified.png +++ b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_verified.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b837c5b31cc067d7f45970989f6412c2c6d224d12d1e9756e686605aafa20f9 -size 177892 +oid sha256:0eed847c873304a25e3adee98c9ce43c28f8efc1928616e918a6f7b0e707af8f +size 184906 diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step4.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step4.png index 5968874a82..76568db089 100644 --- a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step4.png +++ b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step4.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65e373f1147fbdbe2f97f4083241c776aac3b18848755a1e83f0ae2e0ca84e53 -size 176964 +oid sha256:8e576f1b42887837fe1b9b30436ccd1c9e9088e8db46459c62acd0829f6d3ec9 +size 183745 |