Merge branch 'master' into sameeramin/ENT-10591

This commit is contained in:
Muhammad Sameer Amin
2025-06-25 20:15:32 +05:00
committed by GitHub
10 changed files with 80 additions and 4 deletions

View File

@@ -0,0 +1,23 @@
"""
Tests for toggles, where there is logic beyond enable/disable.
"""
import ddt
from django.test import override_settings, TestCase
from lms.djangoapps.branding.toggles import use_catalog_mfe
@ddt.ddt
class TestBrandingToggles(TestCase):
"""
Tests for toggles, where there is logic beyond enable/disable.
"""
@ddt.data(True, False)
def test_use_catalog_mfe(self, enabled):
"""
Test the use_catalog_mfe toggle.
"""
with override_settings(FEATURES={'ENABLE_CATALOG_MICROFRONTEND': enabled}):
assert use_catalog_mfe() == enabled

View File

@@ -0,0 +1,15 @@
"""
Configuration for features of Branding
"""
from django.conf import settings
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
def use_catalog_mfe():
"""
Determine if Catalog MFE is enabled, replacing student_dashboard
"""
return configuration_helpers.get_value(
'ENABLE_CATALOG_MICROFRONTEND', settings.FEATURES['ENABLE_CATALOG_MICROFRONTEND']
)

View File

@@ -881,6 +881,15 @@ FEATURES = {
# toggle does not have a target removal date.
'ENABLE_AUTHN_MICROFRONTEND': os.environ.get("EDXAPP_ENABLE_AUTHN_MFE", False),
# .. toggle_name: FEATURES['ENABLE_CATALOG_MICROFRONTEND']
# .. toggle_implementation: DjangoSetting
# .. toggle_default: False
# .. toggle_description: Supports staged rollout of a new micro-frontend-based implementation of the catalog.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-05-15
# .. toggle_target_removal_date: 2025-11-01
'ENABLE_CATALOG_MICROFRONTEND': False,
### ORA Feature Flags ###
# .. toggle_name: FEATURES['ENABLE_ORA_ALL_FILE_URLS']
# .. toggle_implementation: DjangoSetting

View File

@@ -552,6 +552,7 @@ FEATURES:
ENABLE_API_DOCS: true
ENABLE_ASYNC_ANSWER_DISTRIBUTION: true
ENABLE_AUTHN_MICROFRONTEND: true
ENABLE_CATALOG_MICROFRONTEND: true
ENABLE_AUTO_GENERATED_USERNAME: true
ENABLE_BULK_USER_RETIREMENT: true
ENABLE_CERTIFICATES_IDV_REQUIREMENT: true

View File

@@ -354,6 +354,14 @@ class DiscussionsConfigurationSerializer(serializers.ModelSerializer):
key not in LegacySettingsSerializer.Meta.fields_cohorts
)
}
# Toggle discussion tab is_hidden. Before Palm, we would mark the discussion tab with the is_hidden property.
# Redwood and later, we disable discussions entirely by toggling the discussion configuration enabled property.
# This ensures pre-Palm courses import with discussions tab appropriately shown/hidden.
for tab in course.tabs:
if tab.tab_id == 'discussion' and tab.is_hidden == validated_data.get('enabled'):
tab.is_hidden = not validated_data.get('enabled')
save = True
break
if save:
modulestore().update_item(course, self.context['user_id'])
return instance

View File

@@ -384,6 +384,26 @@ class DataTest(AuthorizedApiTest, DataTestMixin):
assert data['plugin_configuration'] == {'key': 'value'}
assert data['lti_configuration'] == DEFAULT_LTI_CONFIGURATION
@ddt.data(
True,
False,
)
def test_enabled_configuration(self, enabled):
"""
Test that setting the "enabled" property for Discussions shows the Discussions tab.
"""
payload = {
"provider_type": Provider.PIAZZA,
"enabled": enabled,
}
self._post(payload)
data = self.get()
for tab in self.store.get_course(self.course.id).tabs:
if tab.tab_id == "discussion":
assert data["enabled"] == (not tab.is_hidden)
break
def test_change_plugin_configuration(self):
"""
Tests custom config values persist that when changing discussion

View File

@@ -566,7 +566,7 @@ enmerkar==0.7.1
# via enmerkar-underscore
enmerkar-underscore==2.4.0
# via -r requirements/edx/kernel.in
enterprise-integrated-channels==0.1.6
enterprise-integrated-channels==0.1.7
# via -r requirements/edx/bundled.in
event-tracking==3.3.0
# via

View File

@@ -879,7 +879,7 @@ enmerkar-underscore==2.4.0
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
enterprise-integrated-channels==0.1.6
enterprise-integrated-channels==0.1.7
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt

View File

@@ -653,7 +653,7 @@ enmerkar==0.7.1
# enmerkar-underscore
enmerkar-underscore==2.4.0
# via -r requirements/edx/base.txt
enterprise-integrated-channels==0.1.6
enterprise-integrated-channels==0.1.7
# via -r requirements/edx/base.txt
event-tracking==3.3.0
# via

View File

@@ -680,7 +680,7 @@ enmerkar==0.7.1
# enmerkar-underscore
enmerkar-underscore==2.4.0
# via -r requirements/edx/base.txt
enterprise-integrated-channels==0.1.6
enterprise-integrated-channels==0.1.7
# via -r requirements/edx/base.txt
event-tracking==3.3.0
# via