From: Stas Vilchik Date: Wed, 15 Oct 2014 09:09:45 +0000 (+0200) Subject: SONAR-5727 The bulk operation can be desynchronized with the criteria of the issue... X-Git-Tag: 4.5.1-RC1~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f2b5fac2fb13ae7949ab449da368c167428e0ea0;p=sonarqube.git SONAR-5727 The bulk operation can be desynchronized with the criteria of the issue filter --- diff --git a/server/sonar-web/src/main/js/issues/app.js b/server/sonar-web/src/main/js/issues/app.js index 861636f8089..63b329ead76 100644 --- a/server/sonar-web/src/main/js/issues/app.js +++ b/server/sonar-web/src/main/js/issues/app.js @@ -438,11 +438,15 @@ requirejs( NavigatorApp.getQuery = function (withoutId) { - var query = this.filterBarView.getQuery(); - if (!withoutId && this.favoriteFilter.id) { - query['id'] = this.favoriteFilter.id; + if (this.filterBarView) { + var query = this.filterBarView.getQuery(); + if (!withoutId && this.favoriteFilter.id) { + query['id'] = this.favoriteFilter.id; + } + return query; + } else { + return {}; } - return query; }; diff --git a/server/sonar-web/src/main/js/issues/extra.js b/server/sonar-web/src/main/js/issues/extra.js index 7edfb0ece40..5aa0662a43e 100644 --- a/server/sonar-web/src/main/js/issues/extra.js +++ b/server/sonar-web/src/main/js/issues/extra.js @@ -372,14 +372,18 @@ define( serializeData: function () { - var data = Marionette.ItemView.prototype.serializeData.apply(this, arguments); + var data = Marionette.ItemView.prototype.serializeData.apply(this, arguments), + bulkChangeData = this.options.app.getQuery(true), + bulkChangeQuery = _.map(bulkChangeData,function (v, k) { + return [k, encodeURIComponent(v)].join('='); + }).join('&'); return _.extend(data || {}, { paging: this.collection.paging, sorting: this.collection.sorting, maxResultsReached: this.collection.maxResultsReached, appState: window.SS.appState.toJSON(), bulkChangeUrl: baseUrl + '/issues/bulk_change_form', - query: (Backbone.history.fragment || '').replace(/\|/g, '&') + query: bulkChangeQuery }); } });