mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
QueryActionComponent: Add dataSourceRef to ActionComponetProps (#39486)
* Add dataSourceRef to ActionComponetProps * pass whole datasource instance settings into modal Co-authored-by: Travis Patterson <travis.patterson@grafana.com>
This commit is contained in:
parent
0aac00839a
commit
184fa2a227
@ -1,10 +1,11 @@
|
|||||||
import { DataQuery, TimeRange } from '@grafana/data';
|
import { DataQuery, DataSourceInstanceSettings, TimeRange } from '@grafana/data';
|
||||||
|
|
||||||
interface ActionComponentProps {
|
interface ActionComponentProps {
|
||||||
query?: DataQuery;
|
query?: DataQuery;
|
||||||
queries?: Array<Partial<DataQuery>>;
|
queries?: Array<Partial<DataQuery>>;
|
||||||
onAddQuery?: (q: DataQuery) => void;
|
onAddQuery?: (q: DataQuery) => void;
|
||||||
timeRange?: TimeRange;
|
timeRange?: TimeRange;
|
||||||
|
dataSource?: DataSourceInstanceSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
type QueryActionComponent = React.ComponentType<ActionComponentProps>;
|
type QueryActionComponent = React.ComponentType<ActionComponentProps>;
|
||||||
|
@ -303,13 +303,14 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderExtraActions = () => {
|
renderExtraActions = () => {
|
||||||
const { query, queries, data, onAddQuery } = this.props;
|
const { query, queries, data, onAddQuery, dataSource } = this.props;
|
||||||
return RowActionComponents.getAllExtraRenderAction().map((c) => {
|
return RowActionComponents.getAllExtraRenderAction().map((c) => {
|
||||||
return React.createElement(c, {
|
return React.createElement(c, {
|
||||||
query,
|
query,
|
||||||
queries,
|
queries,
|
||||||
timeRange: data.timeRange,
|
timeRange: data.timeRange,
|
||||||
onAddQuery: onAddQuery as (query: DataQuery) => void,
|
onAddQuery: onAddQuery as (query: DataQuery) => void,
|
||||||
|
dataSource: dataSource,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user