mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
@@ -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"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user