Triggers panel - fixed bug with changing severity options
in dashboard with multiple Triggers panels (changes affects all panels).
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
|
|
||||||
class TriggerPanelEditorCtrl{
|
class TriggerPanelEditorCtrl {
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor($scope, $q, uiSegmentSrv, datasourceSrv, templateSrv, popoverSrv) {
|
constructor($scope, $q, uiSegmentSrv, datasourceSrv, templateSrv, popoverSrv) {
|
||||||
|
|||||||
@@ -66,7 +66,9 @@ class TriggerPanelCtrl extends MetricsPanelCtrl {
|
|||||||
this.defaultTimeFormat = defaultTimeFormat;
|
this.defaultTimeFormat = defaultTimeFormat;
|
||||||
|
|
||||||
// Load panel defaults
|
// Load panel defaults
|
||||||
_.defaults(this.panel, panelDefaults);
|
// _.cloneDeep() need for prevent changing shared defaultSeverity.
|
||||||
|
// Load object "by value" istead "by reference".
|
||||||
|
_.defaults(this.panel, _.cloneDeep(panelDefaults));
|
||||||
|
|
||||||
this.triggerList = [];
|
this.triggerList = [];
|
||||||
this.refreshData();
|
this.refreshData();
|
||||||
|
|||||||
Reference in New Issue
Block a user