feat(admin): route every significant admin action through the shared confirm (BUNYIP-430) #430
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-430-shared-admin-confirm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What and why
Every significant, hard-to-reverse admin control now routes through the one shared confirmation dialog and names both the action and the specific user it affects, so an admin who clicked the wrong row is told who they are about to change before anything happens.
The shared component is the
data-confirmattribute plus a single delegated submit handler inassets/js/app.jsthat prompts on submit and cancels the POST when the admin declines. It already existed and is CSP-safe. The pre-v0.9.0 controls used inlineonsubmit="return confirm(...)", which the strict Content-Security-Policy (script-src 'self', no inline handlers) silently blocks: that is why production fired Grant/Revoke lifetime and Reset password on a single unconfirmed click. Current main already migrated todata-confirm, so v0.9.1 (the hotfix already cut) restores the confirmations; this PR adds the user's name and closes the coverage gaps, rather than a third round of per-button dialogs.Changes
user_actions_card(target, is_admin_target)so the confirmations are unit-testable. Grant lifetime, Revoke lifetime, Reset password, role change (BUNYIP-109), Suspend and Delete now name the target user by email.data-confirm(cancelling the shared dialog leaves state unchanged).Admin-surface sweep (acceptance criterion 6)
Routed through the dialog by this PR: grant/revoke app entitlement, restore-from-backup, delete documentation entry.
Already confirmed (left as-is, now the one shared component): Grant/Revoke lifetime, Reset password, role change, Suspend, Delete user, force-verify email, clear 2FA, reactivate user, Stripe product/price archive, IP-ban lift, rate-limit reset, rate-limit-config revert, feedback delete, application delete, application-group delete.
Deliberately NOT confirmed, with reason:
Acceptance criteria
data-confirmattribute + the one app.js handler).Verification
just check-containergreen: fmt + clippy-D warnings+ full suite (171 web tests incl. 5 new BUNYIP-430 tests, 312 domain). The confirmations are server-rendered markup pinned by exact-string tests on the realuser_actions_card; the dialog itself is the nativewindow.confirmthe app.js handler already drives for the otherdata-confirmforms.🤖 Generated with Claude Code
https://claude.ai/code/session_018TXaT3P192nDsZzbzHETb9