Explore: keep enabled/disabled state in angular based QueryEditors correctly (#31558)

* Explore: handle query.hide changes in angular-based query editors

* simplify code, no need for custom "this"
pull/31259/head^2
Gábor Farkas 4 years ago committed by GitHub
parent 0ba16acd45
commit 6a07a0fe93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      public/app/features/explore/QueryEditor.tsx

@ -40,6 +40,12 @@ export default class QueryEditor extends PureComponent<QueryEditorProps, any> {
target,
refresh: () => {
setTimeout(() => {
// the "hide" attribute of the quries can be changed from the "outside",
// it will be applied to "this.props.initialQuery.hide", but not to "target.hide".
// so we have to apply it.
if (target.hide !== this.props.initialQuery.hide) {
target.hide = this.props.initialQuery.hide;
}
this.props.onQueryChange?.(target);
this.props.onExecuteQuery?.();
}, 1);

Loading…
Cancel
Save