diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-07-23 10:51:31 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-07-23 10:51:31 +0200 |
commit | 1e17189d70805099efd4a770e9cc5e35b9795548 (patch) | |
tree | 8a50ac3ea20f0c49a40c805467d7ea161cf5a926 /sonar-server | |
parent | 8c41e822e3a24b4f2504a15330188ce609d3b573 (diff) | |
download | sonarqube-1e17189d70805099efd4a770e9cc5e35b9795548.tar.gz sonarqube-1e17189d70805099efd4a770e9cc5e35b9795548.zip |
Fix SCM header, add "modified lines" filter
Diffstat (limited to 'sonar-server')
4 files changed, 23 insertions, 4 deletions
diff --git a/sonar-server/src/main/coffee/component-viewer/header/scm-header.coffee b/sonar-server/src/main/coffee/component-viewer/header/scm-header.coffee index 29e44cfa472..07523ce8cf5 100644 --- a/sonar-server/src/main/coffee/component-viewer/header/scm-header.coffee +++ b/sonar-server/src/main/coffee/component-viewer/header/scm-header.coffee @@ -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() diff --git a/sonar-server/src/main/coffee/component-viewer/main.coffee b/sonar-server/src/main/coffee/component-viewer/main.coffee index 32e4cd8697c..f7ebd36315f 100644 --- a/sonar-server/src/main/coffee/component-viewer/main.coffee +++ b/sonar-server/src/main/coffee/component-viewer/main.coffee @@ -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) -> diff --git a/sonar-server/src/main/coffee/component-viewer/mixins/main-scm.coffee b/sonar-server/src/main/coffee/component-viewer/mixins/main-scm.coffee index 23c899f185f..d13be6b4e18 100644 --- a/sonar-server/src/main/coffee/component-viewer/mixins/main-scm.coffee +++ b/sonar-server/src/main/coffee/component-viewer/mixins/main-scm.coffee @@ -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() diff --git a/sonar-server/src/main/hbs/component-viewer/header/scm-header.hbs b/sonar-server/src/main/hbs/component-viewer/header/scm-header.hbs index d5802abdd57..599f9f71e33 100644 --- a/sonar-server/src/main/hbs/component-viewer/header/scm-header.hbs +++ b/sonar-server/src/main/hbs/component-viewer/header/scm-header.hbs @@ -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> |