mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-11 08:46:16 +00:00
@@ -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<void> {
|
||||
|
||||
@@ -26,27 +26,45 @@
|
||||
<ion-card>
|
||||
<ion-card-content>
|
||||
<ion-grid>
|
||||
@for (property of propertiesToShow; track property) {
|
||||
@if (patron[property]) {
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
{{ 'library.account.pages.profile.labels' + '.' + property | translate }}:
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
@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'
|
||||
}}
|
||||
}
|
||||
}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
}
|
||||
<ion-row>
|
||||
<ion-col> {{ 'library.account.pages.profile.labels.id' | translate }}: </ion-col>
|
||||
<ion-col>
|
||||
{{ patron.id }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col> {{ 'library.account.pages.profile.labels.name' | translate }}: </ion-col>
|
||||
<ion-col> {{ patron.name_details?.title ?? '' }} {{ patron.name }} </ion-col>
|
||||
</ion-row>
|
||||
@if (patron.email) {
|
||||
<ion-row>
|
||||
<ion-col> {{ 'library.account.pages.profile.labels.email' | translate }}: </ion-col>
|
||||
<ion-col>
|
||||
{{ patron.email }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
}
|
||||
@if (patron.address) {
|
||||
<ion-row>
|
||||
<ion-col> {{ 'library.account.pages.profile.labels.address' | translate }}: </ion-col>
|
||||
<ion-col>
|
||||
{{ patron.address }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
}
|
||||
@if (patron.expires) {
|
||||
<ion-row>
|
||||
<ion-col> {{ 'library.account.pages.profile.labels.expires' | translate }}: </ion-col>
|
||||
<ion-col>
|
||||
@if (isUnlimitedExpiry(patron.expires)) {
|
||||
{{ 'library.account.pages.profile.values.unlimited' | translate }}
|
||||
} @else {
|
||||
{{ 'library.account.pages.profile.values.expires' | translate }}: {{
|
||||
patron.expires | amDateFormat: 'll'
|
||||
}}
|
||||
}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
}
|
||||
</ion-grid>
|
||||
</ion-card-content>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user