containerId = 'issue-tag-cloud' + widget.id.to_s
maxItems = widget_properties['maxItems'].to_i
- if current_user && has_role?(:user, @project)
+ if current_user && has_role?(:user, @project) && !Internal.issues.listTagsForComponent(@project.uuid, maxItems).isEmpty()
search_options = {}
if @project
search_options['componentUuids'] = @project.uuid
renderWords: ->
- words = @wordContainer.selectAll('.cloud-word').data @tags()
+ window.requestMessages().done =>
+ words = @wordContainer.selectAll('.cloud-word').data @tags()
- wordsEnter = words.enter().append('a').classed 'cloud-word', true
- wordsEnter.text (d) -> d.key
- wordsEnter.attr 'href', (d) =>
- url = @options().baseUrl + '|tags=' + d.key
- url
- wordsEnter.attr 'title', (d) => @tooltip d
+ wordsEnter = words.enter().append('a').classed 'cloud-word', true
+ wordsEnter.text (d) -> d.key
+ wordsEnter.attr 'href', (d) =>
+ url = @options().baseUrl + '|tags=' + d.key
+ url
+ wordsEnter.attr 'title', (d) => @tooltip d
- words.style 'font-size', (d) =>
- "#{@size d.value}px"
+ words.style 'font-size', (d) =>
+ "#{@size d.value}px"
- words.sort (a, b) =>
- if a.key.toLowerCase() > b.key.toLowerCase() then 1 else -1
+ words.sort (a, b) =>
+ if a.key.toLowerCase() > b.key.toLowerCase() then 1 else -1
render: (container) ->
tooltip: (d) ->
- "#{d.key} (#{d.value})"
+ suffixKey = if d.value == 1 then 'issue' else 'issues'
+ suffix = t(suffixKey)
+ "#{d.value} " + suffix
parseSource: (response) ->
widget.issue_filter.property.displayFilterDescription.name=Display Filter Description
widget.issue_filter.unknown_filter_warning=This widget is configured to display an issue filter that doesn't exist anymore.
-widget.issue_tag_cloud.name=Issue Tag Cloud
+widget.issue_tag_cloud.name=Project Issue Tag Cloud
widget.issue_tag_cloud.description=Displays the cloud of tags associated to unresolved issues.
widget.issue_tag_cloud.property.maxItems.name=Max Tags
widget.issue_tag_cloud.property.maxItems.desc=Maximum number of tags to show