Skip to content

Commit

Permalink
SONAR-10054 Fix error when changing rule severity for a quality profile
Browse files Browse the repository at this point in the history
  • Loading branch information
gregaubert committed Nov 20, 2017
1 parent 98f4d04 commit 63ef497
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 63ef497

Please sign in to comment.