mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
@@ -25,8 +25,6 @@ import {PAIAPatron} from '../../types';
|
|||||||
export class ProfilePageComponent {
|
export class ProfilePageComponent {
|
||||||
patron?: PAIAPatron;
|
patron?: PAIAPatron;
|
||||||
|
|
||||||
propertiesToShow: (keyof PAIAPatron)[] = ['id', 'name', 'email', 'address', 'expires'];
|
|
||||||
|
|
||||||
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
||||||
|
|
||||||
async ionViewWillEnter(): Promise<void> {
|
async ionViewWillEnter(): Promise<void> {
|
||||||
|
|||||||
@@ -26,27 +26,45 @@
|
|||||||
<ion-card>
|
<ion-card>
|
||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
<ion-grid>
|
<ion-grid>
|
||||||
@for (property of propertiesToShow; track property) {
|
<ion-row>
|
||||||
@if (patron[property]) {
|
<ion-col> {{ 'library.account.pages.profile.labels.id' | translate }}: </ion-col>
|
||||||
<ion-row>
|
<ion-col>
|
||||||
<ion-col>
|
{{ patron.id }}
|
||||||
{{ 'library.account.pages.profile.labels' + '.' + property | translate }}:
|
</ion-col>
|
||||||
</ion-col>
|
</ion-row>
|
||||||
<ion-col>
|
<ion-row>
|
||||||
@if (!['expires'].includes(property)) {
|
<ion-col> {{ 'library.account.pages.profile.labels.name' | translate }}: </ion-col>
|
||||||
{{ patron[property] }}
|
<ion-col> {{ patron.name_details?.title ?? '' }} {{ patron.name }} </ion-col>
|
||||||
} @else {
|
</ion-row>
|
||||||
@if (isUnlimitedExpiry(patron['expires'])) {
|
@if (patron.email) {
|
||||||
{{ 'library.account.pages.profile.values.unlimited' | translate }}
|
<ion-row>
|
||||||
} @else {
|
<ion-col> {{ 'library.account.pages.profile.labels.email' | translate }}: </ion-col>
|
||||||
{{ 'library.account.pages.profile.values.expires' | translate }}: {{
|
<ion-col>
|
||||||
patron['expires'] | amDateFormat: 'll'
|
{{ patron.email }}
|
||||||
}}
|
</ion-col>
|
||||||
}
|
</ion-row>
|
||||||
}
|
}
|
||||||
</ion-col>
|
@if (patron.address) {
|
||||||
</ion-row>
|
<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-grid>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ export interface PAIAPatron {
|
|||||||
status?: PAIAPatronStatus;
|
status?: PAIAPatronStatus;
|
||||||
type?: string;
|
type?: string;
|
||||||
note?: string;
|
note?: string;
|
||||||
|
// HeBIS specific property (not in PAIA documentation)
|
||||||
|
name_details?: {
|
||||||
|
firstname?: string;
|
||||||
|
lastname?: string;
|
||||||
|
gender?: string;
|
||||||
|
title?: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PAIAPatronStatus {
|
export enum PAIAPatronStatus {
|
||||||
|
|||||||
Reference in New Issue
Block a user