Skip to content

Commit f0231ba

Browse files
Merge branch 'master' into ktyagi/BOMS-241
2 parents f579d97 + d29e27c commit f0231ba

2 files changed

Lines changed: 3 additions & 40 deletions

File tree

‎cms/djangoapps/contentstore/views/component.py‎

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from xblock.runtime import Mixologist
2323

2424
from cms.djangoapps.contentstore.helpers import get_parent_if_split_test, is_library_content, is_unit
25-
from cms.djangoapps.contentstore.toggles import libraries_v1_enabled, libraries_v2_enabled, use_new_unit_page
25+
from cms.djangoapps.contentstore.toggles import libraries_v2_enabled, use_new_unit_page
2626
from cms.djangoapps.contentstore.xblock_storage_handlers.view_handlers import load_services_for_studio
2727
from common.djangoapps.edxmako.shortcuts import render_to_response
2828
from common.djangoapps.student.auth import has_course_author_access
@@ -49,7 +49,6 @@
4949
'problem',
5050
'itembank',
5151
'library_v2', # Not an XBlock
52-
'library',
5352
'discussion',
5453
'openassessment',
5554
'drag-and-drop-v2',
@@ -275,7 +274,6 @@ def create_support_legend_dict():
275274
'problem': _("Problem"),
276275
'video': _("Video"),
277276
'openassessment': _("Open Response"),
278-
'library': _("Legacy Library"),
279277
'library_v2': _("Library Content"),
280278
'itembank': _("Problem Bank"),
281279
'drag-and-drop-v2': _("Drag and Drop"),
@@ -287,10 +285,9 @@ def create_support_legend_dict():
287285
# by the components in the order listed in COMPONENT_TYPES.
288286
component_types = COMPONENT_TYPES[:]
289287

290-
# Libraries do not support discussions, drag-and-drop, and openassessment and other libraries
288+
# Libraries do not support discussions, drag-and-drop, openassessment, and library_v2/itembank
291289
component_not_supported_by_library = [
292290
'discussion',
293-
'library',
294291
'openassessment',
295292
'drag-and-drop-v2',
296293
'library_v2',
@@ -314,7 +311,7 @@ def create_support_legend_dict():
314311
templates_for_category = []
315312
component_class = _load_mixed_class(category)
316313

317-
if support_level_without_template and category not in ['library']:
314+
if support_level_without_template:
318315
# add the default template with localized display name
319316
# TODO: Once mixins are defined per-application, rather than per-runtime,
320317
# this should use a cms mixed-in class. (cpennington)
@@ -398,37 +395,6 @@ def create_support_legend_dict():
398395
)
399396
categories.add(component)
400397

401-
# Add library block types.
402-
if category == 'library' and not library:
403-
disabled_block_names = [block.name for block in disabled_xblocks()]
404-
library_block_types = [problem_type for problem_type in LIBRARY_BLOCK_TYPES
405-
if problem_type['component'] not in disabled_block_names]
406-
for library_block_type in library_block_types:
407-
component = library_block_type['component']
408-
boilerplate_name = library_block_type['boilerplate_name']
409-
authorable_variations = authorable_xblocks(allow_unsupported=allow_unsupported, name=component)
410-
library_component_support_level = component_support_level(
411-
authorable_variations, component, boilerplate_name
412-
)
413-
if library_component_support_level:
414-
try:
415-
component_display_name = xblock_type_display_name(component, default_display_name=component)
416-
except PluginMissingError:
417-
log.warning(
418-
"Unable to load xblock type %s to read display_name",
419-
component
420-
)
421-
else:
422-
templates_for_category.append(
423-
create_template_dict(
424-
component_display_name,
425-
component,
426-
library_component_support_level,
427-
boilerplate_name
428-
)
429-
)
430-
categories.add(component)
431-
432398
component_templates.append({
433399
"type": category,
434400
"templates": templates_for_category,
@@ -513,8 +479,6 @@ def _filter_disabled_blocks(all_blocks):
513479
Filter out disabled xblocks from the provided list of xblock names.
514480
"""
515481
disabled_block_names = [block.name for block in disabled_xblocks()]
516-
if not libraries_v1_enabled():
517-
disabled_block_names.append('library')
518482
if not libraries_v2_enabled():
519483
disabled_block_names.append('library_v2')
520484
disabled_block_names.append('itembank')

‎cms/djangoapps/contentstore/views/tests/test_block.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2863,7 +2863,6 @@ def test_basic_components(self):
28632863
self._verify_basic_component_display_name("discussion", "Discussion")
28642864
self._verify_basic_component_display_name("video", "Video")
28652865
self._verify_basic_component_display_name("openassessment", "Open Response")
2866-
self.assertGreater(len(self.get_templates_of_type("library")), 0) # noqa: PT009
28672866
self.assertGreater(len(self.get_templates_of_type("html")), 0) # noqa: PT009
28682867
self.assertGreater(len(self.get_templates_of_type("problem")), 0) # noqa: PT009
28692868

0 commit comments

Comments
 (0)