feat(admin): dedicated routes for user management (#37) #47
Reference in New Issue
Block a user
Delete Branch "feat/35-profile-page"
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?
Summary
/admin/users/newand/admin/users/[id]/admin/users/newpage: create a user with all profile fields (login, password, first/last name, birth date, email, contact, groups) in one step/admin/users/[id]page: edit all profile fields, group assignments, and optionally set a new password without requiring the current password (admin override)PUT /api/users/{id}backend endpoint (ADMIN_USERpermission) backed byAdminUpdateUserRequestDTO andUserService.adminUpdateUser()CreateUserRequestwith profile fields so creation is a single API callTest plan
admin/page.svelte.spec.ts,admin/users/new/page.svelte.spec.ts,admin/users/[id]/page.svelte.spec.ts)npm run test)npm run check— 0 errorsnpm run lint— cleanmvnw clean package -DskipTests)/admin/users/new, verify profile fields saved/admin/users/[id], change password without entering current password🤖 Generated with Claude Code
- New GET /admin/users/new page: create user with all profile fields (login, password, firstName, lastName, birthDate, email, contact, groups) - New GET /admin/users/[id] page: edit user profile, groups, and optional password change without requiring current password - New PUT /api/users/{id} backend endpoint (ADMIN_USER permission) with AdminUpdateUserRequest DTO for admin-override user updates - Refactored admin users tab: replaced inline editing with edit links to dedicated routes; create button now links to /admin/users/new - Extended CreateUserRequest with profile fields so new users can be created with full profile data in a single request - Added 28 component tests across 3 new spec files (TDD) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>- admin: add exact:true to tab button assertions to avoid strict-mode violations from "Benutzer löschen" title buttons matching "Benutzer" - admin: change tag-row locator from hasText regex on <li> to has: span filter (more robust against whitespace differences); add waitForSelector after tab click to ensure panel is rendered before hovering - auth: replace page.request.get('/api/users/me') with a profile page navigation — direct browser requests don't carry Basic Auth, only server-side SvelteKit fetches do - documents: use getByRole('heading') instead of getByText to avoid strict mode violation when the title appears in both h1 and breadcrumb - persons: same heading fix for person creation landing page - profile: remove success-message assertion after password change; the auth_token cookie still holds old credentials so use:enhance's update() immediately gets a 401 and redirects to /login before the message renders — test now asserts the redirect directly, then re-logs in Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>admin.spec.ts: after clicking "Schlagwort bearbeiten", Svelte's {#if editingTagId} replaces the span with a form, so familieRow (filtered by the span) no longer matches. Find input[name="name"] and the save button directly instead. auth.spec.ts: dropdown opens via {#if userMenuOpen} which renders asynchronously. Wait for the Abmelden button to be visible before clicking to prevent a race condition. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>