From: Stas Vilchik Date: Fri, 11 Apr 2014 05:53:31 +0000 (+0600) Subject: SONAR-3113 Show max results reached message X-Git-Tag: 4.3~54 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=60188a78ef473687404d2ea752baa478b0a5e82b;p=sonarqube.git SONAR-3113 Show max results reached message --- diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb index da50f56ff13..09802817494 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb @@ -43,6 +43,7 @@ .metricsPriority(metrics) .options({ reverseColor: <%= reverseColor -%>, + maxItemsReachedMessage: '<%= message("widget.measure_filter_histogram.max_items_reached", :params => [maxItems]) -%>', baseUrl: baseUrl + '/dashboard/index/', noData: '<%= message('no_data') -%>' }) diff --git a/sonar-server/src/main/coffee/widgets/word-cloud.coffee b/sonar-server/src/main/coffee/widgets/word-cloud.coffee index 21ecefb2ff2..ec1658316b6 100644 --- a/sonar-server/src/main/coffee/widgets/word-cloud.coffee +++ b/sonar-server/src/main/coffee/widgets/word-cloud.coffee @@ -21,6 +21,7 @@ window.SonarWidgets.WordCloud = -> @_legendWidth = window.SonarWidgets.WordCloud.defaults.legendWidth @_legendMargin = window.SonarWidgets.WordCloud.defaults.legendMargin @_detailsWidth = window.SonarWidgets.WordCloud.defaults.detailsWidth + @_maxResultsReached = false @_options = {} @_lineHeight = 20 @@ -35,6 +36,7 @@ window.SonarWidgets.WordCloud = -> @legendWidth = (_) -> param.call(this, '_legendWidth', _) @legendMargin = (_) -> param.call(this, '_legendMargin', _) @detailsWidth = (_) -> param.call(this, '_detailsWidth', _) + @maxResultsReached = (_) -> param.call(this, '_maxResultsReached', _) @options = (_) -> param.call(this, '_options', _) @ @@ -87,7 +89,14 @@ window.SonarWidgets.WordCloud.prototype.update = -> @words.sort (a, b) => if a.name.toLowerCase() > b.name.toLowerCase() then 1 else -1 - console.log @words + # Show maxResultsReached message + if @maxResultsReached() + @maxResultsReachedLabel.remove() if @maxResultsReachedLabel? + @maxResultsReachedLabel = @box.append('div').text @options().maxItemsReachedMessage + @maxResultsReachedLabel.style 'color', '#777' + @maxResultsReachedLabel.style 'font-size', '12px' + @maxResultsReachedLabel.style 'text-align', 'center' + @maxResultsReachedLabel.style 'margin-top', '10px' @words.exit().remove()