etr2460 commented on a change in pull request #11797:
URL:
https://github.com/apache/incubator-superset/pull/11797#discussion_r530011494
##########
File path: superset-frontend/src/featureFlags.ts
##########
@@ -48,8 +49,12 @@ declare global {
}
}
+let initialized = false;
export function initFeatureFlags(featureFlags: FeatureFlagMap) {
- window.featureFlags = featureFlags || {};
+ if (!initialized) {
Review comment:
instead of adding an `initialized` variable, can we just check to see if
`window.featureFlags` is set?
##########
File path: superset/views/base.py
##########
@@ -66,6 +66,7 @@
)
FRONTEND_CONF_KEYS = (
+ "ALLOW_DASHBOARD_DOMAIN_SHARDING",
Review comment:
I don't think you need this here. feature flags always get added into
the bootstrap data
##########
File path: superset-frontend/src/utils/hostNamesConfig.js
##########
@@ -16,15 +16,24 @@
* 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) {
return [];
}
const bootstrapData =
JSON.parse(appContainer.getAttribute('data-bootstrap'));
+ // eslint-disable-next-line camelcase
+ initFeatureFlags(bootstrapData?.common?.feature_flags);
Review comment:
yikes... when does that happen?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]