[Console] Fix copy as cURL#97968
Conversation
|
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
yuliacech
left a comment
There was a problem hiding this comment.
Hi @jloleysens, thanks a lot for fixing this bug!
Since execCommand is already deprecated and supported browsers are evergreen, I would suggest removing the legacy function and instead notify the user with an error popup or similar if the clipboard copy failed, WDYT?
|
@yuliacech thanks for the review! I agree with your suggestion. Especially if we guard this button with a check for the presence of the system "clipboard" as the previous was guarded by the copy command check. Would you mind taking another look? |
yuliacech
left a comment
There was a problem hiding this comment.
Thanks @jloleysens , code changes LGTM! 👍
It doesn't look like we have tests for this plugin though, right?
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
We do have some CIT coverage here: I'll open an issue to capture this work! |
|
Opened: #98158 |
* updated code to use Clipboard API rather than document.execCommand * added link to deprecation of document.execCommand * removed legacy copy text method
* updated code to use Clipboard API rather than document.execCommand * added link to deprecation of document.execCommand * removed legacy copy text method
* updated code to use Clipboard API rather than document.execCommand * added link to deprecation of document.execCommand * removed legacy copy text method
* updated code to use Clipboard API rather than document.execCommand * added link to deprecation of document.execCommand * removed legacy copy text method
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Summary
Fix #97828
Updated copy as cURL functionality to rather use the Clipboard API via
navigator.clipboard.Release note
We fixed the "Copy as cURL" functionality in Console which was not copying to the system clipboard on newer browser versions.
Checklist