]> source.dussan.org Git - sonarqube.git/commitdiff
Fix SCM header, add "modified lines" filter
authorStas Vilchik <vilchiks@gmail.com>
Wed, 23 Jul 2014 08:51:31 +0000 (10:51 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 23 Jul 2014 08:51:31 +0000 (10:51 +0200)
sonar-core/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/coffee/component-viewer/header/scm-header.coffee
sonar-server/src/main/coffee/component-viewer/main.coffee
sonar-server/src/main/coffee/component-viewer/mixins/main-scm.coffee
sonar-server/src/main/hbs/component-viewer/header/scm-header.hbs

index a7ee0612df57314e8a172666504d5952fc68faa5..698c89fe519d57cfdc072b5e3f879d9644b5b062 100644 (file)
@@ -2650,6 +2650,8 @@ component_viewer.header.toggle_coverage=Toggle coverage
 component_viewer.header.toggle_duplications=Toggle duplications
 component_viewer.header.toggle_scm=Toggle SCM
 
+component_viewer.scm.modified_lines=Modified Lines
+
 component_viewer.transition.coverage=Covered By
 component_viewer.transition.covers=Covers
 component_viewer.transition.duplication=Duplicated By
index 29e44cfa472412ad18084314f1d30a4487c2d968..07523ce8cf539440149172b8320cb90443ceb859 100644 (file)
@@ -20,6 +20,8 @@ define [
     events:
       'click .js-scm-time-changes': 'scmTimeChanges'
 
+      'click .js-filter-modified-lines': 'filterByModifiedLines'
+
 
     scmTimeChanges: (e) ->
       e.stopPropagation()
@@ -32,5 +34,10 @@ define [
       popup.on 'change', (period) => @main.enablePeriod period
 
 
+    filterByModifiedLines: (e) ->
+      @header.filterLines e, 'filterByModifiedLines'
+      @state.set 'activeHeaderItem', '.js-filter-modified-lines'
+
+
     serializeData: ->
       _.extend super, period: @state.get('period')?.toJSON()
index 32e4cd8697ce653c181acec4f761f0782b761132..f7ebd36315fe7ffdb9d0d6a8a9463a9acadaa5d4 100644 (file)
@@ -301,8 +301,7 @@ define [
       $.when(@requestMeasures(@key, period?.get('key')), @requestIssuesPeriod(@key, period?.get('key')), @requestSCM(@key)).done =>
         if activeHeaderItem?
           @state.set 'activeHeaderItem', activeHeaderItem
-          @headerView.render()
-        else @filterBySCM()
+        @headerView.render()
 
 
     addTransition: (transition, options) ->
index 23c899f185fda465fac3aaade1326a23c01e9fce..d13be6b4e186e787df90942365acecaf63958da8 100644 (file)
@@ -47,6 +47,10 @@ define [], () ->
       @sourceView.render()
 
 
+    filterByModifiedLines: ->
+      @filterBySCM()
+
+
     filterBySCM: ->
       requests = [@requestSCM(@key)]
       if @settings.get('issues') && !@state.get('hasIssues')
@@ -76,4 +80,4 @@ define [], () ->
           @sourceView.addShowBlock scmBlockLine, line.lineNumber - 1
       if predicate
         @sourceView.addShowBlock scmBlockLine, _.size @source.get 'source'
-      @sourceView.render()
\ No newline at end of file
+      @sourceView.render()
index d5802abdd570043d7a0752f5a616bd0bd040bde9..599f9f71e33c732612da18a6d2e2053ecf8fc794 100644 (file)
@@ -2,4 +2,13 @@
   <a class="highlighted-link js-scm-time-changes">
     {{#if period}}Δ {{period.label}}{{else}}<i class="icon-period"></i> {{t 'component_viewer.time_changes'}}{{/if}}
   </a>
-</div>
\ No newline at end of file
+</div>
+
+<div class="component-viewer-header-expanded-bar-section">
+  <ul class="component-viewer-header-expanded-bar-section-list">
+    <li><a class="item js-filter-modified-lines">
+      <span>{{t 'component_viewer.scm.modified_lines'}}</span>
+      <i class="icon-chevron-right"></i>
+    </a></li>
+  </ul>
+</div>