diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-03-21 03:56:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-21 03:56:59 +0300 |
commit | cd541083f351a2712e58fa83a2c54861a92c120e (patch) | |
tree | 77565759a0ca8cad23422c645a76c4a7a6b3cf57 /plugins/CoreHome/angularjs/common | |
parent | 53b56ded3e575a23bf42d17b867d934945c0e3d1 (diff) |
[Vue] migrate multisites plugin components to vue (#18939)
* migrate multisites site directive to vue
* migrate multisites dashboard service to store
* migrate evolution filter and migrate multisites dashboard directive to vue
* get to work in UI w/o error
* remove todo
* fixing UI tests
* add some spacing
* fix css tweak
* update expected screenshots
* correct href binding
* apply review feedback
* rebuild MultiSites
Diffstat (limited to 'plugins/CoreHome/angularjs/common')
-rw-r--r-- | plugins/CoreHome/angularjs/common/filters/evolution.js | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/plugins/CoreHome/angularjs/common/filters/evolution.js b/plugins/CoreHome/angularjs/common/filters/evolution.js index d3ba61259b..14adb00db1 100644 --- a/plugins/CoreHome/angularjs/common/filters/evolution.js +++ b/plugins/CoreHome/angularjs/common/filters/evolution.js @@ -8,42 +8,8 @@ angular.module('piwikApp.filter').filter('evolution', evolutionFilter); function evolutionFilter() { - - function calculateEvolution(currentValue, pastValue) - { - pastValue = parseInt(pastValue, 10); - currentValue = parseInt(currentValue, 10) - pastValue; - - var evolution; - - if (currentValue === 0 || isNaN(currentValue)) { - evolution = 0; - } else if (pastValue === 0 || isNaN(pastValue)) { - evolution = 100; - } else { - evolution = (currentValue / pastValue) * 100; - } - - return evolution; - } - - function formatEvolution(evolution) - { - evolution = Math.round(evolution); - - if (evolution > 0) { - evolution = '+' + evolution; - } - - evolution += '%'; - - return evolution; - } - return function(currentValue, pastValue) { - var evolution = calculateEvolution(currentValue, pastValue); - - return formatEvolution(evolution); + return window.CoreHome.getFormattedEvolution(currentValue, pastValue); }; } })(); |