-
Notifications
You must be signed in to change notification settings - Fork 123
refactor: conditionally render Replace video
button & fix redirection URLs
#1915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @bra-i-am! 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. Where 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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1915 +/- ##
==========================================
+ Coverage 94.00% 94.03% +0.02%
==========================================
Files 1154 1154
Lines 24232 24244 +12
Branches 5263 5248 -15
==========================================
+ Hits 22780 22798 +18
+ Misses 1375 1369 -6
Partials 77 77 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8c7a398
to
ef23d37
Compare
Replace video
button & fix redirection URLs
7481120
to
4c704c4
Compare
Can we get some help reviewing this, @openedx/2u-tnl? This is a 2U specific feature we're trying to fix and also put behind the respecting flag so it's off in the community sandbox environment. |
Friendly ping on this @openedx/2u-tnl - thanks! |
Hi @bra-i-am, can you rebase the branch, so that CI passes. As a PR was merged recently related to codecov. |
@@ -23,7 +24,7 @@ export const hooks = { | |||
useReturnToGallery: () => { | |||
const learningContextId = useSelector(selectors.app.learningContextId); | |||
const blockId = useSelector(selectors.app.blockId); | |||
return () => (navigateTo(`/course/${learningContextId}/editor/course-videos/${blockId}`)); | |||
return () => (navigateTo(`/authoring/course/${learningContextId}/editor/course-videos/${blockId}`)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting /authoring/
in here should not be necessary - all the URLs used with react-router should be relative to this app (e.g. starting with /course/
), and the /authoring/
part is automatically added by this line.
Also, it should never be hard-coded. For example, on edx.org they don't use /authoring/
- they use a separate domain for each MFE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the /authoring/
because the redirection in different places worked incorrectly for me due to the navigateTo
function used there; it is not using react-router but window.location
directly.
Screencast.from.03-06-25.16.14.35.webm
However, taking into account that (according to what I understand) the redirection of the Replace video
button is a 2U-specific feature, and you said:
on edx.org they don't use /authoring/ - they use a separate domain for each MFE.
Now it makes sense why the prefix is skipped.
Thank you so much for your review and your explanation. I'm sending the proper modifications ✨
@@ -14,7 +14,7 @@ export const { | |||
export const postUploadRedirect = (storeState, uploadType = 'selectedVideoUrl') => { | |||
const learningContextId = selectors.app.learningContextId(storeState); | |||
const blockId = selectors.app.blockId(storeState); | |||
return (videoUrl) => navigateTo(`/course/${learningContextId}/editor/video/${blockId}?${uploadType}=${videoUrl}`); | |||
return (videoUrl) => navigateTo(`/authoring/course/${learningContextId}/editor/video/${blockId}?${uploadType}=${videoUrl}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here - don't hard-code /authoring/
and you shouldn't actually need it at all.
@mariajgrimaldi TNL at 2U has pretty limited availability for reviews these days. Is there any specific questions we can ask that would help them review this faster? |
…rModal and VideoSettingsModal
…fle_flags response in CourseUnit tests
4c704c4
to
5ce9168
Compare
Description
Fix the error that makes the page go blank after clicking the
Replace video
button.With some frequent changes, the page does not go blank, but the
Replace video
button closes the modal without redirecting to the video gallery view. This PR adds the prefix/authoring/
to some URLs, which caused the page to go blank after clickingReplace video
. On the other hand, taking into account the comment #1540 (comment) , it fetches the waffle flags so it can check and render the buttonReplace video
conditionally.Supporting information
openedx/wg-build-test-release#418
Testing instructions
Evidence
Before
The button
Replace video
appears, but it does nothing; it only closes the modalScreencast from 07-05-25 17:08:13.webm
After
The button
Replace Video
can be hidden or shown by changing the WaffleFlagcontentstore.new_studio_mfe.use_new_video_uploads_page
; now, when the flag is on, the user is redirected to the video gallery viewScreencast from 07-05-25 17:09:22.webm