fix: hide library_v2 and itembank in legacy library page (#35772)

Hide options to add library_v2 and itembank blocks in legacy library
page.
This commit is contained in:
Navin Karkera
2024-11-12 20:36:41 +05:30
committed by GitHub
parent a816d75c59
commit 68739ce73c
2 changed files with 10 additions and 1 deletions

View File

@@ -279,7 +279,14 @@ def get_component_templates(courselike, library=False): # lint-amnesty, pylint:
component_types = COMPONENT_TYPES[:]
# Libraries do not support discussions, drag-and-drop, and openassessment and other libraries
component_not_supported_by_library = ['discussion', 'library', 'openassessment', 'drag-and-drop-v2']
component_not_supported_by_library = [
'discussion',
'library',
'openassessment',
'drag-and-drop-v2',
'library_v2',
'itembank',
]
if library:
component_types = [component for component in component_types
if component not in set(component_not_supported_by_library)]

View File

@@ -403,6 +403,8 @@ class UnitTestLibraries(CourseTestCase):
self.assertNotIn('advanced', templates)
self.assertNotIn('openassessment', templates)
self.assertNotIn('library', templates)
self.assertNotIn('library_v2', templates)
self.assertNotIn('itembank', templates)
def test_advanced_problem_types(self):
"""