]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6708 fix sqale colors when drilldown on treemap
authorStas Vilchik <vilchiks@gmail.com>
Fri, 28 Aug 2015 10:08:37 +0000 (12:08 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 28 Aug 2015 10:08:37 +0000 (12:08 +0200)
server/sonar-web/src/main/js/libs/widgets/base.js
server/sonar-web/src/main/js/libs/widgets/treemap.js

index 3a788a0d615db1ecc69750d5ebf34b10839ef960..a54faa989c9c0492355d8769af9b09baf5696471 100644 (file)
@@ -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;
           }
index 5c38af4db189ab6a7a82dca7a97200c6a63041f8..f56f96df623a00e52fe8c99e2b29ab339c7c0049 100644 (file)
   };
 
   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);
   };
 
         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 {