diff --git a/frontend/app/src/app/modules/library/account/profile/profile-page.component.ts b/frontend/app/src/app/modules/library/account/profile/profile-page.component.ts index a2a57abb..15ab2b4e 100644 --- a/frontend/app/src/app/modules/library/account/profile/profile-page.component.ts +++ b/frontend/app/src/app/modules/library/account/profile/profile-page.component.ts @@ -25,8 +25,6 @@ import {PAIAPatron} from '../../types'; export class ProfilePageComponent { patron?: PAIAPatron; - propertiesToShow: (keyof PAIAPatron)[] = ['id', 'name', 'email', 'address', 'expires']; - constructor(private readonly libraryAccountService: LibraryAccountService) {} async ionViewWillEnter(): Promise { diff --git a/frontend/app/src/app/modules/library/account/profile/profile-page.html b/frontend/app/src/app/modules/library/account/profile/profile-page.html index 5a69eaed..f579edc8 100644 --- a/frontend/app/src/app/modules/library/account/profile/profile-page.html +++ b/frontend/app/src/app/modules/library/account/profile/profile-page.html @@ -26,27 +26,45 @@ - @for (property of propertiesToShow; track property) { - @if (patron[property]) { - - - {{ 'library.account.pages.profile.labels' + '.' + property | translate }}: - - - @if (!['expires'].includes(property)) { - {{ patron[property] }} - } @else { - @if (isUnlimitedExpiry(patron['expires'])) { - {{ 'library.account.pages.profile.values.unlimited' | translate }} - } @else { - {{ 'library.account.pages.profile.values.expires' | translate }}: {{ - patron['expires'] | amDateFormat: 'll' - }} - } - } - - - } + + {{ 'library.account.pages.profile.labels.id' | translate }}: + + {{ patron.id }} + + + + {{ 'library.account.pages.profile.labels.name' | translate }}: + {{ patron.name_details?.title ?? '' }} {{ patron.name }} + + @if (patron.email) { + + {{ 'library.account.pages.profile.labels.email' | translate }}: + + {{ patron.email }} + + + } + @if (patron.address) { + + {{ 'library.account.pages.profile.labels.address' | translate }}: + + {{ patron.address }} + + + } + @if (patron.expires) { + + {{ 'library.account.pages.profile.labels.expires' | translate }}: + + @if (isUnlimitedExpiry(patron.expires)) { + {{ 'library.account.pages.profile.values.unlimited' | translate }} + } @else { + {{ 'library.account.pages.profile.values.expires' | translate }}: {{ + patron.expires | amDateFormat: 'll' + }} + } + + } diff --git a/frontend/app/src/app/modules/library/types.ts b/frontend/app/src/app/modules/library/types.ts index 8b651c1b..5bc22bb1 100644 --- a/frontend/app/src/app/modules/library/types.ts +++ b/frontend/app/src/app/modules/library/types.ts @@ -22,6 +22,13 @@ export interface PAIAPatron { status?: PAIAPatronStatus; type?: string; note?: string; + // HeBIS specific property (not in PAIA documentation) + name_details?: { + firstname?: string; + lastname?: string; + gender?: string; + title?: string; + }; } export enum PAIAPatronStatus {