Skip to content

AO3-7359 Action to copy admin 2fa backup codes#5671

Open
brianjaustin wants to merge 2 commits intootwcode:masterfrom
brianjaustin:AO3-7359
Open

AO3-7359 Action to copy admin 2fa backup codes#5671
brianjaustin wants to merge 2 commits intootwcode:masterfrom
brianjaustin:AO3-7359

Conversation

@brianjaustin
Copy link
Copy Markdown
Member

Pull Request Checklist

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

Testing Instructions

To be added in Jira once the design is fully settled

Credit

Brian Austin (they/he)

Copy link
Copy Markdown
Collaborator

@sarken sarken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;" %>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Comment on lines +500 to +501
backup_codes_copied: Backup codes copied!
copy_to_clipboard: Copy backup codes to clipboard
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

@brianjaustin brianjaustin changed the title AO3-7359 Link to copy admin 2fa backup codes AO3-7359 Action to copy admin 2fa backup codes Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants