consul icon indicating copy to clipboard operation
consul copied to clipboard

ui: Use native functionality for clipboard functionality, but keep a fallback

Open johncowen opened this issue 3 years ago • 2 comments

We recently re-wrote our copy to clipboard functionality to use a non-visual modifier, more details in https://github.com/hashicorp/consul/pull/10511.

@nfagerlund pointed out that we could be using the newer native browser functionality here, so we decided to tweak this a little more to use that instead of ClipboardJS. Our targeted browsers still fall within versions that do not support the newer native browser functionality as yet, so we keep a ClipboardJS polyfill here just incase, but only load that code for folks without window.navigator.clipboard support. End user (engineer) usage is the same for both.

Additionally we noticed we actually ignored our tests around this due to ember-tooltip being problematic https://github.com/hashicorp/consul/pull/8117#discussion_r440800963

We got rid of ember-tooltip a while back and replaced it with our own tooltip modifier, so we un-ignored that test here also (health-check spelling had also changed since then)

We made the service injection slightly less brittle here seeing as we are now switching between 3 implementations instead of just 2, but we can probably make this even better if we move to this to an addon (addons have features/capabilities that aren't available to applications). There also seems to be some interest from other products/folks in using this so we'll leave this as a relatively soon "to be done"/ additional PR.

~I've just noticed one last thing that is potentially a non-user facing engineering bug also 👀 , but that shouldn't block review.~ Ah no it failed tests, awesome, will fix that up now.

P.S. just incase, I've added a no changelog label here also, but I'll add in the final PR where we actually change the user facing feature

johncowen avatar Jul 20 '21 13:07 johncowen

This pull request has been automatically flagged for inactivity because it has not been acted upon in the last 60 days. It will be closed if no new activity occurs in the next 30 days. Please feel free to re-open to resurrect the change if you feel this has happened by mistake. Thank you for your contributions.

github-actions[bot] avatar Feb 22 '22 01:02 github-actions[bot]

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


John Cowen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you already have a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

hashicorp-cla avatar Mar 12 '22 17:03 hashicorp-cla