From 91de2e78bc58799b99f2d0a43c2a3f125f278595 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Tue, 5 Mar 2024 17:18:25 +0100 Subject: [PATCH 1/2] Avoid metadata representation element is rendered twice when checking the browse configuration --- .../specific-field/item-page-field.component.ts | 6 +++--- .../metadata-representation-list.component.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index 57f49e36476..8525496aca9 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -4,7 +4,7 @@ import { map } from 'rxjs/operators'; import { Observable } from 'rxjs'; import { BrowseDefinition } from '../../../../core/shared/browse-definition.model'; import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service'; -import { getRemoteDataPayload } from '../../../../core/shared/operators'; +import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; /** * Interface that encapsulate Image configuration for this component. @@ -81,8 +81,8 @@ export class ItemPageFieldComponent { */ get browseDefinition(): Observable { return this.browseDefinitionDataService.findByFields(this.fields).pipe( - getRemoteDataPayload(), - map((def) => def) + getFirstCompletedRemoteData(), + map((def) => def.payload) ); } } diff --git a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts index 59a5377f772..30ec064e68b 100644 --- a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts +++ b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts @@ -9,7 +9,7 @@ import { MetadataValue } from '../../../core/shared/metadata.models'; import { Item } from '../../../core/shared/item.model'; import { AbstractIncrementalListComponent } from '../abstract-incremental-list/abstract-incremental-list.component'; import { map } from 'rxjs/operators'; -import { getRemoteDataPayload } from '../../../core/shared/operators'; +import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { MetadatumRepresentation } from '../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; @@ -96,8 +96,8 @@ export class MetadataRepresentationListComponent extends AbstractIncrementalList searchKeyArray = searchKeyArray.concat(BrowseService.toSearchKeyArray(field)); }); return this.browseDefinitionDataService.findByFields(this.metadataFields).pipe( - getRemoteDataPayload(), - map((def) => Object.assign(new MetadatumRepresentation(this.itemType, def), metadatum)) + getFirstCompletedRemoteData(), + map((def) => Object.assign(new MetadatumRepresentation(this.itemType, def.payload), metadatum)) ); } }), From 07a03bfa2d01b8c87deace41ca5e605ebd87684a Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Thu, 16 May 2024 15:59:48 +0200 Subject: [PATCH 2/2] fix after merge --- .../item-page-field.component.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index 92563bd246e..58521569f15 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -12,25 +12,6 @@ import { Item } from '../../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { MetadataValuesComponent } from '../../../field-components/metadata-values/metadata-values.component'; import { ImageField } from './image-field'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; - -/** - * Interface that encapsulate Image configuration for this component. - */ -export interface ImageField { - /** - * URI that is used to retrieve the image. - */ - URI: string; - /** - * i18n Key that represents the alt text to display - */ - alt: string; - /** - * CSS variable that contains the height of the inline image. - */ - heightVar: string; -} /**