Skip to content

Commit

Permalink
feat: support disabling domain sharding with a query param
Browse files Browse the repository at this point in the history
  • Loading branch information
erik_ritter committed Oct 21, 2021
1 parent f580f6b commit 8e51ea8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion superset-frontend/src/utils/hostNamesConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,22 @@ function getDomainsConfig() {
return [];
}

const availableDomains = new Set([window.location.hostname]);

// don't do domain sharding if a certain query param is set
const disableDomainSharding =
new URLSearchParams(window.location.search).get('disableDomainSharding') ===
'1';
if (disableDomainSharding) {
return Array.from(availableDomains);
}

const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
// this module is a little special, it may be loaded before index.jsx,
// where window.featureFlags get initialized
// eslint-disable-next-line camelcase
initFeatureFlags(bootstrapData?.common?.feature_flags);
const availableDomains = new Set([window.location.hostname]);

if (
isFeatureEnabled(FeatureFlag.ALLOW_DASHBOARD_DOMAIN_SHARDING) &&
bootstrapData &&
Expand Down

0 comments on commit 8e51ea8

Please sign in to comment.