]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9550 Don't show the activate button for rules where there is no editable QP
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 3 Oct 2017 09:15:57 +0000 (11:15 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Wed, 4 Oct 2017 10:02:16 +0000 (12:02 +0200)
server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js

index 81781afab8bf9d3b1c5553419b8ec2919e2d245a..25658dd0deb9eaf76ff0678bbd82181d28084b09 100644 (file)
@@ -85,9 +85,10 @@ export default Marionette.CompositeView.extend({
   },
 
   serializeData() {
-    // show "Activate" button only if user has at least one QP which he administates
+    // show "Activate" button only if user has at least one QP of the same language which he administates
+    const ruleLang = this.model.get('lang');
     const canActivate = this.options.app.qualityProfiles.some(
-      profile => profile.actions && profile.actions.edit
+      profile => profile.actions && profile.actions.edit && profile.language === ruleLang
     );
 
     return {