From: Stas Vilchik Date: Thu, 15 Jan 2015 12:55:59 +0000 (+0100) Subject: fix SONAR-5820/SONAR-5978 suggest only profiles on selected languages X-Git-Tag: latest-silver-master-#65~195 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bcf24ef7c7dacbb869c2b8dbde3f6666ac10a197;p=sonarqube.git fix SONAR-5820/SONAR-5978 suggest only profiles on selected languages --- 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 () {