mirror of
https://github.com/apache/superset.git
synced 2026-04-25 19:14:27 +00:00
fix: add feature flag for domain sharding (#11797)
* fix: add feature flag for domain sharding * fix review comment * add comment for speical case
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import {
|
||||
initFeatureFlags,
|
||||
isFeatureEnabled,
|
||||
FeatureFlag,
|
||||
} from 'src/featureFlags';
|
||||
|
||||
function getDomainsConfig() {
|
||||
const appContainer = document.getElementById('app');
|
||||
if (!appContainer) {
|
||||
@@ -23,8 +29,13 @@ function getDomainsConfig() {
|
||||
}
|
||||
|
||||
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 &&
|
||||
bootstrapData.common &&
|
||||
bootstrapData.common.conf &&
|
||||
|
||||
Reference in New Issue
Block a user