From e5a9ddcd87f65d8d9cf613681e6ab8e9e7d2206a Mon Sep 17 00:00:00 2001 From: connorhaugh <49422820+connorhaugh@users.noreply.github.com> Date: Thu, 27 Jan 2022 07:59:38 -0500 Subject: [PATCH] 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. --- cms/static/js/views/pages/container.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/static/js/views/pages/container.js b/cms/static/js/views/pages/container.js index 9500f5c4a9..66e2b66830 100644 --- a/cms/static/js/views/pages/container.js +++ b/cms/static/js/views/pages/container.js @@ -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, {