From cc4acb719d8d7886327dcc8ea2025a38ac44b0b4 Mon Sep 17 00:00:00 2001 From: Leo <108552997+lpskdl@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:26:25 +0200 Subject: [PATCH] fixed conflicts (#53538) --- public/app/features/plugins/datasource_srv.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/app/features/plugins/datasource_srv.ts b/public/app/features/plugins/datasource_srv.ts index 41a4fc7b4a2..41bb47d23c2 100644 --- a/public/app/features/plugins/datasource_srv.ts +++ b/public/app/features/plugins/datasource_srv.ts @@ -246,11 +246,15 @@ export class DatasourceSrv implements DataSourceService { if (filters.variables) { for (const variable of this.templateSrv.getVariables()) { - if (!isDataSource(variable) || variable.multi || variable.includeAll) { + if (!isDataSource(variable)) { continue; } - const dsName = variable.current.value === 'default' ? this.defaultName : variable.current.value; - const dsSettings = !Array.isArray(dsName) && this.settingsMapByName[dsName]; + let dsValue = variable.current.value === 'default' ? this.defaultName : variable.current.value; + if (Array.isArray(dsValue) && dsValue.length === 1) { + // Support for multi-value variables with only one selected datasource + dsValue = dsValue[0]; + } + const dsSettings = !Array.isArray(dsValue) && this.settingsMapByName[dsValue]; if (dsSettings) { const key = `$\{${variable.name}\}`;