refactor: remove slice level label_colors from dashboard init load (#10603)

This commit is contained in:
Grace Guo 2020-08-18 18:10:06 -07:00 committed by GitHub
parent a3ac5061fe
commit 3bc79191c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -304,6 +304,7 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
# Exposes API endpoint to compute thumbnails
"THUMBNAILS": False,
"REDUCE_DASHBOARD_BOOTSTRAP_PAYLOAD": True,
"REMOVE_SLICE_LEVEL_LABEL_COLORS": False,
"SHARE_QUERIES_VIA_KV_STORE": False,
"SIP_38_VIZ_REARCHITECTURE": False,
"TAGGING_SYSTEM": False,

View File

@ -1652,6 +1652,13 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
)
dashboard_data = dash.data
if is_feature_enabled("REMOVE_SLICE_LEVEL_LABEL_COLORS"):
# dashboard metadata has dashboard-level label_colors,
# so remove slice-level label_colors from its form_data
for slc in dashboard_data.get("slices"):
form_data = slc.get("form_data")
form_data.pop("label_colors", None)
dashboard_data.update(
{
"standalone_mode": standalone_mode,