diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-07-18 16:23:40 +0600 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-07-18 16:23:51 +0600 |
commit | f85bcca528139bc6f7f68de5ad665cb6b8006265 (patch) | |
tree | 6e1c5694fcc994fa8da14a95c5926e59819110f1 /server | |
parent | a0f187f7c05d75b13e2dfa28ec78b96227a596db (diff) | |
download | sonarqube-f85bcca528139bc6f7f68de5ad665cb6b8006265.tar.gz sonarqube-f85bcca528139bc6f7f68de5ad665cb6b8006265.zip |
SONAR-5453 Add a filter to display 'Open' and 'Reopen' issues in the component viewer
Diffstat (limited to 'server')
3 files changed, 17 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/coffee/component-viewer/header/issues-header.coffee b/server/sonar-web/src/main/coffee/component-viewer/header/issues-header.coffee index 05fdb8daa1f..ecfa4b5a918 100644 --- a/server/sonar-web/src/main/coffee/component-viewer/header/issues-header.coffee +++ b/server/sonar-web/src/main/coffee/component-viewer/header/issues-header.coffee @@ -27,6 +27,7 @@ define [ 'click .js-filter-fixed-issues': 'filterByFixedIssues' 'click .js-filter-unresolved-issues': 'filterByUnresolvedIssues' 'click .js-filter-false-positive-issues': 'filterByFalsePositiveIssues' + 'click .js-filter-open-issues': 'filterByOpenIssues' 'click .js-filter-BLOCKER-issues': 'filterByBlockerIssues' 'click .js-filter-CRITICAL-issues': 'filterByCriticalIssues' 'click .js-filter-MAJOR-issues': 'filterByMajorIssues' @@ -86,6 +87,11 @@ define [ @state.set 'activeHeaderItem', '.js-filter-false-positive-issues' + filterByOpenIssues: (e) -> + @header.filterLines e, 'filterByOpenIssues' + @state.set 'activeHeaderItem', '.js-filter-open-issues' + + filterByRule: (e) -> rule = $(e.currentTarget).data 'rule' @header.filterLines e, 'filterByRule', rule @@ -120,4 +126,4 @@ define [ serializeData: -> _.extend super, period: @state.get('period')?.toJSON() - hasIssues: @state.get('severities')?.length || @state.get('rules')?.length
\ No newline at end of file + hasIssues: @state.get('severities')?.length || @state.get('rules')?.length diff --git a/server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee b/server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee index 8e38c7f2d39..9feefc4770d 100644 --- a/server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee +++ b/server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee @@ -119,6 +119,9 @@ define [ # False Positive filterByFalsePositiveIssues: -> @filterByIssues (issue) -> issue.resolution == 'FALSE-POSITIVE' + # Open/Reopened Issues + filterByOpenIssues: -> @filterByIssues (issue) -> issue.status == 'OPEN' || issue.status == 'REOPENED' + # Rule filterByRule: (rule) -> @filterByIssues (issue) -> issue.rule == rule && !issue.resolution diff --git a/server/sonar-web/src/main/hbs/component-viewer/header/issues-header.hbs b/server/sonar-web/src/main/hbs/component-viewer/header/issues-header.hbs index 8729e3714b9..91ba1ecc927 100644 --- a/server/sonar-web/src/main/hbs/component-viewer/header/issues-header.hbs +++ b/server/sonar-web/src/main/hbs/component-viewer/header/issues-header.hbs @@ -8,7 +8,7 @@ <div class="component-viewer-header-expanded-bar-section"> <div class="component-viewer-header-expanded-bar-section-title"> - {{#if hasIssues}}{{t 'component_viewer.measure_section.resolutions'}}{{else}}{{t 'component_viewer.no_issues'}}{{/if}} + {{#if hasIssues}}{{t 'component_viewer.measure_section.filters'}}{{else}}{{t 'component_viewer.no_issues'}}{{/if}} </div> <ul class="component-viewer-header-expanded-bar-section-list"> {{#if currentIssue}} @@ -24,6 +24,12 @@ </a></li> {{/unless}} {{#unless state.removed}} + <li><a class="item js-filter-open-issues"> + <span>{{t 'component_viewer.issues.open_issues'}}</span> + <i class="icon-chevron-right"></i> + </a></li> + {{/unless}} + {{#unless state.removed}} <li><a class="item js-filter-fixed-issues"> <span>{{t 'component_viewer.issues.fixed_issues'}}</span> <i class="icon-chevron-right"></i> |