feat: add flags to studio for editors work (#29536)

Description
In order to support ongoing editor work we need to open blocks in the course_authoring MFE from studio. We are gating that rollout behind a flag. This work does that for each of the new blocks, as well as provides urls to do so.

Supporting information
List of flags:
new_core_editors.use_new_text_editor
new_core_editors.use_new_video_editor
new_core_editors.use_new_problem_editor

Documentation of those flags:
Planned Removal Work: https://openedx.atlassian.net/browse/TNL-9370
This commit is contained in:
connorhaugh
2021-12-21 10:55:23 -05:00
committed by GitHub
parent 66eae81add
commit 4d834b977f
5 changed files with 97 additions and 4 deletions

View File

@@ -2,13 +2,17 @@
<%!
from django.utils.translation import gettext as _
from cms.djangoapps.contentstore.views.helpers import xblock_studio_url
from cms.djangoapps.contentstore.utils import is_visible_to_specific_partition_groups
from cms.djangoapps.contentstore.utils import is_visible_to_specific_partition_groups, get_editor_page_base_url
from lms.lib.utils import is_unit
from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string
)
from cms.djangoapps.contentstore.toggles import use_new_text_editor, use_new_problem_editor, use_new_video_editor
%>
<%
use_new_editor_text = use_new_text_editor()
use_new_editor_video = use_new_video_editor()
use_new_editor_problem = use_new_problem_editor()
xblock_url = xblock_studio_url(xblock)
show_inline = xblock.has_children and not xblock_url
section_class = "level-nesting" if show_inline else "level-element"
@@ -76,7 +80,12 @@ block_is_unit = is_unit(xblock)
% if can_edit:
% if not show_inline:
<li class="action-item action-edit">
<button class="btn-default edit-button action-button">
<button class="btn-default edit-button action-button"
use-new-editor-text = ${use_new_editor_text}
use-new-editor-video = ${use_new_editor_video}
use-new-editor-problem = ${use_new_editor_problem}
authoring_MFE_base_url = ${get_editor_page_base_url(xblock.location.course_key)}
>
<span class="icon fa fa-pencil" aria-hidden="true"></span>
<span class="action-button-text">${_("Edit")}</span>
</button>