QueryEditor: Add missing keys to extra action components (#39913)

This commit is contained in:
Alex Khomenko 2021-10-04 09:05:43 +03:00 committed by GitHub
parent 427f75d9b0
commit d6fd17531d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -138,7 +138,7 @@ const getQueryOperationRowStyles = stylesFactory((theme: GrafanaTheme) => {
}
`,
dragIcon: css`
cursor: drag;
cursor: grab;
color: ${theme.colors.textWeak};
&:hover {
color: ${theme.colors.text};

View File

@ -100,10 +100,10 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
dashboard: dashboard,
refresh: () => {
// Old angular editors modify the query model and just call refresh
// Important that this use this.props here so that as this fuction is only created on mount and it's
// Important that this use this.props here so that as this function is only created on mount and it's
// important not to capture old prop functions in this closure
// the "hide" attribute of the quries can be changed from the "outside",
// the "hide" attribute of the queries can be changed from the "outside",
// it will be applied to "this.props.query.hide", but not to "query.hide".
// so we have to apply it.
if (query.hide !== me.props.query.hide) {
@ -304,13 +304,14 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
renderExtraActions = () => {
const { query, queries, data, onAddQuery, dataSource } = this.props;
return RowActionComponents.getAllExtraRenderAction().map((c) => {
return RowActionComponents.getAllExtraRenderAction().map((c, index) => {
return React.createElement(c, {
query,
queries,
timeRange: data.timeRange,
onAddQuery: onAddQuery as (query: DataQuery) => void,
dataSource: dataSource,
key: index,
});
});
};