feat: added flag to enable MFE banner for learners (#30564)

Co-authored-by: AhtishamShahid <ahtishamshahid@A006-00850.local>
This commit is contained in:
Ahtisham Shahid
2022-06-09 23:37:20 +05:00
committed by GitHub
parent cf6ea15fff
commit 085526cf73
2 changed files with 15 additions and 2 deletions

View File

@@ -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__)

View File

@@ -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,
}