Commit 4cf804c8 by fxmiii Committed by David

Prometheus: Fix regression of rerunning query on legend/interval change (#18147)

* Rerun query on input changes

Added "this.onRunQuery" for update of the input fields so that the panel updates when changed

* typo in comment

changed "fullu" to "fully"

* modified to onBlur for legend, interval

legend and interval (min step) now call for query re-run when they go 'onBlur' instead of 'onChange'

* PromQueryEditor: Updated snapshot
parent d66601a5
......@@ -39,7 +39,7 @@ export class PromQueryEditor extends PureComponent<Props, State> {
super(props);
const { query } = props;
this.query = query;
// Query target properties that are fullu controlled inputs
// Query target properties that are fully controlled inputs
this.state = {
// Fully controlled text inputs
interval: query.interval,
......@@ -123,6 +123,7 @@ export class PromQueryEditor extends PureComponent<Props, State> {
placeholder="legend format"
value={legendFormat}
onChange={this.onLegendChange}
onBlur={this.onRunQuery}
/>
</div>
......@@ -140,6 +141,7 @@ export class PromQueryEditor extends PureComponent<Props, State> {
className="gf-form-input width-8"
placeholder={interval}
onChange={this.onIntervalChange}
onBlur={this.onRunQuery}
value={interval}
/>
</div>
......
......@@ -35,6 +35,7 @@ exports[`Render PromQueryEditor with basic options should render 1`] = `
</Component>
<input
className="gf-form-input"
onBlur={[Function]}
onChange={[Function]}
placeholder="legend format"
type="text"
......@@ -53,6 +54,7 @@ exports[`Render PromQueryEditor with basic options should render 1`] = `
</Component>
<input
className="gf-form-input width-8"
onBlur={[Function]}
onChange={[Function]}
type="text"
/>
......
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