From cbb949e3977a5821e6bd1b654dec66a82e4d8c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Kruni=C4=87?= Date: Fri, 18 Nov 2022 11:21:44 +0100 Subject: [PATCH] fix: library fines should load item title only if needed Closes #342 --- .../elements/fee-item/fee-item.component.ts | 15 ++++++++----- .../account/elements/fee-item/fee-item.html | 21 ++++++++++++------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/app/modules/library/account/elements/fee-item/fee-item.component.ts b/src/app/modules/library/account/elements/fee-item/fee-item.component.ts index 83542b33..5169a4a6 100644 --- a/src/app/modules/library/account/elements/fee-item/fee-item.component.ts +++ b/src/app/modules/library/account/elements/fee-item/fee-item.component.ts @@ -13,14 +13,19 @@ export class FeeItemComponent { book?: SCBook | SCPeriodical | SCArticle; + hasEdition = false; + @Input() set fee(fee: PAIAFee) { + this.hasEdition = !fee.edition?.includes('null'); this._fee = fee; - this.libraryAccountService - .getDocumentFromHDS(fee.edition as string) - .then(book => { - this.book = book; - }); + if (this.hasEdition) { + this.libraryAccountService + .getDocumentFromHDS(fee.edition as string) + .then(book => { + this.book = book; + }); + } } get fee() { diff --git a/src/app/modules/library/account/elements/fee-item/fee-item.html b/src/app/modules/library/account/elements/fee-item/fee-item.html index dbceecba..0010888f 100644 --- a/src/app/modules/library/account/elements/fee-item/fee-item.html +++ b/src/app/modules/library/account/elements/fee-item/fee-item.html @@ -1,13 +1,18 @@ -

- {{ 'library.account.pages.fines.labels.edition' | translate }}: - {{ book.name }} -

-

-

+ +

+ {{ 'library.account.pages.fines.labels.edition' | translate }}: + {{ book.name }} +

+

+

+

{{ 'library.account.pages.fines.labels' + '.' + property | translate }}: