]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5597 When clicking on a tab, automatically select its most important filter
authorStas Vilchik <vilchiks@gmail.com>
Tue, 7 Oct 2014 11:38:14 +0000 (13:38 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 7 Oct 2014 11:38:20 +0000 (13:38 +0200)
server/sonar-web/src/main/coffee/component-viewer/header.coffee
server/sonar-web/src/main/coffee/component-viewer/mixins/main-scm.coffee

index 175a4c592218a2c4dab53c087ac97cd60dd10888..c39e9f1a7e80d82a478b09deca76c7f5adcc5096 100644 (file)
@@ -173,7 +173,11 @@ define [
       unless active
         el.addClass 'active'
         scope = el.data 'scope'
-        @enableBar scope
+        @enableBar(scope).done =>
+          @$('.js-filter-unresolved-issues').click() if scope == 'issues'
+          @$('.js-filter-lines-to-cover').click() if scope == 'coverage'
+          @$('.js-filter-duplications').click() if scope == 'duplications'
+          @$('.js-filter-modified-lines').click() if scope == 'scm'
 
 
     changeSettings: ->
index d13be6b4e186e787df90942365acecaf63958da8..3691672b0b9bbf04caa04f7d57d40935153287bb 100644 (file)
@@ -62,11 +62,11 @@ define [], () ->
     _filterBySCM: () ->
       formattedSource = @source.get 'formattedSource'
       period = @state.get 'period'
+      @settings.set 'scm', true
       unless period?
         return @showAllLines()
       else
         periodDate = period.get 'sinceDate'
-      @settings.set 'scm', true
       @sourceView.resetShowBlocks()
       scmBlockLine = 1
       predicate = false