-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Copy response to clipboard #4300 #5278
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
Copy response to clipboard #4300 #5278
Conversation
8e2f227
to
d131f46
Compare
588b6e8
to
a8fb7fd
Compare
* Move next to download button and match styling * Show only for json, xml, html, and plain text
450393c
to
e8397c3
Compare
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.
There are a couple of places in src/core/components/response-body.jsx
where we are not passing canCopy, I think it should be there too:
bodyEl = <HighlightCode downloadable fileName={`${downloadName}.txt`} value={ content } /> <HighlightCode downloadable fileName={`${downloadName}.txt`} value={ parsedContent } />
Sorry for the late response! Comment got filtered in my inbox; let me know if I have other changes to make or need to clean up the branch at all. |
Some unit tests would be nice |
@shockey on the previous PR you mentioned:
But that was a year ago, any chance this can make it? |
Hi @aldrinabastillas - we have a set of Swagger APIs and customers are asking about a "copy to clipboard" functionality. My Google searches led me to this pull request and I can't tell by the comments or commits how close it is to being merged. Or is this functionality already available? Thanks! |
@vgiurgiu the fact that the last comment was |
# Conflicts: # package-lock.json
Hi all, I simply just merged master back in. Not sure who else on the team needs to approve before it's okay to close out the PR. |
@aldrinabastillas @aabastillas-rca Merged! Thanks for the contribution and patience to get this merged! @heldersepu Thanks for the review, it helped get this PR merged! |
* Move next to download button and match styling Co-authored-by: Aldrin Abastillas <AAbastillas@rcanalytics.com> Co-authored-by: Tim Lai <timothy.lai@gmail.com>
Description
Adds a button to copy response to clipboard next to the download button.
Cherry-picked from open PR 4312, updated styling and of responses the button should be available for
Motivation and Context
Fixes #4300
Reduces scrolling when having to Ctrl+A + Ctrl+C for large payloads
How Has This Been Tested?
Manually tested in ui with json, xml, html, and text responses.
Screenshots (if appropriate):
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests