From d168057fc68a88c913091d9f4289e867d1f43732 Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Wed, 12 Jun 2019 17:27:13 +0200 Subject: [PATCH] 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 --- .../influxdb/components/InfluxLogsQueryField.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/influxdb/components/InfluxLogsQueryField.tsx b/public/app/plugins/datasource/influxdb/components/InfluxLogsQueryField.tsx index 70fd5a74da3..2d4f01dcbe6 100644 --- a/public/app/plugins/datasource/influxdb/components/InfluxLogsQueryField.tsx +++ b/public/app/plugins/datasource/influxdb/components/InfluxLogsQueryField.tsx @@ -63,6 +63,12 @@ export class InfluxLogsQueryField extends React.PureComponent { 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 { return (
- +