From 312117bdfe7c19b731999a172dcc7f4dab759eae Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:24:29 +0000 Subject: [PATCH] DatasourceVariables: Update query editor when switching datasources from picker (#62617) --- .../query/components/QueryEditorRow.tsx | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index 84bee65a618..3c9137fad5d 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -77,6 +77,7 @@ export class QueryEditorRow extends PureComponent | null = null; angularQueryEditor: AngularComponent | null = null; + dataSourceSrv = getDataSourceSrv(); id = ''; state: State = { @@ -136,25 +137,33 @@ export class QueryEditorRow extends PureComponent, - loadedDataSourceIdentifier: dataSourceIdentifier, + loadedDataSourceIdentifier: interpolatedUID, hasTextEditMode: has(datasource, 'components.QueryCtrl.prototype.toggleEditorMode'), }); } @@ -182,7 +191,7 @@ export class QueryEditorRow extends PureComponent extends PureComponent {