mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
QueryEditor: Clean-up interface to only have one PanelData (#19249)
* QueryEditor: Clean-up interface to only have one PanelData * Renamed to prop name to data
This commit is contained in:
@@ -33,7 +33,7 @@ interface State {
|
||||
datasource: DataSourceApi | null;
|
||||
isCollapsed: boolean;
|
||||
hasTextEditMode: boolean;
|
||||
queryResponse?: PanelData;
|
||||
data?: PanelData;
|
||||
}
|
||||
|
||||
export class QueryEditorRow extends PureComponent<Props, State> {
|
||||
@@ -46,7 +46,7 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
||||
isCollapsed: false,
|
||||
loadedDataSourceValue: undefined,
|
||||
hasTextEditMode: false,
|
||||
queryResponse: null,
|
||||
data: null,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
@@ -92,7 +92,7 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
||||
const { data, query, panel } = this.props;
|
||||
|
||||
if (data !== prevProps.data) {
|
||||
this.setState({ queryResponse: filterPanelDataToQuery(data, query.refId) });
|
||||
this.setState({ data: filterPanelDataToQuery(data, query.refId) });
|
||||
|
||||
if (this.angularScope) {
|
||||
this.angularScope.range = getTimeSrv().timeRange();
|
||||
@@ -133,8 +133,8 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
||||
};
|
||||
|
||||
renderPluginEditor() {
|
||||
const { query, data, onChange } = this.props;
|
||||
const { datasource, queryResponse } = this.state;
|
||||
const { query, onChange } = this.props;
|
||||
const { datasource, data } = this.state;
|
||||
|
||||
if (datasource.components.QueryCtrl) {
|
||||
return <div ref={element => (this.element = element)} />;
|
||||
@@ -149,8 +149,7 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
||||
datasource={datasource}
|
||||
onChange={onChange}
|
||||
onRunQuery={this.onRunQuery}
|
||||
queryResponse={queryResponse}
|
||||
panelData={data}
|
||||
data={data}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user