Skip to content

Commit

Permalink
feat: configure according to the new tenant setting
Browse files Browse the repository at this point in the history
  • Loading branch information
bra-i-am committed Feb 22, 2024
1 parent 9116028 commit b7338c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.partitions.partitions_service import get_all_partitions_for_course # lint-amnesty, pylint: disable=wrong-import-order
from cms.lib.utils import use_course_authoring_mfe

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -175,7 +176,7 @@ def get_pages_and_resources_url(course_locator):
Gets course authoring microfrontend URL for Pages and Resources view.
"""
pages_and_resources_url = None
if ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND.is_enabled(course_locator):
if use_course_authoring_mfe(course_locator.org) and ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND.is_enabled(course_locator):
mfe_base_url = get_course_authoring_url(course_locator)
if mfe_base_url:
pages_and_resources_url = f'{mfe_base_url}/course/{course_locator}/pages-and-resources'
Expand All @@ -187,7 +188,7 @@ def get_proctored_exam_settings_url(course_locator) -> str:
Gets course authoring microfrontend URL for links to proctored exam settings page
"""
proctored_exam_settings_url = ''
if exam_setting_view_enabled():
if exam_setting_view_enabled() and use_course_authoring_mfe(course_locator.org):
mfe_base_url = get_course_authoring_url(course_locator)
course_mfe_url = f'{mfe_base_url}/course/{course_locator}'
if mfe_base_url:
Expand All @@ -203,7 +204,7 @@ def get_editor_page_base_url(course_locator) -> str:
Gets course authoring microfrontend URL for links to the new base editors
"""
editor_url = None
if use_new_text_editor() or use_new_video_editor():
if use_new_text_editor() or use_new_video_editor() and use_course_authoring_mfe(course_locator.org):
mfe_base_url = get_course_authoring_url(course_locator)
course_mfe_url = f'{mfe_base_url}/course/{course_locator}/editor'
if mfe_base_url:
Expand Down
3 changes: 2 additions & 1 deletion cms/templates/widgets/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from cms.djangoapps.contentstore.utils import get_pages_and_resources_url
from openedx.core.djangoapps.discussions.config.waffle import ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND
from openedx.core.djangoapps.lang_pref.api import header_language_selector_is_enabled, released_languages
from cms.lib.utils import use_course_authoring_mfe
%>
<div class="wrapper-header wrapper" id="view-top">
<header class="primary" role="banner">
Expand Down Expand Up @@ -45,7 +46,7 @@ <h1 class="branding">
if settings.FEATURES.get("CERTIFICATES_HTML_VIEW") and context_course.cert_html_view_enabled:
certificates_url = reverse('certificates_list_handler', kwargs={'course_key_string': six.text_type(course_key)})
checklists_url = reverse('checklists_handler', kwargs={'course_key_string': six.text_type(course_key)})
pages_and_resources_mfe_enabled = ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND.is_enabled(context_course.id)
pages_and_resources_mfe_enabled = use_course_authoring_mfe(course_key.org) and ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND.is_enabled(context_course.id)
%>
<h2 class="info-course">
<span class="sr">${_("Current Course:")}</span>
Expand Down

0 comments on commit b7338c3

Please sign in to comment.