forked from baron/baron-sso
feat(admin): add org chart bulk import button to main tenants list page (#500)
This commit is contained in:
@@ -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()}
|
||||
|
||||
Reference in New Issue
Block a user