forked from baron/baron-sso
테넌트 비소속 개발자 권한 신청/부여 가능
This commit is contained in:
@@ -56,7 +56,6 @@ export default function DeveloperRequestPage() {
|
||||
const role = resolveProfileRole(userProfile);
|
||||
const tenantId = userProfile?.tenant_id as string | undefined;
|
||||
const companyCode = userProfile?.companyCode as string | undefined;
|
||||
const isTenantContextMissing = !tenantId?.trim();
|
||||
|
||||
const [isRequestModalOpen, setIsRequestModalOpen] = useState(false);
|
||||
const [adminNotes, setAdminNotes] = useState<Record<number, string>>({});
|
||||
@@ -180,7 +179,7 @@ export default function DeveloperRequestPage() {
|
||||
)
|
||||
}
|
||||
actions={
|
||||
!isSuperAdmin && !isTenantContextMissing && !hasActiveRequest ? (
|
||||
!isSuperAdmin && !hasActiveRequest ? (
|
||||
<Button onClick={() => setIsRequestModalOpen(true)}>
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
{t("ui.dev.welcome.btn_request", "신규 신청하기")}
|
||||
@@ -189,28 +188,6 @@ export default function DeveloperRequestPage() {
|
||||
}
|
||||
/>
|
||||
|
||||
{!isSuperAdmin && isTenantContextMissing ? (
|
||||
<Card className="border-amber-500/30 bg-amber-500/10">
|
||||
<CardContent className="flex items-start gap-3 p-4">
|
||||
<ShieldAlert className="mt-0.5 h-5 w-5 shrink-0 text-amber-600" />
|
||||
<div className="space-y-1 text-left">
|
||||
<p className="font-semibold text-foreground">
|
||||
{t(
|
||||
"msg.dev.request.tenant_required",
|
||||
"개발자 권한을 신청하려면 먼저 테넌트에 소속되어 있어야 합니다.",
|
||||
)}
|
||||
</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t(
|
||||
"msg.dev.request.tenant_required_detail",
|
||||
"현재 계정은 테넌트와 연결되어 있지 않아 개발자 권한을 신청할 수 없습니다.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
) : null}
|
||||
|
||||
<Card className="glass-panel">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-xl">
|
||||
@@ -282,7 +259,9 @@ export default function DeveloperRequestPage() {
|
||||
)}
|
||||
</TableCell>
|
||||
)}
|
||||
<TableCell>{req.organization}</TableCell>
|
||||
<TableCell>
|
||||
{req.organization?.trim() || t("ui.common.na", "없음")}
|
||||
</TableCell>
|
||||
<TableCell className="max-w-md">
|
||||
<div className="truncate" title={req.reason}>
|
||||
{req.reason}
|
||||
@@ -470,6 +449,7 @@ function RequestAccessModal({
|
||||
const [name, setName] = useState(initialName);
|
||||
const [organization, setOrganization] = useState(initialOrg);
|
||||
const [reason, setReason] = useState("");
|
||||
const organizationDisplay = organization.trim() || t("ui.common.na", "없음");
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
@@ -486,15 +466,6 @@ function RequestAccessModal({
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!tenantId.trim()) {
|
||||
alert(
|
||||
t(
|
||||
"msg.dev.request.tenant_required",
|
||||
"개발자 권한을 신청하려면 먼저 테넌트에 소속되어 있어야 합니다.",
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
mutation.mutate({
|
||||
name,
|
||||
organization,
|
||||
@@ -550,7 +521,7 @@ function RequestAccessModal({
|
||||
</Label>
|
||||
<Input
|
||||
id="org"
|
||||
value={organization}
|
||||
value={organizationDisplay}
|
||||
readOnly
|
||||
className="focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-input"
|
||||
required
|
||||
|
||||
Reference in New Issue
Block a user