diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-06-06 14:06:28 +0200 |
---|---|---|
committer | Eric Hartmann <hartmann.eric@gmail.com> | 2017-06-14 15:43:12 +0200 |
commit | 7122d530b75bb5f28f47c0a6ebf29e71012ce5cc (patch) | |
tree | cf936ab6a6c90767c9bbfbe389d36506a74a518c /server/sonar-web/src/main/js/apps/coding-rules | |
parent | 64d9dd615655021a0022e3a6f7cadbe7ab170231 (diff) | |
download | sonarqube-7122d530b75bb5f28f47c0a6ebf29e71012ce5cc.tar.gz sonarqube-7122d530b75bb5f28f47c0a6ebf29e71012ce5cc.zip |
SONAR-9303 disable changing of rules for built-in profiles
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules')
3 files changed, 7 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js index 777364a49fa..07277f983f6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js @@ -109,7 +109,7 @@ export default ModalFormView.extend({ if (languages.length > 0) { profiles = profiles.filter(profile => languages.indexOf(profile.lang) !== -1); } - return profiles; + return profiles.filter(profile => !profile.isBuiltIn); }, serializeData() { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js index b38546304fa..50c6c6d4676 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js @@ -48,7 +48,7 @@ export default PopupView.extend({ return { qualityProfile: profileKey, qualityProfileName: profile != null ? profile.name : null, - allowActivateOnProfile: profileKey != null && activation === 'false', + allowActivateOnProfile: profile != null && activation === 'false' && !profile.isBuiltIn, allowDeactivateOnProfile: profileKey != null && activation === 'true' }; } diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js index 1f31421dba7..b2be0820a3a 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js @@ -129,7 +129,9 @@ export default ModalForm.extend({ const inactiveProfiles = this.options.app.qualityProfiles.filter( profile => !activeQualityProfiles.findWhere({ key: profile.key }) ); - return inactiveProfiles.filter(profile => profile.lang === lang); + return inactiveProfiles + .filter(profile => profile.lang === lang) + .filter(profile => !profile.isBuiltIn); }, serializeData() { @@ -164,8 +166,8 @@ export default ModalForm.extend({ qualityProfiles: profilesWithDepth, severities: ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'], saveEnabled: availableProfiles.length > 0 || (this.model && this.model.get('qProfile')), - isCustomRule: (this.model && this.model.has('templateKey')) || - this.options.rule.has('templateKey') + isCustomRule: + (this.model && this.model.has('templateKey')) || this.options.rule.has('templateKey') }; } }); |