From 6971b69b79ffc6f9189c7adc78677678d3884719 Mon Sep 17 00:00:00 2001
From: chan
Date: Tue, 7 Apr 2026 16:00:14 +0900
Subject: [PATCH] feat(admin): add org chart bulk import button to main tenants
list page (#500)
---
.../tenants/routes/TenantListPage.tsx | 14 ++
backend/internal/service/org_chart_service.go | 138 +++++++++++++++---
2 files changed, 128 insertions(+), 24 deletions(-)
diff --git a/adminfront/src/features/tenants/routes/TenantListPage.tsx b/adminfront/src/features/tenants/routes/TenantListPage.tsx
index 7963f81c..4b7b712c 100644
--- a/adminfront/src/features/tenants/routes/TenantListPage.tsx
+++ b/adminfront/src/features/tenants/routes/TenantListPage.tsx
@@ -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() {
+ {/* [New] Add Upload Modal to global list page, visible to Super Admin */}
+
+ {rootTenant && (
+ query.refetch()}
+ />
+ )}
+
+