Skip to content

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

Merged

Conversation

aldrinabastillas
Copy link
Contributor

@aldrinabastillas aldrinabastillas commented Mar 30, 2019

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):

image

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

@aldrinabastillas aldrinabastillas force-pushed the ft/4300-copy-response-to-clipboard branch from 8e2f227 to d131f46 Compare March 30, 2019 23:37
@aldrinabastillas aldrinabastillas force-pushed the ft/4300-copy-response-to-clipboard branch from 588b6e8 to a8fb7fd Compare March 30, 2019 23:57
* Move next to download button and match styling
* Show only for json, xml, html, and plain text
@aldrinabastillas aldrinabastillas force-pushed the ft/4300-copy-response-to-clipboard branch from 450393c to e8397c3 Compare March 31, 2019 00:04
@heldersepu heldersepu mentioned this pull request Apr 7, 2019
17 tasks
Copy link
Contributor

@heldersepu heldersepu left a 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:

@aldrinabastillas
Copy link
Contributor Author

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.

@heldersepu
Copy link
Contributor

Some unit tests would be nice

@heldersepu
Copy link
Contributor

heldersepu commented Apr 22, 2019

@shockey on the previous PR you mentioned:

I've run this up the flagpole for a UX review

But that was a year ago, any chance this can make it?

@vgiurgiu
Copy link

vgiurgiu commented Apr 23, 2020

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!
Victor

@heldersepu
Copy link
Contributor

heldersepu commented Apr 23, 2020

@vgiurgiu the fact that the last comment was Apr 22, 2019 that tells us this does not seem to be a priority for the team ...
but there are conflicts on this PR as is it won't be merged

@aabastillas-rca
Copy link
Contributor

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.

@tim-lai tim-lai merged commit 973e1f7 into swagger-api:master Jun 15, 2020
@tim-lai
Copy link
Contributor

tim-lai commented Jun 15, 2020

@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!

AdrieanKhisbe added a commit to AdrieanKhisbe/swagger-ui that referenced this pull request Jun 17, 2020
mattyb678 pushed a commit to mattyb678/swagger-ui that referenced this pull request Jun 24, 2020
* 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>
AdrieanKhisbe added a commit to AdrieanKhisbe/swagger-ui that referenced this pull request Jul 3, 2020
tim-lai pushed a commit to tim-lai/swagger-ui that referenced this pull request Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: copy response to clipboard
5 participants