From c0ea0f9938136275c9369231ee1386024d7543be Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 28 Nov 2014 16:20:06 +0100 Subject: [PATCH] SONAR-5718 Apply feedback --- .../src/main/coffee/issue/issue-view.coffee | 7 ++ .../issue/views/more-actions-view.coffee | 9 -- .../issues/component-viewer/main.coffee | 2 - .../src/main/coffee/issues/controller.coffee | 2 + .../src/main/hbs/issue/issue-more-actions.hbs | 3 - server/sonar-web/src/main/hbs/issue/issue.hbs | 38 ++++--- .../hbs/issues/issues-workspace-header.hbs | 2 +- .../source-viewer-coverage-popup.hbs | 14 ++- .../source-viewer/source-viewer-scm-popup.hbs | 13 +++ .../main/hbs/source-viewer/source-viewer.hbs | 9 +- .../js/source-viewer/popups/coverage-popup.js | 8 +- .../source-viewer/popups/duplication-popup.js | 2 +- .../main/js/source-viewer/popups/scm-popup.js | 23 +++++ .../src/main/js/source-viewer/viewer.js | 99 +++++++++---------- .../src/main/less/components/source.less | 19 ++++ server/sonar-web/src/main/less/issues.less | 2 - .../resources/org/sonar/l10n/core.properties | 5 + 17 files changed, 164 insertions(+), 93 deletions(-) create mode 100644 server/sonar-web/src/main/hbs/source-viewer/source-viewer-scm-popup.hbs create mode 100644 server/sonar-web/src/main/js/source-viewer/popups/scm-popup.js diff --git a/server/sonar-web/src/main/coffee/issue/issue-view.coffee b/server/sonar-web/src/main/coffee/issue/issue-view.coffee index 24ea55f22de..a747345efd2 100644 --- a/server/sonar-web/src/main/coffee/issue/issue-view.coffee +++ b/server/sonar-web/src/main/coffee/issue/issue-view.coffee @@ -252,3 +252,10 @@ define [ ruleOverlay = new RuleOverlay model: new Backbone.Model r.rule ruleOverlay.render() + + + serializeData: -> + componentKey = encodeURIComponent @model.get 'component' + issueKey = encodeURIComponent @model.get 'key' + _.extend super, + permalink: "#{baseUrl}/component/index#component=#{componentKey}¤tIssue=#{issueKey}" diff --git a/server/sonar-web/src/main/coffee/issue/views/more-actions-view.coffee b/server/sonar-web/src/main/coffee/issue/views/more-actions-view.coffee index 8322e90a61c..19d3a72a688 100644 --- a/server/sonar-web/src/main/coffee/issue/views/more-actions-view.coffee +++ b/server/sonar-web/src/main/coffee/issue/views/more-actions-view.coffee @@ -6,8 +6,6 @@ define [ PopupView ) -> - $ = jQuery - class extends PopupView template: Templates['issue-more-actions'] @@ -20,10 +18,3 @@ define [ action: (e) -> actionKey = $(e.currentTarget).data 'action' @options.detailView.action actionKey - - - serializeData: -> - componentKey = encodeURIComponent @model.get 'component' - issueKey = encodeURIComponent @model.get 'key' - _.extend super, - permalink: "#{baseUrl}/component/index#component=#{componentKey}¤tIssue=#{issueKey}" diff --git a/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee b/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee index e3143ceebdd..098e878aa45 100644 --- a/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee +++ b/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee @@ -157,7 +157,6 @@ define [ requestIssues: -> - console.log 'Request issues' if @options.app.issues.last().get('component') == @model.get('key') r = @options.app.controller.fetchNextPage() else r = $.Deferred().resolve().promise() @@ -165,7 +164,6 @@ define [ @issues.reset @options.app.issues.filter (issue) => issue.get('component') == @model.key() @issues.reset @limitIssues @issues @addIssuesPerLineMeta @issues - console.log 'Issues loaded' renderIssue: (issue) -> diff --git a/server/sonar-web/src/main/coffee/issues/controller.coffee b/server/sonar-web/src/main/coffee/issues/controller.coffee index 6d8d43b094f..1e2a5800e58 100644 --- a/server/sonar-web/src/main/coffee/issues/controller.coffee +++ b/server/sonar-web/src/main/coffee/issues/controller.coffee @@ -210,6 +210,8 @@ define [ closeComponentViewer: -> key.setScope 'list' + # close all popups + $('body').click() @options.app.state.unset 'component' @options.app.layout.workspaceComponentViewerRegion.reset() @options.app.layout.hideComponentViewer() diff --git a/server/sonar-web/src/main/hbs/issue/issue-more-actions.hbs b/server/sonar-web/src/main/hbs/issue/issue-more-actions.hbs index 396ee6f6764..18917b5f9c1 100644 --- a/server/sonar-web/src/main/hbs/issue/issue-more-actions.hbs +++ b/server/sonar-web/src/main/hbs/issue/issue-more-actions.hbs @@ -1,7 +1,4 @@