Skip to content
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

Closes #2638: Copy Button for Secrets #2860

Merged
merged 3 commits into from
Feb 21, 2019
Merged

Closes #2638: Copy Button for Secrets #2860

merged 3 commits into from
Feb 21, 2019

Conversation

hSaria
Copy link
Contributor

@hSaria hSaria commented Feb 6, 2019

Fixes: #2638

Added a copy button after unlocking secret.

As mentioned in #2638, the clipboard cannot be modified while running an asynchronous operation (like AJAX call) since the user-triggered event would have been processed before the response is received.
There are hacky solutions, but I'd rather keep things simple. There is a draft API that addresses this challenge, but its support is not wide enough, yet.

Note: I have purposefully avoided adding the copy button to the secret_edit.html page as I see it as unnecessary (you wouldn't normally go to edit to unlock then copy the secret). However, if you'd like it there for consistency, you can copy the button from secret.html (that's the only change needed).

@hSaria hSaria changed the title Copy button Closes #2638: Copy Button for Secrets Feb 6, 2019
@hSaria
Copy link
Contributor Author

hSaria commented Feb 6, 2019

Same as #2848 but adjusted the origin.

@jeremystretch
Copy link
Member

@hSaria Could you move the clipboard library to the project-static directory and change its name to reflect the release version? For example, netbox/project-static/clipboard-1.2.3.min.js This will keep it consistent with the other third-party libraries we pull in.

@jeremystretch jeremystretch added the status: revisions needed This issue requires additional information to be actionable label Feb 21, 2019
@hSaria
Copy link
Contributor Author

hSaria commented Feb 21, 2019

Done :)

@jeremystretch jeremystretch removed the status: revisions needed This issue requires additional information to be actionable label Feb 21, 2019
@jeremystretch jeremystretch merged commit 298152b into netbox-community:develop Feb 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'copy' button to copy passwords next to unlock
2 participants