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 {
|
||||
query?: DataQuery;
|
||||
queries?: Array<Partial<DataQuery>>;
|
||||
onAddQuery?: (q: DataQuery) => void;
|
||||
timeRange?: TimeRange;
|
||||
dataSource?: DataSourceInstanceSettings;
|
||||
}
|
||||
|
||||
type QueryActionComponent = React.ComponentType<ActionComponentProps>;
|
||||
|
@ -303,13 +303,14 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
|
||||
}
|
||||
|
||||
renderExtraActions = () => {
|
||||
const { query, queries, data, onAddQuery } = this.props;
|
||||
const { query, queries, data, onAddQuery, dataSource } = this.props;
|
||||
return RowActionComponents.getAllExtraRenderAction().map((c) => {
|
||||
return React.createElement(c, {
|
||||
query,
|
||||
queries,
|
||||
timeRange: data.timeRange,
|
||||
onAddQuery: onAddQuery as (query: DataQuery) => void,
|
||||
dataSource: dataSource,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user