From 09b66186d00edb9d7a1fc39029e700f19561d51a Mon Sep 17 00:00:00 2001 From: Simone Ramundi Date: Mon, 21 Oct 2024 12:28:55 +0200 Subject: [PATCH 1/2] [DSC-1979] Added consents filter to prevent null values in observable --- .../item/item-search-result-list-element.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index 99b064efaa5..4578638fb27 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -15,7 +15,7 @@ import { TruncatableService } from '../../../../../truncatable/truncatable.servi import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../../../../../config/app-config.interface'; import { getFirstSucceededRemoteListPayload } from '../../../../../../core/shared/operators'; -import { map } from 'rxjs/operators'; +import { filter, map } from 'rxjs/operators'; @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement) @@ -69,7 +69,9 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen this.klaroService.watchConsentUpdates(); this.hasLoadedThirdPartyMetrics$ = combineLatest([ - this.klaroService.consentsUpdates$, + this.klaroService.consentsUpdates$.pipe( + filter(consents => consents != null) + ), this.dso.metrics?.pipe( getFirstSucceededRemoteListPayload(), map(metrics => { From be560a6e821dd482b3663b9b68b132817118b7c0 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Thu, 24 Oct 2024 19:10:26 +0200 Subject: [PATCH 2/2] [DSC-1979] Improve filer check condition --- .../item/item-search-result-list-element.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index 4578638fb27..f193c9f15a3 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -16,6 +16,7 @@ import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.serv import { APP_CONFIG, AppConfig } from '../../../../../../../config/app-config.interface'; import { getFirstSucceededRemoteListPayload } from '../../../../../../core/shared/operators'; import { filter, map } from 'rxjs/operators'; +import { isNotEmpty } from '../../../../../empty.util'; @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement) @@ -70,7 +71,7 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen this.hasLoadedThirdPartyMetrics$ = combineLatest([ this.klaroService.consentsUpdates$.pipe( - filter(consents => consents != null) + filter(consents => isNotEmpty(consents)) ), this.dso.metrics?.pipe( getFirstSucceededRemoteListPayload(),