fix(ui): показывать подтверждённые каталоги пользователей
This commit is contained in:
1 parent
0a332ce341
commit
2d5fb3598f
10 files changed
+186
-53
No files matched your search
@@ -44,9 +44,10 @@ function AvatarCircle({ avatar, active }: { avatar: string; active: boolean }) {
|
||||
|
||||
interface UsersDataGridProps {
|
||||
users: AppUser[]
|
||||
serversCount: number
|
||||
serversCount: number | null
|
||||
allSectionsCount?: number
|
||||
isLoading?: boolean
|
||||
actionsDisabled?: boolean
|
||||
onEdit: (user: AppUser) => void
|
||||
onDelete: (user: AppUser) => void
|
||||
}
|
||||
@@ -56,6 +57,7 @@ function UsersDataGrid({
|
||||
serversCount,
|
||||
allSectionsCount = ALL_SECTIONS.length,
|
||||
isLoading,
|
||||
actionsDisabled,
|
||||
onEdit,
|
||||
onDelete,
|
||||
}: UsersDataGridProps) {
|
||||
@@ -182,6 +184,9 @@ function UsersDataGrid({
|
||||
variant="ghost"
|
||||
className="size-7 p-0 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => onEdit(u)}
|
||||
type="button"
|
||||
disabled={actionsDisabled}
|
||||
aria-label={"Редактировать пользователя " + u.name}
|
||||
title="Редактировать"
|
||||
>
|
||||
<PencilIcon className="size-3.5" />
|
||||
@@ -191,6 +196,9 @@ function UsersDataGrid({
|
||||
variant="ghost"
|
||||
className="size-7 p-0 text-muted-foreground hover:text-destructive"
|
||||
onClick={() => onDelete(u)}
|
||||
type="button"
|
||||
disabled={actionsDisabled}
|
||||
aria-label={"Удалить пользователя " + u.name}
|
||||
title="Удалить"
|
||||
>
|
||||
<TrashIcon className="size-3.5" />
|
||||
@@ -205,7 +213,7 @@ function UsersDataGrid({
|
||||
},
|
||||
},
|
||||
],
|
||||
[allSectionsCount, onDelete, onEdit, serversCount],
|
||||
[allSectionsCount, actionsDisabled, onDelete, onEdit, serversCount],
|
||||
)
|
||||
|
||||
const table = useTable({
|
||||
|
||||
@@ -32,7 +32,7 @@ const TYPE_ICON: Record<InterfaceType, { icon: typeof CableIcon; className: stri
|
||||
|
||||
interface UsersExpandedDetailProps {
|
||||
user: AppUser
|
||||
serversCount: number
|
||||
serversCount: number | null
|
||||
allSectionsCount?: number
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ function UsersExpandedDetail({
|
||||
serversCount,
|
||||
allSectionsCount = ALL_SECTIONS.length,
|
||||
}: UsersExpandedDetailProps) {
|
||||
const access = summarizeUserAccess(user, serversCount, allSectionsCount)
|
||||
const access = summarizeUserAccess(user, serversCount ?? 0, allSectionsCount)
|
||||
const groups = groupBindingsByServer(user.bindings)
|
||||
|
||||
return (
|
||||
@@ -56,7 +56,7 @@ function UsersExpandedDetail({
|
||||
<span className="text-muted-foreground">
|
||||
Серверы:{" "}
|
||||
<span className="font-mono text-foreground">
|
||||
{access.serversGranted}/{access.serversTotal}
|
||||
{serversCount === null ? "каталог неизвестен" : access.serversGranted + "/" + access.serversTotal}
|
||||
</span>
|
||||
</span>
|
||||
{access.writeKind === "full" ? (
|
||||
|
||||
Reference in new issue
Block a user