From: Stas Vilchik Date: Mon, 14 Apr 2014 09:17:35 +0000 (+0600) Subject: SONAR-3113 Fix bugs of cloud chart X-Git-Tag: 4.3~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b2387fc9e0b7074518f9c67b272c946803f3e2bf;p=sonarqube.git SONAR-3113 Fix bugs of cloud chart --- diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/project_file_cloud.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/project_file_cloud.html.erb index 74d6b4a8cee..5d8d44b8f12 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/project_file_cloud.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/project_file_cloud.html.erb @@ -31,7 +31,8 @@ var data = { metrics: { <%= colorMetric.name -%>: { - name: '<%= colorMetric.short_name -%>' + name: '<%= colorMetric.short_name -%>', + direction: <%= colorMetric.direction -%> }, <%= sizeMetric.name -%>: { name: '<%= sizeMetric.short_name -%>' @@ -49,8 +50,8 @@ longName: '<%= escape_javascript row.resource.long_name -%>', qualifier: '<%= escape_javascript row.resource.qualifier -%>', measures: { - <%= colorMetric.name -%>: { val: <%= color ? color.value : 0 -%>, fval: '<%= color ? color.formatted_value : "-" -%>' }, - <%= sizeMetric.name -%>: { val: <%= size ? size.value : 0 -%>, fval: '<%= size ? size.formatted_value : "-" -%>' } + <%= colorMetric.name -%>: { val: <%= color ? color.value : "null" -%>, fval: '<%= color ? color.formatted_value : "-" -%>' }, + <%= sizeMetric.name -%>: { val: <%= size ? size.value : "null" -%>, fval: '<%= size ? size.formatted_value : "-" -%>' } } }, <% end %> diff --git a/sonar-server/src/main/coffee/widgets/word-cloud.coffee b/sonar-server/src/main/coffee/widgets/word-cloud.coffee index ffbb76066bf..8b718ef50b7 100644 --- a/sonar-server/src/main/coffee/widgets/word-cloud.coffee +++ b/sonar-server/src/main/coffee/widgets/word-cloud.coffee @@ -80,11 +80,12 @@ window.SonarWidgets.WordCloud.prototype.update = -> url wordsEnter.attr 'title', (d) => title = d.longName - title += " | #{@metrics()[@colorMetric].name}: #{@getFColorMetric d}" if @getFColorMetric d - title += " | #{@metrics()[@sizeMetric].name}: #{@getFSizeMetric d}" if @getFSizeMetric d + title += " | #{@metrics()[@colorMetric].name}: #{@getFColorMetric d}" if @getColorMetric(d)? + title += " | #{@metrics()[@sizeMetric].name}: #{@getFSizeMetric d}" if @getSizeMetric(d)? title - @words.style 'color', (d) => @color @getColorMetric d + @words.style 'color', (d) => + if @getColorMetric(d)? then @color @getColorMetric d else '#999' @words.style 'font-size', (d) => "#{@size @getSizeMetric d}px" @words.sort (a, b) =>