-
Notifications
You must be signed in to change notification settings - Fork 215
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
fix: course update iframe #1204
fix: course update iframe #1204
Conversation
Thanks for the pull request, @CefBoud! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
Hi @CefBoud, thanks for these changes! I'm lining them up for a test run now. |
@CefBoud there are some failed checks that require attention. |
ae9c8a8
to
657b146
Compare
@e0d Thank you for the heads up. I just pushed a fix. |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1204 +/- ##
==========================================
+ Coverage 88.04% 88.08% +0.03%
==========================================
Files 266 268 +2
Lines 4518 4565 +47
Branches 1142 1149 +7
==========================================
+ Hits 3978 4021 +43
- Misses 526 529 +3
- Partials 14 15 +1
☔ View full report in Codecov by Sentry. |
@CefBoud thanks, all 🟢 @mphilbrick211 I've moved to ready for review. |
@itsjeyd - flagging for you! |
@mphilbrick211 @e0d Thanks! |
I closed the PR by mistake. I am sorry for the confusion. |
@CefBoud I'm lining this up for another test run. Who is your OpenCraft reviewer for this PR? |
@CefBoud OK, let me know when you get approval from him so we can line this up for upstream engineering review :) |
@itsjeyd It has been approved. 🙂 |
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.
@mattcarter This PR is ready for engineering review by Aurora. |
Hey @mattcarter, a friendly reminder to line this PR up for engineering review. |
@CefBoud Just to keep you in the loop, we're still working on getting this PR unblocked. |
@BbrSofiane A similar question here: Would you be able to review this PR as a CC? |
Calling remaining CCs for frontend-app-learning: @brian-smith-tcril Would one of you have bandwidth for reviewing and merging this PR? |
@CefBoud 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Intro
This PR addresses a bug that emerges in course updates displayed in the
LmsHtmlFragment
component. Currently, we rely on the body's scrollHeight to set the iframe 's height. This poses a problem in case the body node's height is inferior to the html node's height resulting in hidden content. (cf. example below)This PR also deals with another issue regarding the
Show More
button and whether the message can be shortened. Presently, we compare the original update's length with a truncated version's length to determine if the message can be shortened. We rely on truncate-html module to truncate the message. This module parses the content before the truncating and can change its length even if there is no need for truncating.In addition,
truncate-html
strips comments regardless of truncating and this results in a length change. That's why this PR introduces a "cleaning" step that aims to format the update into a canonical format before truncating it.useMemo
is also used to avoid recomputing the truncate at every render.Reproducing insufficient height issue
1- head to studio Course Update section e.g. http://localhost:18010/course_info/course-v1:edX+DemoX+Demo_Course
2- Create a course update containing the following HTML:
3 - Head to the course http://localhost:2000/course/course-v1:edX+DemoX+Demo_Course/home and notice that the lower part of the update is not fully displayed after clicking on
Show More
demo_course_update.mp4
Reproducing unnecessary "Show More"
1- head to studio Course Update section e.g. http://localhost:18010/course_info/course-v1:edX+DemoX+Demo_Course
2- Create a course update containing the following HTML:
3 - Head to the course http://localhost:2000/course/course-v1:edX+DemoX+Demo_Course/home
4 - The
Show More
button is displayed.