mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-20 13:19:28 +00:00
feat: display source in user and group table (#225)
Co-authored-by: Elias Schneider <login@eliasschneider.com>
This commit is contained in:
9482
frontend/package-lock.json
generated
9482
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import AdvancedTable from '$lib/components/advanced-table.svelte';
|
import AdvancedTable from '$lib/components/advanced-table.svelte';
|
||||||
import { openConfirmDialog } from '$lib/components/confirm-dialog/';
|
import { openConfirmDialog } from '$lib/components/confirm-dialog/';
|
||||||
|
import { Badge } from '$lib/components/ui/badge/index';
|
||||||
import { Button } from '$lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
|
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
|
||||||
import * as Table from '$lib/components/ui/table';
|
import * as Table from '$lib/components/ui/table';
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
toast.success('User group deleted successfully');
|
toast.success('User group deleted successfully');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
axiosErrorToast(e);
|
axiosErrorToast(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -50,6 +51,7 @@
|
|||||||
{ label: 'Friendly Name', sortColumn: 'friendlyName' },
|
{ label: 'Friendly Name', sortColumn: 'friendlyName' },
|
||||||
{ label: 'Name', sortColumn: 'name' },
|
{ label: 'Name', sortColumn: 'name' },
|
||||||
{ label: 'User Count', sortColumn: 'userCount' },
|
{ label: 'User Count', sortColumn: 'userCount' },
|
||||||
|
...($appConfigStore.ldapEnabled ? [{ label: 'Source' }] : []),
|
||||||
{ label: 'Actions', hidden: true }
|
{ label: 'Actions', hidden: true }
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
@@ -57,6 +59,12 @@
|
|||||||
<Table.Cell>{item.friendlyName}</Table.Cell>
|
<Table.Cell>{item.friendlyName}</Table.Cell>
|
||||||
<Table.Cell>{item.name}</Table.Cell>
|
<Table.Cell>{item.name}</Table.Cell>
|
||||||
<Table.Cell>{item.userCount}</Table.Cell>
|
<Table.Cell>{item.userCount}</Table.Cell>
|
||||||
|
{#if $appConfigStore.ldapEnabled}
|
||||||
|
<Table.Cell>
|
||||||
|
<Badge variant={item.ldapId ? 'default' : 'outline'}>{item.ldapId ? 'LDAP' : 'Local'}</Badge
|
||||||
|
>
|
||||||
|
</Table.Cell>
|
||||||
|
{/if}
|
||||||
<Table.Cell class="flex justify-end">
|
<Table.Cell class="flex justify-end">
|
||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger asChild let:builder>
|
<DropdownMenu.Trigger asChild let:builder>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
|
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
|
||||||
import * as Table from '$lib/components/ui/table';
|
import * as Table from '$lib/components/ui/table';
|
||||||
import UserService from '$lib/services/user-service';
|
import UserService from '$lib/services/user-service';
|
||||||
|
import appConfigStore from '$lib/stores/application-configuration-store';
|
||||||
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
|
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
|
||||||
import type { User } from '$lib/types/user.type';
|
import type { User } from '$lib/types/user.type';
|
||||||
import { axiosErrorToast } from '$lib/utils/error-util';
|
import { axiosErrorToast } from '$lib/utils/error-util';
|
||||||
@@ -14,7 +15,6 @@
|
|||||||
import Ellipsis from 'lucide-svelte/icons/ellipsis';
|
import Ellipsis from 'lucide-svelte/icons/ellipsis';
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import OneTimeLinkModal from './one-time-link-modal.svelte';
|
import OneTimeLinkModal from './one-time-link-modal.svelte';
|
||||||
import appConfigStore from '$lib/stores/application-configuration-store';
|
|
||||||
|
|
||||||
let { users = $bindable() }: { users: Paginated<User> } = $props();
|
let { users = $bindable() }: { users: Paginated<User> } = $props();
|
||||||
let requestOptions: SearchPaginationSortRequest | undefined = $state();
|
let requestOptions: SearchPaginationSortRequest | undefined = $state();
|
||||||
@@ -49,30 +49,13 @@
|
|||||||
{requestOptions}
|
{requestOptions}
|
||||||
onRefresh={async (options) => (users = await userService.list(options))}
|
onRefresh={async (options) => (users = await userService.list(options))}
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{ label: 'First name', sortColumn: 'firstName' },
|
||||||
label: 'First name',
|
{ label: 'Last name', sortColumn: 'lastName' },
|
||||||
sortColumn: 'firstName'
|
{ label: 'Email', sortColumn: 'email' },
|
||||||
},
|
{ label: 'Username', sortColumn: 'username' },
|
||||||
{
|
{ label: 'Role', sortColumn: 'isAdmin' },
|
||||||
label: 'Last name',
|
...($appConfigStore.ldapEnabled ? [{ label: 'Source' }] : []),
|
||||||
sortColumn: 'lastName'
|
{ label: 'Actions', hidden: true }
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Email',
|
|
||||||
sortColumn: 'email'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Username',
|
|
||||||
sortColumn: 'username'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Role',
|
|
||||||
sortColumn: 'isAdmin'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Actions',
|
|
||||||
hidden: true
|
|
||||||
}
|
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{#snippet rows({ item })}
|
{#snippet rows({ item })}
|
||||||
@@ -80,9 +63,15 @@
|
|||||||
<Table.Cell>{item.lastName}</Table.Cell>
|
<Table.Cell>{item.lastName}</Table.Cell>
|
||||||
<Table.Cell>{item.email}</Table.Cell>
|
<Table.Cell>{item.email}</Table.Cell>
|
||||||
<Table.Cell>{item.username}</Table.Cell>
|
<Table.Cell>{item.username}</Table.Cell>
|
||||||
<Table.Cell class="hidden lg:table-cell">
|
<Table.Cell>
|
||||||
<Badge variant="outline">{item.isAdmin ? 'Admin' : 'User'}</Badge>
|
<Badge variant="outline">{item.isAdmin ? 'Admin' : 'User'}</Badge>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
|
{#if $appConfigStore.ldapEnabled}
|
||||||
|
<Table.Cell>
|
||||||
|
<Badge variant={item.ldapId ? 'default' : 'outline'}>{item.ldapId ? 'LDAP' : 'Local'}</Badge
|
||||||
|
>
|
||||||
|
</Table.Cell>
|
||||||
|
{/if}
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger class={buttonVariants({ variant: 'ghost', size: 'icon' })}>
|
<DropdownMenu.Trigger class={buttonVariants({ variant: 'ghost', size: 'icon' })}>
|
||||||
|
|||||||
Reference in New Issue
Block a user