From 3c116fdbb12355b03e66db8a9f9c15b7242630f6 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Sun, 14 Dec 2025 16:17:56 -0500 Subject: [PATCH 1/4] Add admin delete workspace feature with safeguards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add DELETE /api/admin/members/:orgId endpoint - Block deletion of workspaces with payment history - Require type-to-confirm with exact workspace name - Add delete button and confirmation modal to admin UI - Add integration tests for delete functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- server/public/admin-members.html | 195 +++++++++++++++++- server/src/http.ts | 80 +++++++ .../tests/integration/admin-endpoints.test.ts | 131 +++++++++++- 3 files changed, 402 insertions(+), 4 deletions(-) diff --git a/server/public/admin-members.html b/server/public/admin-members.html index aa51a5f661..edb0c0fe2c 100644 --- a/server/public/admin-members.html +++ b/server/public/admin-members.html @@ -230,6 +230,71 @@ .payment-amount.negative { color: #c33; } + .btn-danger { + background: #dc3545; + color: white; + border: 1px solid #dc3545; + } + .btn-danger:hover { + background: #c82333; + border-color: #bd2130; + } + .btn-danger:disabled { + background: #e4606d; + border-color: #e4606d; + cursor: not-allowed; + } + .delete-warning { + background: #fff3cd; + border: 1px solid #ffc107; + border-radius: 6px; + padding: 15px; + margin-bottom: 20px; + } + .delete-warning h4 { + color: #856404; + margin-bottom: 10px; + } + .delete-warning p { + color: #856404; + margin-bottom: 0; + } + .delete-error { + background: #f8d7da; + border: 1px solid #f5c6cb; + border-radius: 6px; + padding: 15px; + margin-bottom: 20px; + color: #721c24; + } + .confirm-input { + width: 100%; + padding: 10px; + border: 1px solid #e0e0e0; + border-radius: 6px; + font-size: 14px; + margin-top: 10px; + margin-bottom: 10px; + } + .confirm-input:focus { + outline: none; + border-color: #dc3545; + } + .workspace-name-highlight { + font-weight: bold; + background: #f8f9fa; + padding: 2px 6px; + border-radius: 4px; + font-family: monospace; + } + .modal-actions { + display: flex; + gap: 10px; + justify-content: flex-end; + margin-top: 20px; + padding-top: 20px; + border-top: 1px solid #e0e0e0; + } @@ -328,6 +393,33 @@ Payment History + + + + + Delete Workspace + × + + + + This action cannot be undone + Deleting this workspace will remove all associated data including member profiles, join requests, and audit logs. + + + + + To confirm deletion, type the workspace name: + + + + + Cancel + Delete Workspace + + + + + @@ -369,6 +447,19 @@ Loading...
Deleting this workspace will remove all associated data including member profiles, join requests, and audit logs.
To confirm deletion, type the workspace name:
Permanently delete this workspace and all of its data.