diff --git a/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.ts b/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.ts index 2bf87223b58..4abc3a2fea4 100644 --- a/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.ts +++ b/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.ts @@ -335,7 +335,7 @@ export class ClarinLicenseAgreementPageComponent implements OnInit { private checkFilledInRequiredInfo() { const areFilledIn = []; // Every requiredInfo.name === userMetadata.metadataKey must have the value in the userMetadata.metadataValue - this.requiredInfo$?.value.forEach(requiredInfo => { + this.requiredInfo$?.value?.forEach(requiredInfo => { let hasMetadataValue = false; this.userMetadata$?.value?.page?.forEach(userMetadata => { if (userMetadata.metadataKey === requiredInfo.name) { diff --git a/src/app/core/shared/clarin/clarin-license-required-info-serializer.ts b/src/app/core/shared/clarin/clarin-license-required-info-serializer.ts index 397e4c92d43..48d43c3df85 100644 --- a/src/app/core/shared/clarin/clarin-license-required-info-serializer.ts +++ b/src/app/core/shared/clarin/clarin-license-required-info-serializer.ts @@ -41,6 +41,7 @@ export const ClarinLicenseRequiredInfoSerializer = { if (isEmpty(requiredInfo)) { return; } + requiredInfo = requiredInfo.trim(); clarinLicenseRequiredInfo.push( Object.assign(new ClarinLicenseRequiredInfo(), { id: clarinLicenseRequiredInfo.length, diff --git a/src/app/item-page/clarin-license-info/clarin-license-info.component.spec.ts b/src/app/item-page/clarin-license-info/clarin-license-info.component.spec.ts index b7da719e53f..c40bdd40e53 100644 --- a/src/app/item-page/clarin-license-info/clarin-license-info.component.spec.ts +++ b/src/app/item-page/clarin-license-info/clarin-license-info.component.spec.ts @@ -82,6 +82,6 @@ describe('ClarinLicenseInfoComponent', () => { }); it('should load license label icons', () => { - expect(component.licenseLabelIcons.length).toEqual(2); + expect(component.licenseLabelIcons.length).toEqual(1); }); }); 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 755dbe9af82..df7664d986d 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 @@ -86,7 +86,6 @@ export class ClarinLicenseInfoComponent implements OnInit { clarinLicense.extendedClarinLicenseLabels.forEach(extendedCll => { this.licenseLabelIcons.push(extendedCll?.icon); }); - this.licenseLabelIcons.push(clarinLicense?.clarinLicenseLabel?.icon); }); }