summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-04-11 11:53:31 +0600
committerStas Vilchik <vilchiks@gmail.com>2014-04-11 11:53:31 +0600
commit60188a78ef473687404d2ea752baa478b0a5e82b (patch)
treefb92e8fbe9dd1d7196b9dbf4a1e4c830ee114291
parent59b162e060a03bf75b59bede08eeaa2ac3645d10 (diff)
downloadsonarqube-60188a78ef473687404d2ea752baa478b0a5e82b.tar.gz
sonarqube-60188a78ef473687404d2ea752baa478b0a5e82b.zip
SONAR-3113 Show max results reached message
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb1
-rw-r--r--sonar-server/src/main/coffee/widgets/word-cloud.coffee11
2 files changed, 11 insertions, 1 deletions
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()