Sandbox: Fix custom variable query editors not working inside the sandbox (#83152)

This commit is contained in:
Esteban Beltran
2024-02-21 13:31:16 +01:00
committed by GitHub
parent 68fe045ec7
commit 49a3553b94
@@ -2,7 +2,7 @@ import { isNearMembraneProxy, ProxyTarget } from '@locker/near-membrane-shared';
import { cloneDeep } from 'lodash';
import Prism from 'prismjs';
import { DataSourceApi } from '@grafana/data';
import { CustomVariableSupport, DataSourceApi } from '@grafana/data';
import { config } from '@grafana/runtime';
import { forbiddenElements } from './constants';
@@ -138,7 +138,7 @@ export function patchObjectAsLiveTarget(obj: unknown) {
!(obj instanceof Function) &&
// conditions for allowed objects
// react class components
(isReactClassComponent(obj) || obj instanceof DataSourceApi)
(isReactClassComponent(obj) || obj instanceof DataSourceApi || obj instanceof CustomVariableSupport)
) {
Reflect.defineProperty(obj, SANDBOX_LIVE_VALUE, {});
} else {