From 0b1ad0a879636f11c3b773289859631a0e0e4ffd Mon Sep 17 00:00:00 2001 From: Polina Boneva <13227501+polibb@users.noreply.github.com> Date: Thu, 9 Mar 2023 16:43:13 +0200 Subject: [PATCH] Query Editor: Internal context to actions (#64518) loadedDataSourceIdentifier is not always loaded, but always queried; comment adds understanding to a specific use case --- .../app/features/query/components/QueryEditorRow.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index 3c9137fad5d..efcec635deb 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -64,7 +64,7 @@ interface Props { interface State { /** DatasourceUid or ds variable expression used to resolve current datasource */ - loadedDataSourceIdentifier?: string | null; + queriedDataSourceIdentifier?: string | null; datasource: DataSourceApi | null; datasourceUid?: string | null; hasTextEditMode: boolean; @@ -158,18 +158,19 @@ export class QueryEditorRow extends PureComponent, - loadedDataSourceIdentifier: interpolatedUID, + queriedDataSourceIdentifier: interpolatedUID, hasTextEditMode: has(datasource, 'components.QueryCtrl.prototype.toggleEditorMode'), }); } componentDidUpdate(prevProps: Props) { - const { datasource, loadedDataSourceIdentifier } = this.state; + const { datasource, queriedDataSourceIdentifier } = this.state; const { data, query } = this.props; if (prevProps.id !== this.props.id) { @@ -191,7 +192,7 @@ export class QueryEditorRow extends PureComponent extends PureComponent {