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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user