forked from baron/baron-sso
fix: 프론트엔드 테스트 환경 런타임 오류(getSortIcon 누락) 및 타입스크립트 에러 수정
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
|||||||
useQuery,
|
useQuery,
|
||||||
type UseMutationResult,
|
type UseMutationResult,
|
||||||
} from "@tanstack/react-query";
|
} from "@tanstack/react-query";
|
||||||
import type { AdminProfile } from "../../../lib/adminApi";
|
import type { UserProfileResponse } from "../../../lib/adminApi";
|
||||||
import { useVirtualizer } from "@tanstack/react-virtual";
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
||||||
import type { AxiosError } from "axios";
|
import type { AxiosError } from "axios";
|
||||||
import {
|
import {
|
||||||
@@ -498,6 +498,17 @@ function TenantListPage() {
|
|||||||
setSortConfig((current) => toggleSort(current, key));
|
setSortConfig((current) => toggleSort(current, key));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getSortIcon = (key: TenantSortKey) => {
|
||||||
|
if (!sortConfig || sortConfig.key !== key) {
|
||||||
|
return <ArrowUpDown size={14} className="ml-1 opacity-50" />;
|
||||||
|
}
|
||||||
|
return sortConfig.direction === "asc" ? (
|
||||||
|
<ArrowUp size={14} className="ml-1" />
|
||||||
|
) : (
|
||||||
|
<ArrowDown size={14} className="ml-1" />
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const deletableTenants = React.useMemo(
|
const deletableTenants = React.useMemo(
|
||||||
() => allTenants.filter((tenant) => !isSeedTenant(tenant)),
|
() => allTenants.filter((tenant) => !isSeedTenant(tenant)),
|
||||||
[allTenants],
|
[allTenants],
|
||||||
@@ -1196,7 +1207,7 @@ const TenantHierarchyView: React.FC<{
|
|||||||
{ tenantId: string; status: string },
|
{ tenantId: string; status: string },
|
||||||
unknown
|
unknown
|
||||||
>;
|
>;
|
||||||
profile: AdminProfile | undefined;
|
profile: UserProfileResponse | undefined;
|
||||||
sortConfig: SortConfig<TenantSortKey> | null;
|
sortConfig: SortConfig<TenantSortKey> | null;
|
||||||
requestSort: (key: TenantSortKey) => void;
|
requestSort: (key: TenantSortKey) => void;
|
||||||
getSortIcon: (key: TenantSortKey) => React.ReactNode;
|
getSortIcon: (key: TenantSortKey) => React.ReactNode;
|
||||||
|
|||||||
@@ -303,6 +303,17 @@ function UserListPage() {
|
|||||||
setSortConfig((current) => toggleSort(current, key));
|
setSortConfig((current) => toggleSort(current, key));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getSortIcon = (key: UserSortKey) => {
|
||||||
|
if (!sortConfig || sortConfig.key !== key) {
|
||||||
|
return <ArrowUpDown size={14} className="ml-1 opacity-50" />;
|
||||||
|
}
|
||||||
|
return sortConfig.direction === "asc" ? (
|
||||||
|
<ArrowUp size={14} className="ml-1" />
|
||||||
|
) : (
|
||||||
|
<ArrowDown size={14} className="ml-1" />
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const total = query.data?.total ?? 0;
|
const total = query.data?.total ?? 0;
|
||||||
const totalPages = Math.ceil(total / limit);
|
const totalPages = Math.ceil(total / limit);
|
||||||
const canPromoteSuperAdmin = isSuperAdminRole(profile?.role);
|
const canPromoteSuperAdmin = isSuperAdminRole(profile?.role);
|
||||||
|
|||||||
Reference in New Issue
Block a user