-
Notifications
You must be signed in to change notification settings - Fork 14k
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: Unable to download the Dashboard as image in case there's an image added through Markdown #20362
fix: Unable to download the Dashboard as image in case there's an image added through Markdown #20362
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20362 +/- ##
=======================================
Coverage 66.70% 66.70%
=======================================
Files 1739 1739
Lines 65135 65135
Branches 6897 6897
=======================================
Hits 43450 43450
Misses 19932 19932
Partials 1753 1753
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
/testenv up |
@rusackas Ephemeral environment spinning up at http://34.214.185.119:8080. Credentials are |
On the ephemeral environment linked above, I added a couple images to the markdown widget, and they both appear in the screenshot just fine! Not sure what you did to get the blank/broken image to appear ¯\_(ツ)_/¯ |
The |
Otherwise, just needs a rebase and it looks good! |
…ge added through Markdown
9a8620d
to
302b402
Compare
Did you try the example from the testing instructions? The problem is not all images, is the one that we fail to query, due to cors issue for example. |
@diegomedina248 We ran into this as well, with different types of errors (HTTP 401, 404, etc. on the image we were trying to embed). In your opinion, could this be cherry-picked to LTS / 1.5? |
@cccs-tom yeah, this should be good to go. |
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.
LGTM!
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
Users can add Markdown to their Dashboards, which allow to include images using
<img src="$link">
. However, if the Dashboard has an image added this way, the Download as image functionality will fail.The problem is that, depending on where do we source the image from, we could run into CORS issues.
That, however, show not make the image generation fail.
The library that we use,
dom-to-image
, is pretty much deprecated and hasn't received updates for a long while.This PR replaces the library for a fork that's been rewritten and well maintained:
dom-to-image-more
.The library does not fail, and instead shows a placeholder if it can't fetch the image.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
Screen.Recording.2022-06-13.at.12.40.59.mov
After:
new.mov
TESTING INSTRUCTIONS
Ensure the dashboard image is generated.
ADDITIONAL INFORMATION