1
0
forked from baron/baron-sso

테이블 기본 정렬 생성일 통일

This commit is contained in:
2026-05-13 14:36:52 +09:00
parent 187f0da29b
commit 8a8b5baaf6
2 changed files with 21 additions and 18 deletions

View File

@@ -238,8 +238,12 @@ function TenantListPage() {
const [viewMode, setViewMode] = React.useState<"list" | "hierarchy">("list");
const [selectedIds, setSelectedIds] = React.useState<string[]>([]);
const [search, setSearch] = React.useState("");
const [sortConfig, setSortConfig] =
React.useState<SortConfig<TenantSortKey> | null>(null);
const [sortConfig, setSortConfig] = React.useState<SortConfig<TenantSortKey> | null>(
{
key: "createdAt",
direction: "desc",
},
);
const fileInputRef = React.useRef<HTMLInputElement | null>(null);
const [importMessage, setImportMessage] = React.useState("");
const [previewRows, setPreviewRows] = React.useState<
@@ -965,53 +969,53 @@ function TenantListPage() {
/>
</TableHead>
<SortableTableHead
className="min-w-[220px] whitespace-nowrap text-foreground sticky top-0 bg-inherit"
className="min-w-[220px] whitespace-nowrap sticky top-0 bg-inherit"
label={t("ui.admin.tenants.table.id", "ID")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="id"
/>
<SortableTableHead
className="whitespace-nowrap text-foreground sticky top-0 bg-inherit"
className="whitespace-nowrap sticky top-0 bg-inherit"
label={t("ui.admin.tenants.table.name", "NAME")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="name"
/>
<SortableTableHead
className="whitespace-nowrap text-foreground sticky top-0 bg-inherit"
className="whitespace-nowrap sticky top-0 bg-inherit"
label={t("ui.admin.tenants.table.type", "TYPE")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="type"
/>
<SortableTableHead
className="whitespace-nowrap text-foreground sticky top-0 bg-inherit"
className="whitespace-nowrap sticky top-0 bg-inherit"
label={t("ui.admin.tenants.table.slug", "SLUG")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="slug"
/>
<SortableTableHead
className="whitespace-nowrap text-foreground sticky top-0 bg-inherit"
className="whitespace-nowrap sticky top-0 bg-inherit"
label={t("ui.admin.tenants.table.status", "STATUS")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="status"
/>
<SortableTableHead
className="whitespace-nowrap text-foreground sticky top-0 bg-inherit"
className="whitespace-nowrap sticky top-0 bg-inherit"
label={t("ui.admin.tenants.table.members", "MEMBERS")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="recursiveMemberCount"
/>
<SortableTableHead
className="whitespace-nowrap text-foreground sticky top-0 bg-inherit"
label={t("ui.admin.tenants.table.updated", "UPDATED")}
className="whitespace-nowrap sticky top-0 bg-inherit"
label={t("ui.admin.tenants.table.created", "CREATED")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="updatedAt"
sortKey="createdAt"
/>
<TableHead className="whitespace-nowrap">
{t("ui.common.actions", "액션")}

View File

@@ -120,8 +120,12 @@ function ClientsPage() {
const [statusFilter, setStatusFilter] = useState("all");
const [isAdvancedFilterOpen, setIsAdvancedFilterOpen] = useState(false);
const [isRequestModalOpen, setIsRequestModalOpen] = useState(false);
const [sortConfig, setSortConfig] =
useState<SortConfig<ClientSortKey> | null>(null);
const [sortConfig, setSortConfig] = useState<SortConfig<ClientSortKey> | null>(
{
key: "createdAt",
direction: "desc",
},
);
const clients = data?.items || [];
const clientSortResolvers = useMemo<
@@ -439,35 +443,30 @@ function ClientsPage() {
<TableHeader>
<TableRow>
<SortableTableHead
className="text-muted-foreground"
label={t("ui.dev.clients.table.application", "애플리케이션")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="application"
/>
<SortableTableHead
className="text-muted-foreground"
label={t("ui.dev.clients.table.client_id", "Client ID")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="id"
/>
<SortableTableHead
className="text-muted-foreground"
label={t("ui.dev.clients.table.type", "유형")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="type"
/>
<SortableTableHead
className="text-muted-foreground"
label={t("ui.dev.clients.table.status", "상태")}
onSort={requestSort}
sortConfig={sortConfig}
sortKey="status"
/>
<SortableTableHead
className="text-muted-foreground"
label={t("ui.dev.clients.table.created_at", "생성일")}
onSort={requestSort}
sortConfig={sortConfig}