A variety of updates were made to improve the toggle documentation: * Added comments to help ensure that the waffle(), waffle_switches(), waffle_flags() anti-pattern won't be contagious (copied). * Some minor toggle_description updates. * Removed empty toggle_target_removal_date annotations for non-temporary toggles. * Removed empty optional toggle_warnings annotations. * Removed empty optional toggle_tickets annotations. * Removed deprecated toggle_category, toggle_status, and toggle_expiration_date annotations. * Fixed some indents, use cases, and implementations. ARCHBOM-1721
70 lines
2.5 KiB
Python
70 lines
2.5 KiB
Python
"""
|
|
This module contains various configuration settings via
|
|
waffle switches for the contentstore app.
|
|
"""
|
|
|
|
|
|
from edx_toggles.toggles import LegacyWaffleFlag, LegacyWaffleFlagNamespace, LegacyWaffleSwitchNamespace
|
|
|
|
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag
|
|
|
|
# Namespace
|
|
WAFFLE_NAMESPACE = 'studio'
|
|
|
|
# Switches
|
|
# TODO: Replace with WaffleSwitch(). See waffle() docstring.
|
|
ENABLE_ACCESSIBILITY_POLICY_PAGE = 'enable_policy_page'
|
|
|
|
|
|
def waffle():
|
|
"""
|
|
Deprecated: Returns the namespaced, cached, audited Waffle Switch class for Studio pages.
|
|
|
|
IMPORTANT: Do NOT copy this pattern and do NOT use this to reference new switches.
|
|
Instead, replace the string constant above with the actual switch instance.
|
|
For example::
|
|
|
|
ENABLE_ACCESSIBILITY_POLICY_PAGE = WaffleSwitch(f'{WAFFLE_NAMESPACE}.enable_policy_page')
|
|
"""
|
|
return LegacyWaffleSwitchNamespace(name=WAFFLE_NAMESPACE, log_prefix='Studio: ')
|
|
|
|
|
|
def waffle_flags():
|
|
"""
|
|
Deprecated: Returns the namespaced, cached, audited Waffle Flag class for Studio pages.
|
|
|
|
IMPORTANT: Do NOT copy this pattern and do NOT use this to reference new flags.
|
|
See waffle() docstring for more details.
|
|
"""
|
|
return LegacyWaffleFlagNamespace(name=WAFFLE_NAMESPACE, log_prefix='Studio: ')
|
|
|
|
|
|
# TODO: After removing this flag, add a migration to remove waffle flag in a follow-up deployment.
|
|
ENABLE_CHECKLISTS_QUALITY = CourseWaffleFlag(
|
|
waffle_namespace=waffle_flags(),
|
|
flag_name='enable_checklists_quality',
|
|
module_name=__name__,
|
|
)
|
|
|
|
SHOW_REVIEW_RULES_FLAG = CourseWaffleFlag(
|
|
waffle_namespace=waffle_flags(),
|
|
flag_name='show_review_rules',
|
|
module_name=__name__,
|
|
)
|
|
|
|
# Waffle flag to redirect to the library authoring MFE.
|
|
# .. toggle_name: contentstore.library_authoring_mfe
|
|
# .. toggle_implementation: WaffleFlag
|
|
# .. toggle_default: False
|
|
# .. toggle_description: Toggles the new micro-frontend-based implementation of the library authoring experience.
|
|
# .. toggle_use_cases: temporary, open_edx
|
|
# .. toggle_creation_date: 2020-08-03
|
|
# .. toggle_target_removal_date: 2020-12-31
|
|
# .. toggle_warnings: Also set settings.LIBRARY_AUTHORING_MICROFRONTEND_URL and ENABLE_LIBRARY_AUTHORING_MICROFRONTEND.
|
|
# .. toggle_tickets: https://openedx.atlassian.net/wiki/spaces/COMM/pages/1545011241/BD-14+Blockstore+Powered+Content+Libraries+Taxonomies
|
|
REDIRECT_TO_LIBRARY_AUTHORING_MICROFRONTEND = LegacyWaffleFlag(
|
|
waffle_namespace=waffle_flags(),
|
|
flag_name='library_authoring_mfe',
|
|
module_name=__name__,
|
|
)
|