From bcf24ef7c7dacbb869c2b8dbde3f6666ac10a197 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 15 Jan 2015 13:55:59 +0100 Subject: [PATCH] fix SONAR-5820/SONAR-5978 suggest only profiles on selected languages --- .../src/main/js/coding-rules/bulk-change-modal-view.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js index ddf8c97c525..cd0e4b5c8eb 100644 --- a/server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js +++ b/server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js @@ -71,7 +71,15 @@ define([ }, getAvailableQualityProfiles: function () { - return this.options.app.qualityProfiles; + var queryLanguages = this.options.app.state.get('query').languages, + languages = queryLanguages.length > 0 ? queryLanguages.split(',') : [], + profiles = this.options.app.qualityProfiles; + if (languages.length > 0) { + profiles = _.filter(profiles, function (profile) { + return languages.indexOf(profile.lang) !== -1; + }); + } + return profiles; }, serializeData: function () { -- 2.39.5