1
0
forked from baron/baron-sso

i18n 누락 키 보완 및 biome 포맷 정리

This commit is contained in:
2026-03-16 16:43:25 +09:00
parent 9a4681b2c0
commit fb27fbf3b1
7 changed files with 126 additions and 18 deletions

View File

@@ -111,7 +111,7 @@ function AppLayout() {
const currentRole = resolveProfileRole(
auth.user?.profile as Record<string, unknown> | undefined,
);
// Use profile.role from API if available, otherwise fallback to local role
const displayRoleKey = profile?.role || currentRole;
@@ -331,12 +331,18 @@ function AppLayout() {
</p>
</div>
<div className="flex items-center pt-1">
<Badge variant="outline" className="text-[10px] px-2 py-0">
{t(`ui.common.role.${displayRoleKey}`, displayRoleKey.toUpperCase())}
<Badge
variant="outline"
className="text-[10px] px-2 py-0"
>
{t(
`ui.common.role.${displayRoleKey}`,
displayRoleKey.toUpperCase(),
)}
</Badge>
</div>
</div>
<button
type="button"
role="menuitem"
@@ -349,7 +355,7 @@ function AppLayout() {
<UserIcon size={16} className="text-muted-foreground" />
<span>{t("ui.dev.profile.title", "내 정보")}</span>
</button>
<button
type="button"
role="menuitem"

View File

@@ -1,5 +1,12 @@
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 { useAuth } from "react-oidc-context";
import {
@@ -16,7 +23,11 @@ function ProfilePage() {
const auth = useAuth();
const hasAccessToken = Boolean(auth.user?.access_token);
const { data: profile, isLoading, error } = useQuery({
const {
data: profile,
isLoading,
error,
} = useQuery({
queryKey: ["userMe"],
queryFn: fetchMe,
enabled: hasAccessToken,
@@ -41,8 +52,13 @@ function ProfilePage() {
}
// Fallback to token information if API data is incomplete
const displayTenant = profile.tenant?.name || profile.tenantId || auth.user?.profile?.tenant_id?.toString() || "-";
const displayCompanyCode = profile.companyCode || auth.user?.profile?.companyCode?.toString() || "-";
const displayTenant =
profile.tenant?.name ||
profile.tenantId ||
auth.user?.profile?.tenant_id?.toString() ||
"-";
const displayCompanyCode =
profile.companyCode || auth.user?.profile?.companyCode?.toString() || "-";
return (
<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">
{t("ui.dev.profile.org.tenant", "테넌트")}
</p>
<p className="text-sm">
{displayTenant}
</p>
<p className="text-sm">{displayTenant}</p>
</div>
<div className="space-y-1">
<p className="text-sm font-medium text-muted-foreground">
@@ -178,7 +192,10 @@ function ProfilePage() {
{t("ui.dev.profile.role.current", "Current Role")}
</p>
<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 className="mt-1 text-sm text-muted-foreground">
{t(

View File

@@ -9,7 +9,9 @@ export function normalizeRole(rawRole: unknown): string {
return role;
}
export function resolveProfileRole(profile: Record<string, unknown> | undefined) {
export function resolveProfileRole(
profile: Record<string, unknown> | undefined,
) {
if (!profile) return "";
const candidates = [
profile.role,