From 3525bffcbc1cef1515164a7b26303e3fbdf2b194 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 28 Aug 2015 12:08:37 +0200 Subject: SONAR-6708 fix sqale colors when drilldown on treemap --- server/sonar-web/src/main/js/libs/widgets/base.js | 2 ++ server/sonar-web/src/main/js/libs/widgets/treemap.js | 12 ++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'server/sonar-web') 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 { -- cgit v1.2.3