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:
fxmiii
2019-08-14 09:15:42 -04:00
committed by David
parent d66601a5f5
commit 4cf804c8b6
2 changed files with 5 additions and 1 deletions

View File

@@ -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>

View File

@@ -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"
/>