Commit d54e6219 by Ryan McKinley Committed by GitHub

QueryOptions: Open QueryEditors: run queries after changing group options #29864

parent 75761bf6
......@@ -167,8 +167,13 @@ export class QueryGroup extends PureComponent<Props, State> {
this.setState({ scrollTop: 1000 });
};
onUpdateAndRun = (options: QueryGroupOptions) => {
this.props.onOptionsChange(options);
this.props.onRunQueries();
};
renderTopSection(styles: QueriesTabStyls) {
const { onOpenQueryInspector, options, onOptionsChange } = this.props;
const { onOpenQueryInspector, options } = this.props;
const { dataSource, data } = this.state;
return (
......@@ -199,7 +204,7 @@ export class QueryGroup extends PureComponent<Props, State> {
options={options}
dataSource={dataSource}
data={data}
onChange={onOptionsChange}
onChange={this.onUpdateAndRun}
/>
</div>
{onOpenQueryInspector && (
......
......@@ -144,19 +144,23 @@ export class QueryGroupOptionsEditor extends PureComponent<Props, State> {
maxDataPoints = null;
}
if (maxDataPoints !== options.maxDataPoints) {
onChange({
...options,
maxDataPoints: maxDataPoints,
maxDataPoints,
});
}
};
onMinIntervalBlur = (event: ChangeEvent<HTMLInputElement>) => {
const { options, onChange } = this.props;
const minInterval = emptyToNull(event.target.value);
if (minInterval !== options.minInterval) {
onChange({
...options,
minInterval: emptyToNull(event.target.value),
minInterval,
});
}
};
renderCacheTimeoutOption() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment