Skip to content
Draft
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
21 changes: 1 addition & 20 deletions cms/djangoapps/contentstore/toggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,6 @@ def exam_setting_view_enabled(course_key):
return not LEGACY_STUDIO_EXAM_SETTINGS.is_enabled(course_key)


# .. toggle_name: legacy_studio.video_editor
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Video component (a.k.a. video block) editor.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_VIDEO_EDITOR = CourseWaffleFlag('legacy_studio.video_editor', __name__)


def use_new_video_editor(course_key):
"""
Returns a boolean = true if new video editor is enabled
"""
return not LEGACY_STUDIO_VIDEO_EDITOR.is_enabled(course_key)


# .. toggle_name: legacy_studio.pdf_editor
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
Expand All @@ -129,7 +110,7 @@ def use_new_pdf_editor():
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2023-04-03
# .. toggle_target_removal_date: 2023-6-01
# .. toggle_warning: You need to activate the `new_core_editors.use_new_video_editor` flag to use this new flow.
# .. toggle_warning: This controls the new core video xblock editor flow.
ENABLE_VIDEO_GALLERY_FLOW_FLAG = WaffleFlag('new_core_editors.use_video_gallery_flow', __name__)


Expand Down
10 changes: 4 additions & 6 deletions cms/static/js/views/pages/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,11 @@ function($, _, Backbone, gettext, BasePage,
if (!options || options.view !== 'visibility_view') {
const primaryHeader = $(event.target).closest('.xblock-header-primary, .nav-actions');

var useNewVideoEditor = primaryHeader.attr('use-new-editor-video'),
blockType = primaryHeader.attr('data-block-type'),
var blockType = primaryHeader.attr('data-block-type'),
useNewPdfEditor = primaryHeader.attr('use-new-editor-pdf');

if((blockType === 'html')
|| (useNewVideoEditor === 'True' && blockType === 'video')
|| (blockType === 'video')
|| (blockType === 'problem')
|| (useNewPdfEditor === 'True' && blockType === 'pdf')
) {
Expand Down Expand Up @@ -1204,8 +1203,7 @@ function($, _, Backbone, gettext, BasePage,
},

onNewXBlock: function(xblockElement, scrollOffset, is_duplicate, data) {
var useNewVideoEditor = this.$('.xblock-header-primary').attr('use-new-editor-video'),
useVideoGalleryFlow = this.$('.xblock-header-primary').attr("use-video-gallery-flow");
var useVideoGalleryFlow = this.$('.xblock-header-primary').attr("use-video-gallery-flow");

// find the block type in the locator if availible
if(data.hasOwnProperty('locator')) {
Expand All @@ -1214,7 +1212,7 @@ function($, _, Backbone, gettext, BasePage,
}
// open mfe editors for new blocks only and not for content imported from libraries
if(!data.hasOwnProperty('upstreamRef') && (blockType.includes('html')
|| (useNewVideoEditor === 'True' && blockType.includes('video'))
|| (blockType.includes('video'))
|| (blockType.includes('problem')))
){
if (this.options.isIframeEmbed && (this.isSplitTestContentPage || this.isVerticalContentPage)) {
Expand Down
4 changes: 1 addition & 3 deletions cms/templates/container.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from django.utils.translation import gettext as _

from cms.djangoapps.contentstore.helpers import xblock_studio_url, xblock_type_display_name
from cms.djangoapps.contentstore.toggles import use_new_pdf_editor, use_new_video_editor, use_video_gallery_flow
from cms.djangoapps.contentstore.toggles import use_new_pdf_editor, use_video_gallery_flow
from cms.djangoapps.contentstore.utils import get_editor_page_base_url
from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string
Expand Down Expand Up @@ -111,7 +111,6 @@
<%block name="content">

<%
use_new_editor_video = use_new_video_editor(xblock_locator.course_key)
use_new_editor_pdf = use_new_pdf_editor()
use_new_video_gallery_flow = use_video_gallery_flow()
%>
Expand Down Expand Up @@ -167,7 +166,6 @@ <h1 class="page-header-title xblock-field-value incontext-editor-value"><span cl
</div>

<nav class="nav-actions" aria-label="${_('Page Actions')}"
use-new-editor-video = ${use_new_editor_video}
use-new-editor-pdf = ${use_new_editor_pdf}
use-video-gallery-flow = ${use_new_video_gallery_flow}
authoring_MFE_base_url = ${get_editor_page_base_url(xblock_locator.course_key)}
Expand Down
4 changes: 1 addition & 3 deletions cms/templates/studio_xblock_wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string
)
from cms.djangoapps.contentstore.toggles import use_new_pdf_editor, use_new_video_editor, use_video_gallery_flow
from cms.djangoapps.contentstore.toggles import use_new_pdf_editor, use_video_gallery_flow
from cms.lib.xblock.upstream_sync import UpstreamLink
from openedx.core.djangoapps.content_tagging.toggles import is_tagging_feature_disabled
%>
<%
use_new_editor_video = use_new_video_editor(xblock.context_key)
use_new_editor_pdf = use_new_pdf_editor()
use_new_video_gallery_flow = use_video_gallery_flow()
use_tagging = not is_tagging_feature_disabled()
Expand Down Expand Up @@ -83,7 +82,6 @@
is-collapsed
% endif
"
use-new-editor-video = ${use_new_editor_video}
use-new-editor-pdf = ${use_new_editor_pdf}
use-video-gallery-flow = ${use_new_video_gallery_flow}
authoring_MFE_base_url = ${get_editor_page_base_url(xblock.location.course_key)}
Expand Down
Loading