From f2b5fac2fb13ae7949ab449da368c167428e0ea0 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 15 Oct 2014 11:09:45 +0200 Subject: [PATCH] SONAR-5727 The bulk operation can be desynchronized with the criteria of the issue filter --- server/sonar-web/src/main/js/issues/app.js | 12 ++++++++---- server/sonar-web/src/main/js/issues/extra.js | 8 ++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) 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 }); } }); -- 2.39.5