diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-08-28 12:08:37 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-08-28 12:08:37 +0200 |
commit | 3525bffcbc1cef1515164a7b26303e3fbdf2b194 (patch) | |
tree | ee09ac8f6ea67e2a146c4c376072b33ef7dbe667 /server/sonar-web/src/main/js/libs | |
parent | 166cc8759a3900a1ccdad52b8b1f62f4f721c1a0 (diff) | |
download | sonarqube-3525bffcbc1cef1515164a7b26303e3fbdf2b194.tar.gz sonarqube-3525bffcbc1cef1515164a7b26303e3fbdf2b194.zip |
SONAR-6708 fix sqale colors when drilldown on treemap
Diffstat (limited to 'server/sonar-web/src/main/js/libs')
-rw-r--r-- | server/sonar-web/src/main/js/libs/widgets/base.js | 2 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/libs/widgets/treemap.js | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/server/sonar-web/src/main/js/libs/widgets/base.js b/server/sonar-web/src/main/js/libs/widgets/base.js index 3a788a0d615..a54faa989c9 100644 --- a/server/sonar-web/src/main/js/libs/widgets/base.js +++ b/server/sonar-web/src/main/js/libs/widgets/base.js @@ -45,6 +45,8 @@ if (d.measures[key] != null) { if (d.measures[key].text != null) { return d.measures[key].text; + } else if (d.measures[key].data != null) { + return d.measures[key].data; } else { return d.measures[key].val; } diff --git a/server/sonar-web/src/main/js/libs/widgets/treemap.js b/server/sonar-web/src/main/js/libs/widgets/treemap.js index 5c38af4db18..f56f96df623 100644 --- a/server/sonar-web/src/main/js/libs/widgets/treemap.js +++ b/server/sonar-web/src/main/js/libs/widgets/treemap.js @@ -207,13 +207,7 @@ }; Treemap.prototype.getRatingColorScale = function () { - var domain = [1, 2, 3, 4, 5]; - if (this.components().length > 0) { - var colorMetricSample = this.colorMetric.value(_.first(this.components())); - if (typeof colorMetricSample === 'string') { - domain = ['A', 'B', 'C', 'D', 'E']; - } - } + var domain = ['A', 'B', 'C', 'D', 'E']; return d3.scale.ordinal().domain(domain).range(this.colors5r); }; @@ -272,7 +266,9 @@ component.msr.forEach(function (measure) { measures[measure.key] = { val: measure.val, - fval: measure.frmt_val + fval: measure.frmt_val, + text: measure.text, + data: measure.data }; }); return { |