-
Notifications
You must be signed in to change notification settings - Fork 361
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
[ENHANCEMENT] Add Copy to clipboard suport to discount codes, order ids, payment ids and more. #3217
base: dev
Are you sure you want to change the base?
Conversation
…nstead of open edit page
This link isn’t broken as is. It doesn’t open the edit page. It duplicates the discount code as a new code with same settings. Let’s discuss whether the word copy is misleading and duplicate is better. |
Should I close this one then @kimcoleman ? |
We can chat about this in a dev meeting. ‘click to copy’ would be nice some other places in the plugin. |
8a98984
to
d6110ef
Compare
* Add button / icon that show / hide on hover / blur and let user copy code to the clipboard
d6110ef
to
9b3d31a
Compare
When testing, the If we're adding this behavior for copying the "discount code" code, maybe we should also add this for copying order codes as well. Or maybe we want a more universal solution that could even be used for payment/subscription IDs. |
Hey @dparker1005 I took navigator.clipboard support from here -> https://caniuse.com/mdn-api_navigator_clipboard It seems pretty supported to me, but fair enough to hide the button if the browser doesn't support. Also, we can try a more universal solution, happy to add more effort to this PR to bring functionality to orders and payment / subs ids |
…ns from the DOM * Add further buttons to allow copy to clibboard order ids, subscriptions id, payment and transaction ids.
02324ef
to
4fbc860
Compare
…nstead of open edit page
All Submissions:
Changes proposed in this Pull Request:
This PR adds small button/icon next to the codes (discount codes, subscripton ids, order id, payment id) and event handlers in the JS admin file to allow users copy to the clipboard those codes.
How to test the changes in this Pull Request:
To test the scenario where the user's browser doesn't have access to clipboard API just start an instance without HTTPS.
To test the happy path scenario just go through different places with buttons and either click to copy and paste it somewhere else. Also it's possible to navigate with tab and copy hitting enter key for accessibility sake.
Other information:
Changelog entry