From 5b7deaf24a3b3fdddea46ba0ac2f79be0781e6b5 Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Wed, 13 Nov 2024 10:42:41 +0530 Subject: [PATCH] fix: hide library_v2 and itembank in legacy library page (#35772) (#35773) Hide options to add library_v2 and itembank blocks in legacy library page. (cherry picked from commit 68739ce73cdbf2f660ba294c9a32be28e395fbde) --- cms/djangoapps/contentstore/views/component.py | 9 ++++++++- cms/djangoapps/contentstore/views/tests/test_library.py | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 6767467e20f4..f4dcd66d9a7f 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -279,7 +279,14 @@ def create_support_legend_dict(): 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)] diff --git a/cms/djangoapps/contentstore/views/tests/test_library.py b/cms/djangoapps/contentstore/views/tests/test_library.py index 8278cd0535bb..b6c5765c5108 100644 --- a/cms/djangoapps/contentstore/views/tests/test_library.py +++ b/cms/djangoapps/contentstore/views/tests/test_library.py @@ -403,6 +403,8 @@ def test_get_component_templates(self): 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): """