From 573a21e7a8105f5c9dff872a8ca42db840facbc7 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Thu, 5 Oct 2023 15:57:34 +0200 Subject: [PATCH] The license labels are loaded in the same way than in the clarin item view box. --- .../clarin-license-info/clarin-license-info.component.html | 2 +- .../clarin-license-info/clarin-license-info.component.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/item-page/clarin-license-info/clarin-license-info.component.html b/src/app/item-page/clarin-license-info/clarin-license-info.component.html index e992719ed34..d2f0f90dbb8 100644 --- a/src/app/item-page/clarin-license-info/clarin-license-info.component.html +++ b/src/app/item-page/clarin-license-info/clarin-license-info.component.html @@ -10,7 +10,7 @@
{{license}}
-
+
diff --git a/src/app/item-page/clarin-license-info/clarin-license-info.component.ts b/src/app/item-page/clarin-license-info/clarin-license-info.component.ts index df7664d986d..5762533bbdf 100644 --- a/src/app/item-page/clarin-license-info/clarin-license-info.component.ts +++ b/src/app/item-page/clarin-license-info/clarin-license-info.component.ts @@ -8,6 +8,7 @@ import { ClarinLicenseDataService } from '../../core/data/clarin/clarin-license- import { ClarinLicense } from '../../core/shared/clarin/clarin-license.model'; import { DomSanitizer } from '@angular/platform-browser'; import { secureImageData } from '../../shared/clarin-shared-util'; +import { BehaviorSubject } from 'rxjs'; /** * This component show clarin license info in the item page and item full page. @@ -50,7 +51,7 @@ export class ClarinLicenseInfoComponent implements OnInit { /** * Current License Label icon as byte array. */ - licenseLabelIcons: any[] = []; + licenseLabelIcons: BehaviorSubject = new BehaviorSubject([]); ngOnInit(): void { // load license info from item attributes @@ -83,9 +84,11 @@ export class ClarinLicenseInfoComponent implements OnInit { getFirstCompletedRemoteData(), switchMap((clList: RemoteData>) => clList?.payload?.page)) .subscribe(clarinLicense => { + let iconsList = []; clarinLicense.extendedClarinLicenseLabels.forEach(extendedCll => { - this.licenseLabelIcons.push(extendedCll?.icon); + iconsList.push(extendedCll?.icon); }); + this.licenseLabelIcons.next(iconsList); }); }