aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-03-25 17:58:38 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-03-25 17:58:44 +0100
commit4e7741e68d6a0153d42d1a8b1d0c4ef16ad4a664 (patch)
tree422d6bd39dc90eb5d9c47faa577eed37ba8d04ef
parent10123aa997853b3841d1282635bd2035793dc3cb (diff)
downloadsonarqube-4e7741e68d6a0153d42d1a8b1d0c4ef16ad4a664.tar.gz
sonarqube-4e7741e68d6a0153d42d1a8b1d0c4ef16ad4a664.zip
SONAR-7402 improve display of ratings
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/Measure.js2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js9
2 files changed, 3 insertions, 8 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js b/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js
index 755d5eb20d9..7eec6eff935 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js
@@ -41,7 +41,7 @@ const Measure = ({ measure, metric }) => {
return (
<span>
- {formattedValue}
+ {formattedValue != null ? formattedValue : '–'}
</span>
);
};
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js
index 8d3678ea57e..2b030cc6feb 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js
@@ -19,18 +19,13 @@
*/
import React from 'react';
-import { formatMeasure } from '../../../../helpers/measures';
-import { isDiffMetric, formatLeak } from '../../utils';
+import Measure from '../../components/Measure';
const MeasureCell = ({ component, metric }) => {
- const value = isDiffMetric(metric) ?
- formatLeak(component.leak, metric) :
- formatMeasure(component.value, metric.type);
-
return (
<td className="thin nowrap text-right">
<span id={'component-measures-component-measure-' + component.key}>
- {value != null ? value : '–'}
+ <Measure measure={{ value: component.value, leak: component.leak }} metric={metric}/>
</span>
</td>
);