From 00f9c25a79c8a64163f04653f0ae8afc1f5dd321 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Wed, 10 Jun 2020 12:07:00 +0300 Subject: [PATCH] Fix problems panel migration when panel options is not opened --- src/datasource-zabbix/query.controller.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/datasource-zabbix/query.controller.ts b/src/datasource-zabbix/query.controller.ts index b220f9b..a622cb2 100644 --- a/src/datasource-zabbix/query.controller.ts +++ b/src/datasource-zabbix/query.controller.ts @@ -5,6 +5,8 @@ import * as utils from './utils'; import * as metricFunctions from './metricFunctions'; import * as migrations from './migrations'; import { ShowProblemTypes } from './types'; +import { CURRENT_SCHEMA_VERSION } from '../panel-triggers/migrations'; + function getTargetDefaults() { return { @@ -225,6 +227,11 @@ export class ZabbixQueryController extends QueryCtrl { } }; + // Update panel schema version to prevent unnecessary migrations + if (this.panel.type === c.ZABBIX_PROBLEMS_PANEL_ID) { + this.panel.schemaVersion = CURRENT_SCHEMA_VERSION; + } + this.init(); this.queryOptionsText = this.renderQueryOptionsText(); }