forked from baron/baron-sso
i18n 누락 키 보완 및 biome 포맷 정리
This commit is contained in:
@@ -331,8 +331,14 @@ function AppLayout() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center pt-1">
|
<div className="flex items-center pt-1">
|
||||||
<Badge variant="outline" className="text-[10px] px-2 py-0">
|
<Badge
|
||||||
{t(`ui.common.role.${displayRoleKey}`, displayRoleKey.toUpperCase())}
|
variant="outline"
|
||||||
|
className="text-[10px] px-2 py-0"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
`ui.common.role.${displayRoleKey}`,
|
||||||
|
displayRoleKey.toUpperCase(),
|
||||||
|
)}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { User, Shield, Briefcase, Mail, Fingerprint, Building2 } from "lucide-react";
|
import {
|
||||||
|
User,
|
||||||
|
Shield,
|
||||||
|
Briefcase,
|
||||||
|
Mail,
|
||||||
|
Fingerprint,
|
||||||
|
Building2,
|
||||||
|
} from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useAuth } from "react-oidc-context";
|
import { useAuth } from "react-oidc-context";
|
||||||
import {
|
import {
|
||||||
@@ -16,7 +23,11 @@ function ProfilePage() {
|
|||||||
const auth = useAuth();
|
const auth = useAuth();
|
||||||
const hasAccessToken = Boolean(auth.user?.access_token);
|
const hasAccessToken = Boolean(auth.user?.access_token);
|
||||||
|
|
||||||
const { data: profile, isLoading, error } = useQuery({
|
const {
|
||||||
|
data: profile,
|
||||||
|
isLoading,
|
||||||
|
error,
|
||||||
|
} = useQuery({
|
||||||
queryKey: ["userMe"],
|
queryKey: ["userMe"],
|
||||||
queryFn: fetchMe,
|
queryFn: fetchMe,
|
||||||
enabled: hasAccessToken,
|
enabled: hasAccessToken,
|
||||||
@@ -41,8 +52,13 @@ function ProfilePage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fallback to token information if API data is incomplete
|
// Fallback to token information if API data is incomplete
|
||||||
const displayTenant = profile.tenant?.name || profile.tenantId || auth.user?.profile?.tenant_id?.toString() || "-";
|
const displayTenant =
|
||||||
const displayCompanyCode = profile.companyCode || auth.user?.profile?.companyCode?.toString() || "-";
|
profile.tenant?.name ||
|
||||||
|
profile.tenantId ||
|
||||||
|
auth.user?.profile?.tenant_id?.toString() ||
|
||||||
|
"-";
|
||||||
|
const displayCompanyCode =
|
||||||
|
profile.companyCode || auth.user?.profile?.companyCode?.toString() || "-";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6 max-w-4xl mx-auto">
|
<div className="space-y-6 max-w-4xl mx-auto">
|
||||||
@@ -139,9 +155,7 @@ function ProfilePage() {
|
|||||||
<p className="text-sm font-medium text-muted-foreground">
|
<p className="text-sm font-medium text-muted-foreground">
|
||||||
{t("ui.dev.profile.org.tenant", "테넌트")}
|
{t("ui.dev.profile.org.tenant", "테넌트")}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-sm">
|
<p className="text-sm">{displayTenant}</p>
|
||||||
{displayTenant}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<p className="text-sm font-medium text-muted-foreground">
|
<p className="text-sm font-medium text-muted-foreground">
|
||||||
@@ -178,7 +192,10 @@ function ProfilePage() {
|
|||||||
{t("ui.dev.profile.role.current", "Current Role")}
|
{t("ui.dev.profile.role.current", "Current Role")}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xl font-bold mt-1">
|
<p className="text-xl font-bold mt-1">
|
||||||
{t(`ui.common.role.${profile.role}`, profile.role.toUpperCase())}
|
{t(
|
||||||
|
`ui.common.role.${profile.role}`,
|
||||||
|
profile.role.toUpperCase(),
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p className="mt-1 text-sm text-muted-foreground">
|
<p className="mt-1 text-sm text-muted-foreground">
|
||||||
{t(
|
{t(
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ export function normalizeRole(rawRole: unknown): string {
|
|||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resolveProfileRole(profile: Record<string, unknown> | undefined) {
|
export function resolveProfileRole(
|
||||||
|
profile: Record<string, unknown> | undefined,
|
||||||
|
) {
|
||||||
if (!profile) return "";
|
if (!profile) return "";
|
||||||
const candidates = [
|
const candidates = [
|
||||||
profile.role,
|
profile.role,
|
||||||
|
|||||||
@@ -94,7 +94,11 @@ test.describe("DevFront role report", () => {
|
|||||||
.getByPlaceholder("My Awesome Application")
|
.getByPlaceholder("My Awesome Application")
|
||||||
.fill("Tenant A CRM Updated");
|
.fill("Tenant A CRM Updated");
|
||||||
|
|
||||||
const updatePromise = page.waitForResponse(r => r.url().includes('/api/v1/dev/clients') && r.request().method() === 'PUT');
|
const updatePromise = page.waitForResponse(
|
||||||
|
(r) =>
|
||||||
|
r.url().includes("/api/v1/dev/clients") &&
|
||||||
|
r.request().method() === "PUT",
|
||||||
|
);
|
||||||
await page.getByRole("button", { name: /^저장$|^Save$/i }).click();
|
await page.getByRole("button", { name: /^저장$|^Save$/i }).click();
|
||||||
await updatePromise;
|
await updatePromise;
|
||||||
|
|
||||||
@@ -134,7 +138,11 @@ test.describe("DevFront role report", () => {
|
|||||||
.getByPlaceholder(/https:\/\/app\.example\.com\/callback/i)
|
.getByPlaceholder(/https:\/\/app\.example\.com\/callback/i)
|
||||||
.fill("https://super-admin.example.com/callback");
|
.fill("https://super-admin.example.com/callback");
|
||||||
|
|
||||||
const createPromise = page.waitForResponse(r => r.url().includes('/api/v1/dev/clients') && r.request().method() === 'POST');
|
const createPromise = page.waitForResponse(
|
||||||
|
(r) =>
|
||||||
|
r.url().includes("/api/v1/dev/clients") &&
|
||||||
|
r.request().method() === "POST",
|
||||||
|
);
|
||||||
await page.getByRole("button", { name: /앱 생성|Create/i }).click();
|
await page.getByRole("button", { name: /앱 생성|Create/i }).click();
|
||||||
await createPromise;
|
await createPromise;
|
||||||
|
|
||||||
|
|||||||
@@ -1160,6 +1160,31 @@ menu_aria = "Open account menu"
|
|||||||
menu_title = "Account"
|
menu_title = "Account"
|
||||||
unknown_email = "unknown@example.com"
|
unknown_email = "unknown@example.com"
|
||||||
unknown_name = "Unknown User"
|
unknown_name = "Unknown User"
|
||||||
|
title = "My Profile"
|
||||||
|
subtitle = "View user details and assigned roles."
|
||||||
|
loading = "Loading profile..."
|
||||||
|
error = "Failed to load profile."
|
||||||
|
|
||||||
|
[ui.dev.profile.tab]
|
||||||
|
basic = "Basic Info"
|
||||||
|
role = "Roles & Permissions"
|
||||||
|
|
||||||
|
[ui.dev.profile.basic]
|
||||||
|
title = "User Info"
|
||||||
|
id = "User ID"
|
||||||
|
name = "Name"
|
||||||
|
email = "Email"
|
||||||
|
phone = "Phone Number"
|
||||||
|
|
||||||
|
[ui.dev.profile.org]
|
||||||
|
title = "Organization Info"
|
||||||
|
tenant = "Tenant"
|
||||||
|
company_code = "Company Code"
|
||||||
|
|
||||||
|
[ui.dev.profile.role]
|
||||||
|
title = "System Role"
|
||||||
|
description = "The permission level granted to this account."
|
||||||
|
current = "Current Role"
|
||||||
|
|
||||||
[ui.dev.clients]
|
[ui.dev.clients]
|
||||||
copy_client_id = "Copy client id"
|
copy_client_id = "Copy client id"
|
||||||
|
|||||||
@@ -1160,6 +1160,31 @@ menu_aria = "계정 메뉴 열기"
|
|||||||
menu_title = "계정"
|
menu_title = "계정"
|
||||||
unknown_email = "unknown@example.com"
|
unknown_email = "unknown@example.com"
|
||||||
unknown_name = "Unknown User"
|
unknown_name = "Unknown User"
|
||||||
|
title = "내 정보"
|
||||||
|
subtitle = "사용자 상세 정보 및 할당된 역할(Role)을 확인합니다."
|
||||||
|
loading = "프로필 정보를 불러오는 중..."
|
||||||
|
error = "프로필 정보를 불러오지 못했습니다."
|
||||||
|
|
||||||
|
[ui.dev.profile.tab]
|
||||||
|
basic = "기본 정보"
|
||||||
|
role = "권한 및 역할"
|
||||||
|
|
||||||
|
[ui.dev.profile.basic]
|
||||||
|
title = "사용자 정보"
|
||||||
|
id = "사용자 ID"
|
||||||
|
name = "이름"
|
||||||
|
email = "이메일"
|
||||||
|
phone = "전화번호"
|
||||||
|
|
||||||
|
[ui.dev.profile.org]
|
||||||
|
title = "조직 정보"
|
||||||
|
tenant = "테넌트"
|
||||||
|
company_code = "회사 코드"
|
||||||
|
|
||||||
|
[ui.dev.profile.role]
|
||||||
|
title = "시스템 역할"
|
||||||
|
description = "현재 계정에 부여된 권한 등급입니다."
|
||||||
|
current = "현재 역할"
|
||||||
|
|
||||||
[ui.dev.clients]
|
[ui.dev.clients]
|
||||||
copy_client_id = "Copy client id"
|
copy_client_id = "Copy client id"
|
||||||
|
|||||||
@@ -1025,6 +1025,31 @@ menu_aria = ""
|
|||||||
menu_title = ""
|
menu_title = ""
|
||||||
unknown_email = ""
|
unknown_email = ""
|
||||||
unknown_name = ""
|
unknown_name = ""
|
||||||
|
title = ""
|
||||||
|
subtitle = ""
|
||||||
|
loading = ""
|
||||||
|
error = ""
|
||||||
|
|
||||||
|
[ui.dev.profile.tab]
|
||||||
|
basic = ""
|
||||||
|
role = ""
|
||||||
|
|
||||||
|
[ui.dev.profile.basic]
|
||||||
|
title = ""
|
||||||
|
id = ""
|
||||||
|
name = ""
|
||||||
|
email = ""
|
||||||
|
phone = ""
|
||||||
|
|
||||||
|
[ui.dev.profile.org]
|
||||||
|
title = ""
|
||||||
|
tenant = ""
|
||||||
|
company_code = ""
|
||||||
|
|
||||||
|
[ui.dev.profile.role]
|
||||||
|
title = ""
|
||||||
|
description = ""
|
||||||
|
current = ""
|
||||||
|
|
||||||
[ui.dev.clients]
|
[ui.dev.clients]
|
||||||
new = ""
|
new = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user