summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stasvilchik@Stas-Vilchik-iMac.local>2014-12-10 10:18:27 +0100
committerStas Vilchik <stasvilchik@Stas-Vilchik-iMac.local>2014-12-10 10:18:27 +0100
commit71b29ec2839fdcc7c5705c53c896c87c2b16e2ed (patch)
tree4dc28f4ddd8dd6ee84a68eb33b08280f8d5ee83a
parent8da507540a850651299cec5e3ac23e7e9e573219 (diff)
downloadsonarqube-71b29ec2839fdcc7c5705c53c896c87c2b16e2ed.tar.gz
sonarqube-71b29ec2839fdcc7c5705c53c896c87c2b16e2ed.zip
SONAR-5877 Improve consistency of scm tooltips
-rw-r--r--server/sonar-web/src/main/coffee/component-viewer/source.coffee17
-rw-r--r--server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs2
-rw-r--r--server/sonar-web/src/main/hbs/source-viewer/source-viewer-scm-popup.hbs8
-rw-r--r--server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs2
4 files changed, 24 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/coffee/component-viewer/source.coffee b/server/sonar-web/src/main/coffee/component-viewer/source.coffee
index 2b1cc7c3de4..42ae5c05719 100644
--- a/server/sonar-web/src/main/coffee/component-viewer/source.coffee
+++ b/server/sonar-web/src/main/coffee/component-viewer/source.coffee
@@ -1,6 +1,7 @@
define [
'backbone.marionette'
'templates/component-viewer'
+ 'source-viewer/popups/scm-popup'
'component-viewer/coverage-popup'
'component-viewer/duplication-popup'
'component-viewer/time-changes-popup'
@@ -11,6 +12,7 @@ define [
], (
Marionette
Templates
+ SCMPopupView
CoveragePopupView
DuplicationPopupView
TimeChangesPopupView
@@ -41,6 +43,8 @@ define [
'click .js-line-actions': 'highlightLine'
+ 'click .source-line-scm': 'showSCMPopup'
+
'click .source-line-covered': 'showCoveragePopup'
'click .source-line-partially-covered': 'showCoveragePopup'
'click .source-line-uncovered': 'showCoveragePopup'
@@ -205,6 +209,19 @@ define [
row.toggleClass 'component-viewer-header-full'
+ showSCMPopup: (e) ->
+ e.stopPropagation()
+ $('body').click()
+ line = +$(e.currentTarget).closest('[data-line-number]').data 'line-number'
+ row = _.findWhere @options.main.source.get('formattedSource'), lineNumber: line
+ popup = new SCMPopupView
+ triggerEl: $(e.currentTarget)
+ model: new Backbone.Model
+ scmAuthor: row.scm.author
+ scmDate: row.scm.date
+ popup.render()
+
+
showCoveragePopup: (e) ->
e.stopPropagation()
$('body').click()
diff --git a/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs b/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs
index 503605dcddd..dbb80fcf7cf 100644
--- a/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs
+++ b/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs
@@ -54,7 +54,7 @@
<td class="source-meta {{#if scm}}source-line-scm{{/if}}">
{{#if scm}}
{{#ifSCMChanged ../../../../source ../../../lineNumber}}
- <div class="source-line-scm-inner" title="{{scm.author}}&#013;{{dt scm.date}}" data-author="{{scm.author}}"></div>
+ <div class="source-line-scm-inner" data-author="{{scm.author}}"></div>
{{/ifSCMChanged}}
{{/if}}
</td>
diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-scm-popup.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-scm-popup.hbs
index 9eef858a15f..768ea72341d 100644
--- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-scm-popup.hbs
+++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-scm-popup.hbs
@@ -5,9 +5,11 @@
<div class="bubble-popup-section">
{{dt scmDate}}
</div>
- <div class="bubble-popup-section">
- {{scmRevision}}
- </div>
+ {{#if scmRevision}}
+ <div class="bubble-popup-section">
+ {{scmRevision}}
+ </div>
+ {{/if}}
</div>
<div class="bubble-popup-arrow"></div>
diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs
index 51c77b080d7..c58e2a4ad83 100644
--- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs
+++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs
@@ -9,7 +9,7 @@
<td class="source-meta source-line-scm" {{#if line}}data-line-number="{{line}}"{{/if}}>
{{#ifSCMChanged2 ../source line}}
- <div class="source-line-scm-inner" title="{{scmAuthor}} {{scmDate}}" data-author="{{scmAuthor}}"></div>
+ <div class="source-line-scm-inner" data-author="{{scmAuthor}}"></div>
{{/ifSCMChanged2}}
</td>