From 84e2530c81ddad5e042d431f76f175a99417fd30 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 1 Jul 2014 23:24:18 +0600 Subject: [PATCH] SONAR-5209 Bug on "FP" or "Resolve" action --- .../main/coffee/component-viewer/source.coffee | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sonar-server/src/main/coffee/component-viewer/source.coffee b/sonar-server/src/main/coffee/component-viewer/source.coffee index 64567a8f84a..d0bad4a9182 100644 --- a/sonar-server/src/main/coffee/component-viewer/source.coffee +++ b/sonar-server/src/main/coffee/component-viewer/source.coffee @@ -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 '
' -- 2.39.5