]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10054 Fix error when changing rule severity for a quality profile
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Thu, 9 Nov 2017 14:06:09 +0000 (15:06 +0100)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Mon, 20 Nov 2017 14:36:41 +0000 (15:36 +0100)
server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js

index cc2db14af0d101304114359526c83c44617c0b35..9609182b9ca4558fde8fa9b0d19994b64411723d 100644 (file)
@@ -54,35 +54,36 @@ export default Marionette.CompositeView.extend({
   },
 
   activate() {
-    const that = this;
     const activationView = new ProfileActivationView({
       rule: this.model,
       collection: this.collection,
       app: this.options.app
     });
     activationView.on('profileActivated', (severity, params, profile) => {
-      if (that.options.app.state.get('query').qprofile === profile) {
+      if (this.options.app.state.get('query').qprofile === profile) {
         const activation = {
           severity,
           params,
           inherit: 'NONE',
           qProfile: profile
         };
-        that.model.set({ activation });
+        this.model.set({ activation });
       }
-      that.refreshActives();
+      this.refreshActives();
     });
     activationView.render();
   },
 
   refreshActives() {
-    const that = this;
-    this.options.app.controller.getRuleDetails(this.model).done(data => {
-      that.collection.reset(
-        that.model.getInactiveProfiles(data.actives, that.options.app.qualityProfiles)
-      );
-      this.options.app.controller.updateActivation(this.model, data.actives);
-    });
+    this.options.app.controller.getRuleDetails(this.model).then(
+      data => {
+        this.collection.reset(
+          this.model.getInactiveProfiles(data.actives, this.options.app.qualityProfiles)
+        );
+        this.options.app.controller.updateActivation(this.model, data.actives);
+      },
+      () => {}
+    );
   },
 
   serializeData() {