fix: return relative path from get_proctored_exam_settings_url to prevent double /authoring prefix in MFE sidebar#38652
Conversation
|
Thanks for the pull request, @Anas12091101! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
3ab330b to
b5a9aef
Compare
b5a9aef to
6cdf9d6
Compare
Description
The "Proctored exam settings" sidebar link generates a double
/authoring/authoring/prefix on deployments whereCOURSE_AUTHORING_MICROFRONTEND_URLincludes the/authoringpath (same-origin setup).Root Cause
Frontend commit
f9ef00e2(PR #1372, Nov 2024) changedHelpSidebarLinkto use React Router<Link>by default (isNewPage=true).When the backend returns a path like
/authoring/course/.../proctoring/settings, React Router prepends its basename (/authoring) → resulting in/authoring/authoring/course/....The proctored exam link in
HelpSidebar.tsxwas never updated to account for this change.Fix
Return a relative path (
/course/{id}/pages-and-resources/proctoring/settings) fromget_proctored_exam_settings_urlwithout the MFE base URL prefix. This is consistent with how all other sidebar links are constructed client-side. React Router correctly resolvesbasename + path=/authoring/course/{id}/....Useful information to include:
Which edX user roles will this change impact? Course Author
Include screenshots for changes to the UI (ideally, both "before" and "after" screenshots, if applicable).
Provide links to the description of corresponding configuration changes. Remember to correctly annotate these
changes.
Supporting information
https://github.com/mitodl/hq/issues/11294
Testing instructions
/authoring/course/{course_id}/pages-and-resources/proctoring/settings(single/authoringprefix, not double/authoring/authoring/)Note: This bug only manifests on same-origin deployments where the MFE is served under
/authoringon the same domain as CMS. It does not reproduce on setups where the MFE runs on a different port/domain (e.g. local dev with Tutor).Note: This bug only manifests when
COURSE_AUTHORING_MICROFRONTEND_URLis configured as a relative path (e.g.,/authoring) rather than a complete URL (e.g.,https://studio.example.com/authoring). When set to a complete URL, React Router's<Link>component treats it as an external link and doesn't prepend the basename, so the double prefix doesn't occur. Setting the full URL in site configurations is a workaround, but this fix ensures the link works correctly regardless of how the setting is configured.Want me to adjust the wording?
Deadline
"None"
Other information
Include anything else that will help reviewers and consumers understand the change.