Prometheus: Fix enabling of disabled queries when editing in dashboard (#31055)

* Fix disable bug by passing hide prop

* Make more universal fix

* Revert to original fix

* Update public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
This commit is contained in:
Ivana Huckova 2021-02-16 16:23:26 +01:00 committed by GitHub
parent 38daf0cba6
commit 4f61edd28d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,9 @@ export class PromQueryEditor extends PureComponent<Props, State> {
onRunQuery = () => {
const { query } = this;
this.props.onChange(query);
// Change of query.hide happens outside of this component and is just passed as prop. We have to update it when running queries.
const { hide } = this.props.query;
this.props.onChange({ ...query, hide });
this.props.onRunQuery();
};