forked from baron/baron-sso
fix: 사용자 템플릿 외부 함수 동기화 및 상세 페이지에 보조 이메일 표시 (#917)
This commit is contained in:
@@ -928,6 +928,16 @@ function UserDetailPage() {
|
||||
<Mail size={14} className="text-primary/70" />
|
||||
{user.email}
|
||||
</div>
|
||||
{user.metadata?.secondary_emails &&
|
||||
Array.isArray(user.metadata.secondary_emails) &&
|
||||
user.metadata.secondary_emails.length > 0 && (
|
||||
<div className="flex items-center gap-1.5 bg-background px-2.5 py-1 rounded-full border">
|
||||
<Mail size={14} className="text-primary/40" />
|
||||
<span className="text-[10px] font-bold">
|
||||
+{user.metadata.secondary_emails.length}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{user.phone && (
|
||||
<div className="flex items-center gap-1.5 bg-background px-2.5 py-1 rounded-full border">
|
||||
<Shield size={14} className="text-primary/70" />
|
||||
@@ -1048,6 +1058,49 @@ function UserDetailPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{user.metadata?.secondary_emails &&
|
||||
Array.isArray(user.metadata.secondary_emails) &&
|
||||
user.metadata.secondary_emails.length > 0 && (
|
||||
<div className="grid gap-8 md:grid-cols-2 pt-6 border-t border-dashed">
|
||||
<div className="space-y-3 col-span-full">
|
||||
<Label className="text-xs font-bold uppercase text-muted-foreground flex items-center gap-2">
|
||||
<Mail size={14} />
|
||||
{t(
|
||||
"ui.admin.users.detail.form.secondary_emails",
|
||||
"보조 이메일",
|
||||
)}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
className="text-[9px] h-4 px-1.5 font-bold"
|
||||
>
|
||||
{user.metadata.secondary_emails.length}
|
||||
</Badge>
|
||||
</Label>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{(user.metadata.secondary_emails as string[]).map(
|
||||
(email, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="flex items-center gap-2 px-3 py-1.5 rounded-xl border bg-muted/30 text-sm font-medium hover:border-primary/30 transition-colors"
|
||||
>
|
||||
<span className="text-primary/70">
|
||||
<Mail size={12} />
|
||||
</span>
|
||||
{email}
|
||||
</div>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
<p className="text-[10px] text-muted-foreground">
|
||||
{t(
|
||||
"msg.admin.users.detail.secondary_emails_help",
|
||||
"* 보조 이메일은 일괄 등록 또는 외부 연동을 통해 관리됩니다.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="grid gap-8 md:grid-cols-2 pt-6 border-t border-dashed">
|
||||
<div className="space-y-2">
|
||||
<Label
|
||||
|
||||
@@ -127,9 +127,9 @@ function hanmacEmailStatusClass(preview?: HanmacImportEmailPreview) {
|
||||
|
||||
export const downloadUserTemplate = () => {
|
||||
const headers =
|
||||
"email,name,phone,role,tenant_slug,department,grade,position,jobTitle,employee_id,tenant_slug1,department1,grade1,position1,jobTitle1,employee_id1";
|
||||
"email,secondary_emails,name,phone,role,tenant_slug,department,grade,position,jobTitle,employee_id,tenant_slug1,department1,grade1,position1,jobTitle1,employee_id1";
|
||||
const example =
|
||||
"user1@example.com,홍길동,010-1234-5678,user,tenant-slug,개발팀,수석,팀장,프론트엔드,EMP001,second-tenant,센터,책임,,Architecture,EMP002";
|
||||
"user1@example.com,sub1@test.com;sub2@test.com,홍길동,010-1234-5678,user,tenant-slug,개발팀,수석,팀장,프론트엔드,EMP001,second-tenant,센터,책임,,Architecture,EMP002";
|
||||
const blob = new Blob([`${headers}\n${example}`], {
|
||||
type: "text/csv;charset=utf-8;",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user