diff options
author | Stefan Giehl <stefan@matomo.org> | 2019-12-09 21:48:51 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2019-12-09 21:48:51 +0300 |
commit | bcc315f764e4456dd3cd65bdf51f9d619d8f4911 (patch) | |
tree | ea3ab854b4891533e148cb5f3cf405813608d2d1 | |
parent | 0f972a600384d8dee0d5b69304f86980f0a42209 (diff) |
remove unnecessary number format in visit summary (#15218)
* remove unnecessary number format in visit summary
* updates UI tests
6 files changed, 10 insertions, 37 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 05683af5ff..5c798816e7 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:97503e3ca82a33d2549826b93e98bdeb57f0c63808646469374eff00ee3d4932 -size 183612 +oid sha256:1d561093a3d75de90996f2cc2e46ba72c181cfa7186f307267e08a3ea3055432 +size 183405 diff --git a/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_custom_segment.png b/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_custom_segment.png index ba7c566010..a1372ad5fb 100644 --- a/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_custom_segment.png +++ b/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_custom_segment.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd5e092fb0f2d3086c0d9457b469200105151b6f5bfc6862dd0ae64a248e7fa9 -size 57503 +oid sha256:1d039b8f35f1b4b3a319700cc969f7fa918b7286edad4120275165df2517401d +size 57245 diff --git a/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png b/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png index ba7c566010..a1372ad5fb 100644 --- a/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png +++ b/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd5e092fb0f2d3086c0d9457b469200105151b6f5bfc6862dd0ae64a248e7fa9 -size 57503 +oid sha256:1d039b8f35f1b4b3a319700cc969f7fa918b7286edad4120275165df2517401d +size 57245 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 bc4256114e..8f6b109c3e 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:724df3086f9c615c3ad82ec8080cdb68a71199a715e52cf9cf975a9dd3295c7d -size 184091 +oid sha256:5208b9f5357685bee38a8c97544368bcfeb4c7b9c0ebe0c2a61e3a85d791c01a +size 183858 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 edbe5f6be0..395edfff42 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:11826296ea064fe5ecc1c54509621eb47ba44f2d8748e60ccf2aac11317fd9fe -size 183102 +oid sha256:703af3646babff2759ce67616d462b155b49c99b2b3b71247d3a45d6c5042380 +size 182971 diff --git a/plugins/VisitsSummary/Reports/Get.php b/plugins/VisitsSummary/Reports/Get.php index 9bb7b017ab..2288e90e68 100644 --- a/plugins/VisitsSummary/Reports/Get.php +++ b/plugins/VisitsSummary/Reports/Get.php @@ -101,33 +101,6 @@ class Get extends \Piwik\Plugin\Report if (!is_numeric($nbUsers) || 0 >= $nbUsers) { $view->config->replaceSparklineMetric(array('nb_users'), ''); } - - $avgGenerationTime = $firstRow->getColumn('avg_time_generation'); - if (false === $avgGenerationTime) { - // fix avgGenerationTime is not formatted if value is false - /** @var Formatter $formatter */ - $formatter = StaticContainer::get('Piwik\Metrics\Formatter'); - $avgGenerationTime = $formatter->getPrettyTimeFromSeconds($avgGenerationTime, true); - $firstRow->setColumn('avg_time_generation', $avgGenerationTime); - } - - $numberMetrics = array('nb_visits', 'nb_uniq_visitors', 'nb_users', 'nb_actions', - 'nb_pageviews', 'nb_uniq_pageviews', 'nb_searches', 'nb_keywords', 'nb_downloads', - 'nb_uniq_downloads', 'nb_outlinks', 'nb_uniq_outlinks', 'max_actions'); - foreach ($numberMetrics as $metric) { - $value = $firstRow->getColumn($metric); - if (false !== $value) { - $firstRow->setColumn($metric, $numberFormatter->formatNumber($value)); - } - } - $value = $firstRow->getColumn('bounce_rate'); - if (false !== $value) { - $firstRow->setColumn('bounce_rate', $numberFormatter->formatPercent($value, $precision = 1)); - } - $value = $firstRow->getColumn('nb_actions_per_visit'); - if (false !== $value) { - $firstRow->setColumn('nb_actions_per_visit', $numberFormatter->formatNumber($value, $maxFraction = 1)); - } }; } } |