triggers panel multi-ds supoort: refactor

This commit is contained in:
Alexander Zobnin
2017-12-02 22:32:50 +03:00
parent 51c2185cde
commit e0064da209
11 changed files with 279 additions and 184 deletions

View File

@@ -0,0 +1,15 @@
export function migratePanelSchema(panel) {
const schemaVersion = getSchemaVersion(panel);
switch (schemaVersion) {
case 1:
panel.datasources = [panel.datasource];
panel.targets[panel.datasources[0]] = panel.triggers;
break;
}
return panel;
}
function getSchemaVersion(panel) {
return panel.schemaVersion || 1;
}