Filter triggers by tags, #487

This commit is contained in:
Alexander Zobnin
2017-12-16 14:21:59 +03:00
parent ea0c5a29b5
commit 401ad69687
10 changed files with 123 additions and 20 deletions

View File

@@ -1,5 +1,8 @@
import _ from 'lodash';
import {DEFAULT_TARGET} from './triggers_panel_ctrl';
// Actual schema version
const CURRENT_SCHEMA_VERSION = 3;
export const CURRENT_SCHEMA_VERSION = 4;
export function migratePanelSchema(panel) {
if (isEmptyPanel(panel)) {
@@ -28,6 +31,14 @@ export function migratePanelSchema(panel) {
delete panel.hideHostsInMaintenance;
}
if (schemaVersion < 4) {
if (panel.targets && !_.isEmpty(panel.targets)) {
_.each(panel.targets, (target) => {
_.defaultsDeep(target, DEFAULT_TARGET);
});
}
}
return panel;
}