diff --git a/lms/djangoapps/discussion/toggles.py b/lms/djangoapps/discussion/toggles.py index 0ab0638abe..1bafee3cf7 100644 --- a/lms/djangoapps/discussion/toggles.py +++ b/lms/djangoapps/discussion/toggles.py @@ -69,3 +69,12 @@ ENABLE_DISCUSSION_MODERATION_REASON_CODES = CourseWaffleFlag( ENABLE_REPORTED_CONTENT_EMAIL_NOTIFICATIONS = CourseWaffleFlag( f'{WAFFLE_FLAG_NAMESPACE}.enable_reported_content_email_notifications', __name__ ) + +# .. toggle_name: discussions.enable_mfe_banner_for_learners +# .. toggle_implementation: CourseWaffleFlag +# .. toggle_default: False +# .. toggle_description: Waffle flag to enable new MFE banner for learners +# .. toggle_use_cases: temporary, open_edx +# .. toggle_creation_date: 2022-06-08 +# .. toggle_target_removal_date: 2022-09-05 +ENABLE_DISCUSSIONS_MFE_BANNER = CourseWaffleFlag(f'{WAFFLE_FLAG_NAMESPACE}.enable_mfe_banner_for_learners', __name__) diff --git a/lms/djangoapps/discussion/views.py b/lms/djangoapps/discussion/views.py index b056c24f4b..f0935d4469 100644 --- a/lms/djangoapps/discussion/views.py +++ b/lms/djangoapps/discussion/views.py @@ -48,7 +48,11 @@ from lms.djangoapps.discussion.django_comment_client.utils import ( strip_none ) from lms.djangoapps.discussion.exceptions import TeamDiscussionHiddenFromUserException -from lms.djangoapps.discussion.toggles import ENABLE_DISCUSSIONS_MFE, ENABLE_DISCUSSIONS_MFE_FOR_EVERYONE +from lms.djangoapps.discussion.toggles import ( + ENABLE_DISCUSSIONS_MFE, + ENABLE_DISCUSSIONS_MFE_FOR_EVERYONE, + ENABLE_DISCUSSIONS_MFE_BANNER +) from lms.djangoapps.experiments.utils import get_experiment_user_metadata_context from lms.djangoapps.teams import api as team_api from openedx.core.djangoapps.discussions.url_helpers import get_discussions_mfe_url @@ -748,7 +752,7 @@ def _discussions_mfe_context(query_params: Dict, "mfe_url": f"{forum_url}?discussions_experience=new", "share_feedback_url": settings.DISCUSSIONS_MFE_FEEDBACK_URL, "course_key": course_key, - "show_banner": enable_mfe and is_privileged, + "show_banner": enable_mfe and (is_privileged or ENABLE_DISCUSSIONS_MFE_BANNER), "discussions_mfe_url": mfe_url, }