From 2dbc3811dff3c22eef24eaccb40ef471d0fdefee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Mon, 7 Dec 2020 09:06:42 +0100 Subject: [PATCH] Refactor: reverts unintentional changes --- pkg/services/sqlstore/sqlstore.go | 1 - .../variables/editor/getVariableQueryEditor.tsx | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/services/sqlstore/sqlstore.go b/pkg/services/sqlstore/sqlstore.go index 2585041bcee..ad67867284d 100644 --- a/pkg/services/sqlstore/sqlstore.go +++ b/pkg/services/sqlstore/sqlstore.go @@ -363,7 +363,6 @@ func InitTestDB(t ITestDB) *SQLStore { // set test db config testSQLStore.Cfg = setting.NewCfg() - sec, err := testSQLStore.Cfg.Raw.NewSection("database") if err != nil { t.Fatalf("Failed to create section: %s", err) diff --git a/public/app/features/variables/editor/getVariableQueryEditor.tsx b/public/app/features/variables/editor/getVariableQueryEditor.tsx index 22c4c1441ea..5824530e5d9 100644 --- a/public/app/features/variables/editor/getVariableQueryEditor.tsx +++ b/public/app/features/variables/editor/getVariableQueryEditor.tsx @@ -20,11 +20,6 @@ export async function getVariableQueryEditor< datasource: DataSourceApi, importDataSourcePluginFunc = importDataSourcePlugin ): Promise { - if (hasLegacyVariableSupport(datasource)) { - const dsPlugin = await importDataSourcePluginFunc(datasource.meta!); - return dsPlugin.components.VariableQueryEditor ?? LegacyVariableQueryEditor; - } - if (hasCustomVariableSupport(datasource)) { return datasource.variables.editor; } @@ -43,6 +38,11 @@ export async function getVariableQueryEditor< return StandardVariableQueryEditor; } + if (hasLegacyVariableSupport(datasource)) { + const dsPlugin = await importDataSourcePluginFunc(datasource.meta!); + return dsPlugin.components.VariableQueryEditor ?? LegacyVariableQueryEditor; + } + return null; }