From 5708787527453bbaa11ed90d1d98a35ec3ca1388 Mon Sep 17 00:00:00 2001 From: Kshitij Sobti Date: Mon, 7 Feb 2022 09:57:32 +0000 Subject: [PATCH] feat: show share feedback button only for discussions MFE when URL is configured (#29785) Removes the share feedback button unless a URL is configured, and only shows it for the discussions MFE view. --- lms/djangoapps/discussion/views.py | 1 + lms/envs/common.py | 2 ++ .../discussion/_switch_experience_fragment.html | 9 +++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/discussion/views.py b/lms/djangoapps/discussion/views.py index e9e1767062..6f4a4ed22e 100644 --- a/lms/djangoapps/discussion/views.py +++ b/lms/djangoapps/discussion/views.py @@ -720,6 +720,7 @@ def _discussions_mfe_context(query_params: Dict, course_key: CourseKey, user: Us "show_mfe": show_mfe, "legacy_url": f"{forum_url}?discussions_experience=legacy", "mfe_url": f"{forum_url}?discussions_experience=new", + "share_feedback_url": settings.DISCUSSIONS_MFE_FEEDBACK_URL, "course_key": course_key, "show_banner": show_banner, "discussions_mfe_url": mfe_url, diff --git a/lms/envs/common.py b/lms/envs/common.py index 32d7e6d677..c3fbc58b32 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -4920,3 +4920,5 @@ CUSTOM_PAGES_HELP_URL = "https://edx.readthedocs.io/projects/open-edx-building-a # The expected value is an Integer representing the cutoff point (in months) for inclusion to the message. Example: # a value of `3` would include learners who have logged in within the past 3 months. BULK_COURSE_EMAIL_LAST_LOGIN_ELIGIBILITY_PERIOD = None + +DISCUSSIONS_MFE_FEEDBACK_URL = None diff --git a/lms/templates/discussion/_switch_experience_fragment.html b/lms/templates/discussion/_switch_experience_fragment.html index 240346fe55..abcf9aa908 100644 --- a/lms/templates/discussion/_switch_experience_fragment.html +++ b/lms/templates/discussion/_switch_experience_fragment.html @@ -16,14 +16,15 @@ from django.utils.translation import ugettext as _ ${_("View legacy experience")} + % if share_feedback_url: + + ${_("Share feedback")} + + % endif % else: ${_("View the new experience")} % endif - - - ${_("Share feedback")} - % endif