From e0ae4a26c5dad932325b50de173d845688f89dbd Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 28 Oct 2016 09:38:30 +0200 Subject: [PATCH] SONAR-8324 Fix maintainability rating tooltip --- server/sonar-web/src/main/js/helpers/measures.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/js/helpers/measures.js b/server/sonar-web/src/main/js/helpers/measures.js index 9771331973b..8473c9e49ed 100644 --- a/server/sonar-web/src/main/js/helpers/measures.js +++ b/server/sonar-web/src/main/js/helpers/measures.js @@ -266,7 +266,7 @@ function shouldDisplayDays (days) { return days > 0; } -function shouldDisplayDaysInShortFormat(days) { +function shouldDisplayDaysInShortFormat (days) { return days > 0.9; } @@ -366,7 +366,6 @@ function shortDurationVariationFormatter (value) { return formatted[0] !== '-' ? '+' + formatted : formatted; } - let maintainabilityRatingGrid; function getMaintainabilityRatingGrid () { if (maintainabilityRatingGrid) { @@ -395,7 +394,8 @@ function getMaintainabilityRatingTooltip (rating) { if (rating < 2) { return translateWithParameters( 'metric.sqale_rating.tooltip.A', - `${maintainabilityGrid[0]}%`); + formatMeasure(maintainabilityGrid[0] * 100, 'PERCENT') + ); } const ratingLetter = formatMeasure(rating, 'RATING'); @@ -403,7 +403,8 @@ function getMaintainabilityRatingTooltip (rating) { return translateWithParameters( 'metric.sqale_rating.tooltip', ratingLetter, - `${maintainabilityRatingThreshold}%`); + formatMeasure(maintainabilityRatingThreshold * 100, 'PERCENT') + ); } export function getRatingTooltip (metricKey, value) { -- 2.39.5