forked from baron/baron-sso
Merge pull request 'fix/rebac-env-sync-issue' (#543) from fix/rebac-env-sync-issue into dev
Reviewed-on: baron/baron-sso#543
This commit is contained in:
@@ -391,7 +391,12 @@ function UserDetailPage() {
|
||||
phone: user.phone || "",
|
||||
role: user.role,
|
||||
status: user.status,
|
||||
tenantSlug: user.tenantSlug || "",
|
||||
tenantSlug:
|
||||
user.companyCode ||
|
||||
user.joinedTenants?.find(
|
||||
(t) => t.type === "COMPANY" || t.type === "COMPANY_GROUP",
|
||||
)?.slug ||
|
||||
"",
|
||||
department: user.department || "",
|
||||
position: user.position || "",
|
||||
jobTitle: user.jobTitle || "",
|
||||
@@ -459,6 +464,16 @@ function UserDetailPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const userAffiliatedTenants = React.useMemo(() => {
|
||||
const joined = user?.joinedTenants || [];
|
||||
const primary = user?.tenant;
|
||||
const all = [...joined];
|
||||
if (primary && !joined.some((t) => t.id === primary.id)) {
|
||||
all.unshift(primary);
|
||||
}
|
||||
return all;
|
||||
}, [user?.joinedTenants, user?.tenant]);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="flex h-64 items-center justify-center">
|
||||
@@ -484,9 +499,6 @@ function UserDetailPage() {
|
||||
);
|
||||
}
|
||||
|
||||
const userAffiliatedTenants =
|
||||
user.joinedTenants || (user.tenant ? [user.tenant] : []);
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Header with back button and actions */}
|
||||
@@ -525,7 +537,10 @@ function UserDetailPage() {
|
||||
>
|
||||
<Building2 size={12} className="mr-1.5" />
|
||||
{user.tenant?.name ||
|
||||
user.tenantSlug ||
|
||||
user.companyCode ||
|
||||
user.joinedTenants?.find(
|
||||
(t) => t.type === "COMPANY" || t.type === "COMPANY_GROUP",
|
||||
)?.name ||
|
||||
t("ui.admin.users.detail.form.tenant_global", "시스템 전역")}
|
||||
</Badge>
|
||||
<Badge
|
||||
|
||||
Reference in New Issue
Block a user