1
0
forked from baron/baron-sso

feat(admin): add org chart bulk import button to main tenants list page (#500)

This commit is contained in:
2026-04-07 16:00:14 +09:00
parent 02255116f4
commit 6971b69b79
2 changed files with 128 additions and 24 deletions

View File

@@ -13,6 +13,7 @@ import {
CardHeader,
CardTitle,
} from "../../../components/ui/card";
import { OrgChartUploadModal } from "../components/OrgChartUploadModal";
import {
Table,
TableBody,
@@ -100,6 +101,9 @@ function TenantListPage() {
const tenants = query.data?.items ?? [];
// [New] Find a primary COMPANY_GROUP tenant to act as the root for matrix org charts
const rootTenant = tenants.find((t) => t.type === "COMPANY_GROUP") || tenants[0];
const handleDelete = (tenantId: string, tenantName: string) => {
if (
!window.confirm(
@@ -130,6 +134,16 @@ function TenantListPage() {
</p>
</div>
<div className="flex items-center gap-2">
{/* [New] Add Upload Modal to global list page, visible to Super Admin */}
<RoleGuard roles={["super_admin"]}>
{rootTenant && (
<OrgChartUploadModal
tenantId={rootTenant.id}
onSuccess={() => query.refetch()}
/>
)}
</RoleGuard>
<Button
variant="outline"
onClick={() => query.refetch()}