Skip to content

Commit

Permalink
feat: added flag to enable MFE banner for learners (#30564)
Browse files Browse the repository at this point in the history
Co-authored-by: AhtishamShahid <[email protected]>
  • Loading branch information
AhtishamShahid and AhtishamShahid authored Jun 9, 2022
1 parent cf6ea15 commit 085526c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lms/djangoapps/discussion/toggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,12 @@
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__)
8 changes: 6 additions & 2 deletions lms/djangoapps/discussion/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
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
Expand Down Expand Up @@ -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,
}

Expand Down

0 comments on commit 085526c

Please sign in to comment.