fix(viz-gallery): respect denylist in viz gallery (#22658)

This commit is contained in:
Ville Brofeldt
2023-01-10 19:08:30 +02:00
committed by GitHub
parent 1e3746be21
commit 08f45ef207
33 changed files with 111 additions and 123 deletions

View File

@@ -23,6 +23,7 @@ import {
logging,
} from '@superset-ui/core';
import { SupersetError } from 'src/components/ErrorMessage/types';
import getBootstrapData from 'src/utils/getBootstrapData';
import { FeatureFlag, isFeatureEnabled } from '../featureFlags';
import {
getClientErrorObject,
@@ -235,21 +236,7 @@ export const init = (appConfig?: AppConfig) => {
retriesByJobId = {};
lastReceivedEventId = null;
if (appConfig) {
config = appConfig;
} else {
// load bootstrap data from DOM
const appContainer = document.getElementById('app');
if (appContainer) {
const bootstrapData = JSON.parse(
appContainer?.getAttribute('data-bootstrap') || '{}',
);
config = bootstrapData?.common?.conf;
} else {
config = {};
logging.warn('asyncEvent: app config data not found');
}
}
config = appConfig || getBootstrapData().config;
transport = config.GLOBAL_ASYNC_QUERIES_TRANSPORT || TRANSPORT_POLLING;
pollingDelayMs = config.GLOBAL_ASYNC_QUERIES_POLLING_DELAY || 500;