feat: add admin dialog and move user management out of settings/profile modals
- Add a dedicated admin entry (with icon) to the header profile dropdown, visible only to admins - Move all user-management settings from SettingsDialog/ProfileDialog into a new AdminDialog - Export AdminDialog from the package index Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c94f749430
commit
a53bafff3f
6 files changed
+113
-104
No files matched your search
@@ -1,51 +1,27 @@
|
||||
<script lang="ts">
|
||||
import type {
|
||||
ProfileUpdateInput,
|
||||
TotpSetupRequest,
|
||||
TotpStatusRequest,
|
||||
TotpTokenAction,
|
||||
UserCreateRequest,
|
||||
UserDeleteRequest,
|
||||
UserId,
|
||||
UserListRequest,
|
||||
UserRole,
|
||||
UserUpdateRequest
|
||||
} from '../types';
|
||||
import type { ProfileUpdateInput, TotpSetupRequest, TotpStatusRequest, TotpTokenAction } from '../types';
|
||||
import Button from './Button.svelte';
|
||||
import Dialog from './Dialog.svelte';
|
||||
import TotpSettings from './TotpSettings.svelte';
|
||||
import UserManagement from './UserManagement.svelte';
|
||||
|
||||
let {
|
||||
currentEmail = '',
|
||||
currentRole = 'user',
|
||||
currentUserId,
|
||||
onCreateUser,
|
||||
onDeleteUser,
|
||||
onListUsers,
|
||||
currentUsername = '',
|
||||
onSave,
|
||||
onTotpDisable,
|
||||
onTotpEnable,
|
||||
onTotpSetup,
|
||||
onTotpStatus,
|
||||
onUpdateUser,
|
||||
totpEnabled = false,
|
||||
open = $bindable(false)
|
||||
}: {
|
||||
currentEmail?: string;
|
||||
currentRole?: UserRole;
|
||||
currentUserId?: UserId;
|
||||
onCreateUser?: UserCreateRequest;
|
||||
onDeleteUser?: UserDeleteRequest;
|
||||
onListUsers?: UserListRequest;
|
||||
currentUsername?: string;
|
||||
onSave?: (input: ProfileUpdateInput) => void | Promise<void>;
|
||||
onTotpDisable?: TotpTokenAction;
|
||||
onTotpEnable?: TotpTokenAction;
|
||||
onTotpSetup?: TotpSetupRequest;
|
||||
onTotpStatus?: TotpStatusRequest;
|
||||
onUpdateUser?: UserUpdateRequest;
|
||||
totpEnabled?: boolean;
|
||||
open?: boolean;
|
||||
} = $props();
|
||||
@@ -158,13 +134,4 @@
|
||||
enabled={totpEnabled}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<UserManagement
|
||||
currentRole={currentRole}
|
||||
currentUserId={currentUserId}
|
||||
onCreate={onCreateUser}
|
||||
onDelete={onDeleteUser}
|
||||
onList={onListUsers}
|
||||
onUpdate={onUpdateUser}
|
||||
/>
|
||||
</Dialog>
|
||||
Reference in new issue
Block a user