mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Influx: Reset logs query field on clear all and clear row in explore (#17549)
Resets influx logs query field when hitting clear all and clear row in explore logs mode. Fixes #17506
This commit is contained in:
parent
f41a6c8962
commit
d168057fc6
@ -63,6 +63,12 @@ export class InfluxLogsQueryField extends React.PureComponent<Props, State> {
|
||||
this.setState({ measurements });
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: Props) {
|
||||
if (prevProps.query.measurement && !this.props.query.measurement) {
|
||||
this.setState({ measurement: null, field: null });
|
||||
}
|
||||
}
|
||||
|
||||
onMeasurementsChange = async (values: string[]) => {
|
||||
const { query } = this.props;
|
||||
const measurement = values[0];
|
||||
@ -105,7 +111,7 @@ export class InfluxLogsQueryField extends React.PureComponent<Props, State> {
|
||||
return (
|
||||
<div className="gf-form-inline gf-form-inline--nowrap">
|
||||
<div className="gf-form flex-shrink-0">
|
||||
<Cascader options={measurements} onChange={this.onMeasurementsChange}>
|
||||
<Cascader options={measurements} value={[measurement, field]} onChange={this.onMeasurementsChange}>
|
||||
<button className="gf-form-label gf-form-label--btn">
|
||||
{cascadeText} <i className="fa fa-caret-down" />
|
||||
</button>
|
||||
|
Loading…
Reference in New Issue
Block a user