feat: encode uri on new editors (#29825)

In order to complete https://openedx.atlassian.net/browse/TNL-9320, we need to better encode the URI of the editor using the block id.
We also need to allow users to navigate out of the editors while it is a new page using the back button for a11y reasons.
This commit is contained in:
connorhaugh
2022-01-27 07:59:38 -05:00
committed by GitHub
parent 513b682005
commit e5a9ddcd87

View File

@@ -195,8 +195,8 @@ define(['jquery', 'underscore', 'backbone', 'gettext', 'js/views/pages/base_page
(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);
var destinationUrl = this.$('.edit-button').attr("authoring_MFE_base_url") + '/' + blockType + '/' + encodeURI(xblockElement.find('.xblock').attr("data-usage-id"));
window.location.href = destinationUrl;
return;
}
modal.edit(xblockElement, this.model, {