Skip to content

Fix admin user delete flow#79

Merged
brianclemens merged 1 commit intoresf:mainfrom
rockythorn:fix/admin-user-delete-button
Apr 21, 2026
Merged

Fix admin user delete flow#79
brianclemens merged 1 commit intoresf:mainfrom
rockythorn:fix/admin-user-delete-button

Conversation

@rockythorn
Copy link
Copy Markdown
Collaborator

The Carbon 1.23 web-component modal has incomplete CSS (no visible-state rule for :host(bx-modal[open])), so the delete confirmation never rendered. Replace with a plain form and native confirm() to unblock delete without a Carbon upgrade.

Drop the "cannot delete admin users" rule from the route: the self-delete guard already prevents the only real lockout risk, and blocking admin-on-admin deletion was surprising behavior for an admin UI.

Add tests covering delete success, admin-delete regression, self-delete blocked, and not-found. Ignore CLAUDE.md and temp/ so assistant context and scratch work don't get committed.

The Carbon 1.23 web-component modal has incomplete CSS (no visible-state
rule for :host(bx-modal[open])), so the delete confirmation never
rendered. Replace with a plain form and native confirm() to unblock
delete without a Carbon upgrade.

Drop the "cannot delete admin users" rule from the route: the
self-delete guard already prevents the only real lockout risk, and
blocking admin-on-admin deletion was surprising behavior for an admin
UI.

Add tests covering delete success, admin-delete regression, self-delete
blocked, and not-found. Ignore CLAUDE.md and temp/ so assistant context
and scratch work don't get committed.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the admin user deletion UX by removing reliance on a Carbon web-component modal that doesn’t render properly in the current version, and it simplifies server-side deletion rules by allowing admins to delete other admins (while still preventing self-deletion). It also adds automated coverage for the delete route and wires the new test into Bazel + CI.

Changes:

  • Replace the broken Carbon modal delete confirmation with a plain POST form + native confirm() prompt.
  • Remove the “cannot delete admin users” guard in the delete route, keeping the self-delete protection.
  • Add Bazel/CI-wired tests covering delete success, admin-delete regression, self-delete blocked, and not-found.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apollo/server/templates/admin_user.jinja Replaces modal-driven delete confirmation with a simple form submission + browser confirm.
apollo/server/routes/admin_users.py Removes the admin-role deletion restriction while retaining the self-delete guard.
apollo/tests/test_admin_users.py Adds route-level behavior tests for delete flows (success, admin target, self-delete, not-found).
apollo/tests/BUILD.bazel Registers the new test as a Bazel py_test.
.github/workflows/test.yaml Ensures the new Bazel test target runs in CI.
.gitignore Ignores CLAUDE.md and temp/ to avoid accidental commits of assistant/scratch artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@jdieter jdieter left a comment

Choose a reason for hiding this comment

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

This looks sane to me.

@rockythorn rockythorn requested a review from brianclemens April 21, 2026 15:08
@brianclemens brianclemens merged commit de35403 into resf:main Apr 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants