Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: "Copy Unit" button should be behind enable_copy_paste_units flag #33867

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1387,9 +1387,6 @@ def create_xblock_info( # lint-amnesty, pylint: disable=too-many-statements
else:
xblock_info["staff_only_message"] = False

# If the ENABLE_COPY_PASTE_UNITS feature flag is enabled, we show the newer menu that allows copying/pasting
xblock_info["enable_copy_paste_units"] = ENABLE_COPY_PASTE_UNITS.is_enabled()

# If the ENABLE_TAGGING_TAXONOMY_LIST_PAGE feature flag is enabled, we show the "Manage Tags" options
if use_tagging_taxonomy_list_page():
xblock_info["use_tagging_taxonomy_list_page"] = True
Expand All @@ -1402,6 +1399,10 @@ def create_xblock_info( # lint-amnesty, pylint: disable=too-many-statements
xblock, course=course
)

if course_outline or is_xblock_unit:
# If the ENABLE_COPY_PASTE_UNITS feature flag is enabled, we show the newer menu that allows copying/pasting
xblock_info["enable_copy_paste_units"] = ENABLE_COPY_PASTE_UNITS.is_enabled()

if is_xblock_unit and summary_configuration.is_enabled():
xblock_info["summary_configuration_enabled"] = summary_configuration.is_summary_enabled(xblock_info['id'])

Expand Down
1 change: 1 addition & 0 deletions cms/static/js/views/pages/container_subviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function($, _, gettext, BaseView, ViewUtils, XBlockViewUtils, MoveXBlockUtils, H
releaseDateFrom: this.model.get('release_date_from'),
hasExplicitStaffLock: this.model.get('has_explicit_staff_lock'),
staffLockFrom: this.model.get('staff_lock_from'),
enableCopyUnit: this.model.get('enable_copy_paste_units'),
course: window.course,
HtmlUtils: HtmlUtils
})
Expand Down
22 changes: 12 additions & 10 deletions cms/templates/js/publish-xblock.underscore
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,16 @@ var visibleToStaffOnly = visibilityState === 'staff_only';
</li>
</ul>
</div>
<div class="wrapper-pub-actions bar-mod-actions">
<ul>
<li>
<button class="btn btn-outline-primary btn-default action-copy">
<span class="icon fa fa-copy" aria-hidden="true"></span>
<span class="button-label"><%- gettext("Copy Unit") %></span>
</button>
</li>
</ul>
</div>
<% if (enableCopyUnit) { %>
<div class="wrapper-pub-actions bar-mod-actions">
<ul>
<li>
<button class="btn btn-outline-primary btn-default action-copy">
<span class="icon fa fa-copy" aria-hidden="true"></span>
<span class="button-label"><%- gettext("Copy Unit") %></span>
</button>
</li>
</ul>
</div>
<% } %>
</div>
Loading