Skip to content

Commit

Permalink
fix: remove the "Legacy Library" button if libraries v1 are disabled (#…
Browse files Browse the repository at this point in the history
…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.

(cherry picked from commit 9bfdfeb)
  • Loading branch information
pomegranited committed Nov 7, 2024
1 parent 8616aa5 commit d707fa4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cms/djangoapps/contentstore/views/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit d707fa4

Please sign in to comment.