]> source.dussan.org Git - sonarqube.git/commitdiff
fix SONAR-5820/SONAR-5978 suggest only profiles on selected languages
authorStas Vilchik <vilchiks@gmail.com>
Thu, 15 Jan 2015 12:55:59 +0000 (13:55 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 19 Jan 2015 08:55:55 +0000 (09:55 +0100)
server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js

index ddf8c97c525c07d87f71df3cdc28e84e30cfad83..cd0e4b5c8eb473de499b39d00473389f8ab625c0 100644 (file)
@@ -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 () {