Commit d168057f by Marcus Efraimsson Committed by GitHub

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
parent f41a6c89
......@@ -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>
......
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