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

* 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>
(cherry picked from commit 4f61edd28d)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)andIvana Huckova authored and GitHub committed 2021-02-16 16:55:02 +01:00
1 parent 44008445b8
commit 8b4c370752
1 file changed
+3 -1
@@ -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();
};