forked from baron/baron-sso
adminfront: 권한 부여(Direct Permissions) 페이지에서 테넌트 기능 권한 탭 제거 및 시스템 메뉴 권한 단일 패널 전환
This commit is contained in:
@@ -55,7 +55,7 @@ import { toast } from "../../../components/ui/use-toast";
|
||||
|
||||
export function TenantFineGrainedPermissionsPage() {
|
||||
const queryClient = useQueryClient();
|
||||
const [activeTab, setActiveTab] = useState<"tenant" | "system">("tenant");
|
||||
const [activeTab, setActiveTab] = useState<"tenant" | "system">("system");
|
||||
const [selectedTenantId, setSelectedTenantId] = useState("");
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
||||
@@ -308,76 +308,8 @@ export function TenantFineGrainedPermissionsPage() {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Tab Selectors */}
|
||||
{isSuperAdmin && (
|
||||
<div className="flex border-b border-border">
|
||||
<button
|
||||
onClick={() => setActiveTab("tenant")}
|
||||
className={`px-6 py-3 text-sm font-semibold transition-colors relative ${
|
||||
activeTab === "tenant"
|
||||
? "text-primary border-b-2 border-primary"
|
||||
: "text-muted-foreground hover:text-foreground"
|
||||
}`}
|
||||
>
|
||||
<Settings className="inline-block h-4 w-4 mr-2" />
|
||||
{t("ui.admin.permissions_direct.tab_tenant", "테넌트 기능 권한")}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveTab("system")}
|
||||
className={`px-6 py-3 text-sm font-semibold transition-colors relative ${
|
||||
activeTab === "system"
|
||||
? "text-primary border-b-2 border-primary"
|
||||
: "text-muted-foreground hover:text-foreground"
|
||||
}`}
|
||||
>
|
||||
<Shield className="inline-block h-4 w-4 mr-2" />
|
||||
{t("ui.admin.permissions_direct.tab_system", "시스템 메뉴 권한 (Admin Control)")}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{activeTab === "tenant" ? (
|
||||
<>
|
||||
<Card className="border-none shadow-sm bg-[var(--color-panel)]">
|
||||
<CardHeader className="pb-4">
|
||||
<CardTitle className="text-lg font-semibold">
|
||||
{t("ui.admin.permissions_direct.select_tenant", "대상 테넌트 선택")}
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
{t(
|
||||
"msg.admin.permissions_direct.select_tenant_desc",
|
||||
"세부 기능 권한을 부여할 대상 테넌트를 리스트에서 선택해 주세요.",
|
||||
)}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<select
|
||||
name="select-tenant-for-fine-grained-permissions"
|
||||
value={selectedTenantId}
|
||||
onChange={(e) => setSelectedTenantId(e.target.value)}
|
||||
className="flex h-10 w-full max-w-[360px] rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"
|
||||
>
|
||||
<option value="">{t("ui.admin.permissions_direct.placeholder", "-- 테넌트 선택 --")}</option>
|
||||
{tenants.map((tenant) => (
|
||||
<option key={tenant.id} value={tenant.id}>
|
||||
{tenant.name} ({tenant.slug})
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{selectedTenantId ? (
|
||||
<TenantFineGrainedPermissionsTab tenantIdProp={selectedTenantId} />
|
||||
) : (
|
||||
<div className="rounded-lg border border-dashed border-border p-12 text-center text-muted-foreground">
|
||||
{t("msg.admin.permissions_direct.select_prompt", "상단에서 테넌트를 선택하면 세부 권한 격리 설정 격자가 노출됩니다.")}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
/* 시스템 메뉴 권한 (Admin Control) Split Screen Panel */
|
||||
<div className="flex flex-col lg:flex-row gap-6 h-[720px] border border-border rounded-xl bg-card overflow-hidden shadow-sm">
|
||||
{/* 시스템 메뉴 권한 (Admin Control) Split Screen Panel */}
|
||||
<div className="flex flex-col lg:flex-row gap-6 h-[720px] border border-border rounded-xl bg-card overflow-hidden shadow-sm">
|
||||
{/* Left Panel: User List */}
|
||||
<div className="w-full lg:w-80 border-r border-border flex flex-col bg-muted/10 h-full">
|
||||
<div className="p-4 border-b border-border space-y-3 flex-shrink-0">
|
||||
@@ -568,7 +500,6 @@ export function TenantFineGrainedPermissionsPage() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* User Search Dialog for System relations */}
|
||||
<Dialog
|
||||
|
||||
Reference in New Issue
Block a user