From e48a86bec9562c16c91b0f63468f22e16cb81b15 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Tue, 3 Oct 2017 11:15:57 +0200 Subject: [PATCH] SONAR-9550 Don't show the activate button for rules where there is no editable QP --- .../src/main/js/apps/coding-rules/rule/rule-profiles-view.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js index 81781afab8b..25658dd0deb 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js @@ -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 { -- 2.39.5