Query editor: Allow query editors to create new query (#55028)

* Query editor: Allow query editors to create new query

* Update

* Revert "Update"

This reverts commit d5b79d60dd.
This commit is contained in:
Ivana Huckova 2022-09-13 13:09:31 +02:00 committed by GitHub
parent 2c622b912a
commit e70395f07a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -382,6 +382,7 @@ export interface QueryEditorProps<
onRunQuery: () => void; onRunQuery: () => void;
onChange: (value: TVQuery) => void; onChange: (value: TVQuery) => void;
onBlur?: () => void; onBlur?: () => void;
onAddQuery?: (query: TQuery) => void;
/** /**
* Contains query response filtered by refId of QueryResultBase and possible query error * Contains query response filtered by refId of QueryResultBase and possible query error
*/ */

View File

@ -230,7 +230,7 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
} }
renderPluginEditor = () => { renderPluginEditor = () => {
const { query, onChange, queries, onRunQuery, app = CoreApp.PanelEditor, history } = this.props; const { query, onChange, queries, onRunQuery, onAddQuery, app = CoreApp.PanelEditor, history } = this.props;
const { datasource, data } = this.state; const { datasource, data } = this.state;
if (datasource?.components?.QueryCtrl) { if (datasource?.components?.QueryCtrl) {
@ -248,6 +248,7 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
datasource={datasource} datasource={datasource}
onChange={onChange} onChange={onChange}
onRunQuery={onRunQuery} onRunQuery={onRunQuery}
onAddQuery={onAddQuery}
data={data} data={data}
range={getTimeSrv().timeRange()} range={getTimeSrv().timeRange()}
queries={queries} queries={queries}