fix: remove the "Legacy Library" button if libraries v1 are disabled (#35736)
Removes the "Legacy Library" button from the legacy Studio "new block" button array if Libraries v1 are disabled, either via waffle flag or via the ENABLE_CONTENT_LIBRARIES feature flag.
This commit is contained in:
@@ -26,7 +26,12 @@ from common.djangoapps.student.auth import has_course_author_access
|
||||
from common.djangoapps.xblock_django.api import authorable_xblocks, disabled_xblocks
|
||||
from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag
|
||||
from cms.djangoapps.contentstore.helpers import is_unit
|
||||
from cms.djangoapps.contentstore.toggles import libraries_v2_enabled, use_new_problem_editor, use_new_unit_page
|
||||
from cms.djangoapps.contentstore.toggles import (
|
||||
libraries_v1_enabled,
|
||||
libraries_v2_enabled,
|
||||
use_new_problem_editor,
|
||||
use_new_unit_page,
|
||||
)
|
||||
from cms.djangoapps.contentstore.xblock_storage_handlers.view_handlers import load_services_for_studio
|
||||
from openedx.core.lib.xblock_utils import get_aside_from_xblock, is_xblock_aside
|
||||
from openedx.core.djangoapps.discussions.models import DiscussionsConfiguration
|
||||
@@ -488,6 +493,8 @@ def _filter_disabled_blocks(all_blocks):
|
||||
Filter out disabled xblocks from the provided list of xblock names.
|
||||
"""
|
||||
disabled_block_names = [block.name for block in disabled_xblocks()]
|
||||
if not libraries_v1_enabled():
|
||||
disabled_block_names.append('library')
|
||||
if not libraries_v2_enabled():
|
||||
disabled_block_names.append('library_v2')
|
||||
disabled_block_names.append('itembank')
|
||||
|
||||
Reference in New Issue
Block a user