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

@@ -186,6 +186,19 @@ define(['jquery', 'underscore', 'backbone', 'gettext', 'js/views/pages/base_page
modal = new EditXBlockModal(options);
event.preventDefault();
// check if we want to launch with the new editors (behind waffle flag)
var useNewTextEditor = this.$('.edit-button').attr("use-new-editor-text"),
useNewVideoEditor = this.$('.edit-button').attr("use-new-editor-video"),
useNewProblemEditor = this.$('.edit-button').attr("use-new-editor-problem"),
blockType = xblockElement.find('.xblock').attr("data-block-type");
if( (useNewTextEditor === "True" && blockType === "html") ||
(useNewVideoEditor === "True" && blockType === "video") ||
(useNewProblemEditor === "True" && blockType === "problem")
) {
var destinationUrl = this.$('.edit-button').attr("authoring_MFE_base_url") + '/' + blockType + '/' + this.$('.studio-xblock-wrapper').attr("data-locator");
window.location.replace(destinationUrl);
return;
}
modal.edit(xblockElement, this.model, {
readOnlyView: !this.options.canEdit,
refresh: function() {