WIP
This commit is contained in:
@@ -81,6 +81,10 @@ export class UserHeaderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
public getDisplayName(): string {
|
||||
const member = this.currentUser?.memberInfo;
|
||||
if (member) {
|
||||
return `${member.nickName ?? member.firstName_en} ${member.lastName_en}`;
|
||||
}
|
||||
return this.currentUser?.email || '';
|
||||
}
|
||||
|
||||
|
||||
@@ -330,6 +330,10 @@ export class UserPortalComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
getDisplayName(): string {
|
||||
const member = this.currentUser?.memberInfo;
|
||||
if (member) {
|
||||
return `${member.nickName ?? member.firstName_en} ${member.lastName_en}`;
|
||||
}
|
||||
return this.currentUser?.email || '';
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,16 @@ import { ModuleActions } from '../../core/models/permission.model';
|
||||
|
||||
// ── Public interfaces ─────────────────────────────────────────────────────────
|
||||
|
||||
/** Matches the C# MemberInfo DTO exactly. */
|
||||
export interface MemberInfo {
|
||||
id: number;
|
||||
nickName: string | null;
|
||||
firstName_en: string;
|
||||
lastName_en: string;
|
||||
firstName_zh: string | null;
|
||||
lastName_zh: string | null;
|
||||
}
|
||||
|
||||
/** Matches the C# UserInfo DTO exactly. */
|
||||
export interface UserInfo {
|
||||
id: string;
|
||||
@@ -18,6 +28,12 @@ export interface UserInfo {
|
||||
* camelCase dictionary-key policy). Absent for legacy/secret-link tokens.
|
||||
*/
|
||||
permissions?: Record<string, ModuleActions>;
|
||||
/**
|
||||
* The church member linked to this account, or absent for admin-only
|
||||
* accounts and accounts whose member record was deleted. Flows through
|
||||
* login, refresh, and /me so the greeting survives a page reload.
|
||||
*/
|
||||
memberInfo?: MemberInfo;
|
||||
}
|
||||
|
||||
/** Matches the C# LoginResponse DTO exactly. */
|
||||
|
||||
Reference in New Issue
Block a user