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> { ...@@ -167,8 +167,13 @@ export class QueryGroup extends PureComponent<Props, State> {
this.setState({ scrollTop: 1000 }); this.setState({ scrollTop: 1000 });
}; };
onUpdateAndRun = (options: QueryGroupOptions) => {
this.props.onOptionsChange(options);
this.props.onRunQueries();
};
renderTopSection(styles: QueriesTabStyls) { renderTopSection(styles: QueriesTabStyls) {
const { onOpenQueryInspector, options, onOptionsChange } = this.props; const { onOpenQueryInspector, options } = this.props;
const { dataSource, data } = this.state; const { dataSource, data } = this.state;
return ( return (
...@@ -199,7 +204,7 @@ export class QueryGroup extends PureComponent<Props, State> { ...@@ -199,7 +204,7 @@ export class QueryGroup extends PureComponent<Props, State> {
options={options} options={options}
dataSource={dataSource} dataSource={dataSource}
data={data} data={data}
onChange={onOptionsChange} onChange={this.onUpdateAndRun}
/> />
</div> </div>
{onOpenQueryInspector && ( {onOpenQueryInspector && (
......
...@@ -144,19 +144,23 @@ export class QueryGroupOptionsEditor extends PureComponent<Props, State> { ...@@ -144,19 +144,23 @@ export class QueryGroupOptionsEditor extends PureComponent<Props, State> {
maxDataPoints = null; maxDataPoints = null;
} }
if (maxDataPoints !== options.maxDataPoints) {
onChange({ onChange({
...options, ...options,
maxDataPoints: maxDataPoints, maxDataPoints,
}); });
}
}; };
onMinIntervalBlur = (event: ChangeEvent<HTMLInputElement>) => { onMinIntervalBlur = (event: ChangeEvent<HTMLInputElement>) => {
const { options, onChange } = this.props; const { options, onChange } = this.props;
const minInterval = emptyToNull(event.target.value);
if (minInterval !== options.minInterval) {
onChange({ onChange({
...options, ...options,
minInterval: emptyToNull(event.target.value), minInterval,
}); });
}
}; };
renderCacheTimeoutOption() { 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