alerting: bad default state for notifiers

when we made image upload optional we didnt
show the default value properly in the UI. Which
caused confusing. This commit apply the default
values to existing notifiers in the edit pages
and reverts back to using uploadimage=true as the
default value.
This commit is contained in:
bergquist
2018-03-27 09:19:14 +02:00
parent 9e2e6fc586
commit d29563ff8e
3 changed files with 31 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ export class AlertNotificationEditCtrl {
return this.backendSrv.get(`/api/alert-notifications/${this.$routeParams.id}`).then(result => {
this.navModel.breadcrumbs.push({ text: result.name });
this.navModel.node = { text: result.name };
result.settings = _.defaults(result.settings, this.defaults.settings);
return result;
});
})
@@ -89,7 +90,7 @@ export class AlertNotificationEditCtrl {
}
typeChanged() {
this.model.settings = {};
this.model.settings = _.defaults({}, this.defaults.settings);
this.notifierTemplateId = this.getNotifierTemplateId(this.model.type);
}