AO3-7359 Action to copy admin 2fa backup codes#5671
AO3-7359 Action to copy admin 2fa backup codes#5671brianjaustin wants to merge 2 commits intootwcode:masterfrom
Conversation
sarken
left a comment
There was a problem hiding this comment.
My comments keep vanishing and reappearing, so hopefully they'll be here once I hit this button... 🤞
| </ul> | ||
|
|
||
| <p class="actions"> | ||
| <%= link_to t(".copy_to_clipboard"), "#", id: "copy-totp-backup-codes", onclick: "copyBackupCodes()", style: "visibility: hidden;" %> |
There was a problem hiding this comment.
Since we're doing something rather than going somewhere, can you make this a button? It's better for accessibility and it spares us from having to set the href to # and disable the default link behavior.
| } | ||
| </script> | ||
|
|
||
| <script type=text/javascript defer> |
There was a problem hiding this comment.
Does defer work on inline JavaScript now? I thought it was just for external scripts and inline scripts still needed to be included at the end of the body (we should be able to do that with content_for :footer_js) to avoid blocking page rendering.
Also, minor nitpick, the quotes are missing on type="text/javascript"
config/locales/views/en.yml
Outdated
| backup_codes_copied: Backup codes copied! | ||
| copy_to_clipboard: Copy backup codes to clipboard |
There was a problem hiding this comment.
We prefer titlecase for button text, so "Backup Codes Copied!" (which is admittedly a little odd with the exclamation point -- I'd suggest plain "Copied!" to avoid that, but that would cause a more drastic change in the button size) and "Copy Backup Codes to Clipboard".
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7359
Purpose
Add a button (only visible if Javascript is enabled) to the admin two-step verification backup codes page:

Testing Instructions
To be added in Jira once the design is fully settled
Credit
Brian Austin (they/he)