]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5209 Bug on "FP" or "Resolve" action
authorStas Vilchik <vilchiks@gmail.com>
Tue, 1 Jul 2014 17:24:18 +0000 (23:24 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 1 Jul 2014 17:24:18 +0000 (23:24 +0600)
sonar-server/src/main/coffee/component-viewer/source.coffee

index 64567a8f84af0f7c748a9a475a87f4e855a1c996..d0bad4a91820b7c2c9d255448b9894a4fe495f13 100644 (file)
@@ -116,9 +116,11 @@ define [
           container = row.children('.line')
           container.addClass 'issue' if line > 0
           if rendered < ISSUES_LIMIT
-            issueView = new IssueView model: new Issue issue
+            issueModel = new Issue issue
+            issueView = new IssueView model: issueModel
             issueView.render().$el.appendTo container
             issueView.on 'reset', =>
+              @updateIssue issueModel
               @options.main.requestComponent(@options.main.key, false, false).done =>
                 @options.main.headerView.silentUpdate = true
                 @options.main.headerView.render()
@@ -126,6 +128,18 @@ define [
             row.prop 'title', tp('component_viewer.issues_limit_reached_tooltip', issue.message)
 
 
+    updateIssue: (issueModel) ->
+      issues = @model.get 'issues'
+      issues = _.reject issues, (issue) -> issue.key == issueModel.get('key')
+      issues.push issueModel.toJSON()
+      @model.set 'issues', issues
+
+      issues = @model.get 'activeIssues'
+      issues = _.reject issues, (issue) -> issue.key == issueModel.get('key')
+      issues.push issueModel.toJSON()
+      @model.set 'activeIssues', issues
+
+
     showSpinner: ->
       @$el.html '<div style="padding: 10px;"><i class="spinner"></i></div>'