From b70252db944545c8bed642ed59533664807ef847 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Thu, 1 Jun 2023 11:36:53 -0700 Subject: [PATCH] fix: Update text of new clipboard menu, hide it in libraries (#32339) * fix: Use clearer name for the new "Copy" action ("Copy to Clipboard") * fix: Don't show the new copy menu in content libraries (not yet supported) --- cms/djangoapps/contentstore/views/preview.py | 8 +++++--- cms/templates/studio_xblock_wrapper.html | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 01090ff3d1..bf5f463a1e 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -305,8 +305,10 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False): selected_groups_label = _('Access restricted to: {list_of_groups}').format(list_of_groups=selected_groups_label) # lint-amnesty, pylint: disable=line-too-long course = modulestore().get_course(xblock.location.course_key) can_edit = context.get('can_edit', True) + # Is this a course or a library? + is_course = xblock.scope_ids.usage_id.context_key.is_course # Copy-paste is a new feature; while we are beta-testing it, only beta users with the Waffle flag enabled see it - enable_copy_paste = can_edit and ENABLE_COPY_PASTE_FEATURE.is_enabled() + enable_copy_paste = can_edit and is_course and ENABLE_COPY_PASTE_FEATURE.is_enabled() template_context = { 'xblock_context': context, 'xblock': xblock, @@ -316,10 +318,10 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False): 'is_reorderable': is_reorderable, 'can_edit': can_edit, 'enable_copy_paste': enable_copy_paste, - 'can_edit_visibility': context.get('can_edit_visibility', xblock.scope_ids.usage_id.context_key.is_course), + 'can_edit_visibility': context.get('can_edit_visibility', is_course), 'selected_groups_label': selected_groups_label, 'can_add': context.get('can_add', True), - 'can_move': context.get('can_move', xblock.scope_ids.usage_id.context_key.is_course), + 'can_move': context.get('can_move', is_course), 'language': getattr(course, 'language', None) } diff --git a/cms/templates/studio_xblock_wrapper.html b/cms/templates/studio_xblock_wrapper.html index 460cd6a0ae..494afb47a7 100644 --- a/cms/templates/studio_xblock_wrapper.html +++ b/cms/templates/studio_xblock_wrapper.html @@ -147,7 +147,7 @@ block_is_unit = is_unit(xblock)