diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-06-10 15:58:00 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-06-10 15:58:17 +0200 |
commit | 855ccf78c2eb58c943a1dddf0f45f99e8b3ab08f (patch) | |
tree | 7e1eca790d6383011fd927460172bdd8d8b2b1ab /sonar-server/src/main | |
parent | a7f58d15160d5290b026b719f5cb800fcb750053 (diff) | |
download | sonarqube-855ccf78c2eb58c943a1dddf0f45f99e8b3ab08f.tar.gz sonarqube-855ccf78c2eb58c943a1dddf0f45f99e8b3ab08f.zip |
SONAR-5012 SONAR-5135 Fix handling of selected facets in scroll and bulk
Diffstat (limited to 'sonar-server/src/main')
-rw-r--r-- | sonar-server/src/main/coffee/coding-rules/app.coffee | 20 | ||||
-rw-r--r-- | sonar-server/src/main/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/sonar-server/src/main/coffee/coding-rules/app.coffee b/sonar-server/src/main/coffee/coding-rules/app.coffee index 82bb4dcb150..aab11900a3c 100644 --- a/sonar-server/src/main/coffee/coding-rules/app.coffee +++ b/sonar-server/src/main/coffee/coding-rules/app.coffee @@ -105,8 +105,11 @@ requirejs [ App = new Marionette.Application - App.getQuery = -> - @filterBarView.getQuery() + App.getQuery = (includeFacetsQuery = true) -> + query = @filterBarView.getQuery() + if includeFacetsQuery and @codingRulesFacetsView + _.extend query, @codingRulesFacetsView.getQuery() + query App.restoreSorting = (params) -> @@ -136,19 +139,18 @@ requirejs [ - App.fetchList = (firstPage, fromFacets) -> - query = @getQuery() - fetchQuery = _.extend { p: @pageIndex, ps: 25, facets: !fromFacets }, query + App.fetchList = (firstPage, fromFacets = false) -> + pristineQuery = @getQuery(false) + query = @getQuery(fromFacets) - if @codingRulesFacetsView - _.extend fetchQuery, @codingRulesFacetsView.getQuery() + fetchQuery = _.extend { p: @pageIndex, ps: 25, facets: not fromFacets }, query if @codingRules.sorting && @codingRules.sorting.sort _.extend fetchQuery, s: @codingRules.sorting.sort, asc: @codingRules.sorting.asc - @storeQuery query, @codingRules.sorting + @storeQuery pristineQuery, @codingRules.sorting # Optimize requested fields _.extend fetchQuery, f: 'name,lang,status' @@ -217,7 +219,7 @@ requirejs [ App.fetchList true, fromFacets - App.fetchNextPage = (fromFacets = false) -> + App.fetchNextPage = (fromFacets = true) -> if @pageIndex < @codingRules.paging.pages @pageIndex++ App.fetchList false, fromFacets diff --git a/sonar-server/src/main/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee b/sonar-server/src/main/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee index 47d92f30b18..302fad6bec2 100644 --- a/sonar-server/src/main/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee +++ b/sonar-server/src/main/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee @@ -78,7 +78,7 @@ define [ url: "#{baseUrl}/api/qualityprofiles/#{wsAction}_rules" data: query .done => - @options.app.fetchFirstPage() + @options.app.fetchFirstPage(true) onSubmit: (e) -> |