mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Update: replaced logic of allMetadataValues method by allMetadataNoExcludingValues logic
This commit is contained in:
@@ -29,7 +29,7 @@
|
|||||||
<span *ngIf="dso.firstMetadataValue('dc.date.issued')" class="item-list-date" [innerHTML]="firstMetadataValue('dc.date.issued')"></span>)
|
<span *ngIf="dso.firstMetadataValue('dc.date.issued')" class="item-list-date" [innerHTML]="firstMetadataValue('dc.date.issued')"></span>)
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<span *ngIf="dso.allMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']).length > 0" class="item-list-authors">
|
<span *ngIf="dso.allMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']).length > 0" class="item-list-authors">
|
||||||
<span *ngFor="let author of allMetadataNoExcludingValues(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']); let last=last;">
|
<span *ngFor="let author of allMetadataValues(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']); let last=last;">
|
||||||
<span [innerHTML]="author"><span [innerHTML]="author"></span></span>
|
<span [innerHTML]="author"><span [innerHTML]="author"></span></span>
|
||||||
<span *ngIf="!last">; </span>
|
<span *ngIf="!last">; </span>
|
||||||
</span>
|
</span>
|
||||||
|
@@ -37,23 +37,13 @@ export class SearchResultListElementComponent<T extends SearchResult<K>, K exten
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets all matching metadata string values from hitHighlights or dso metadata, preferring hitHighlights.
|
|
||||||
*
|
|
||||||
* @param {string|string[]} keyOrKeys The metadata key(s) in scope. Wildcards are supported; see [[Metadata]].
|
|
||||||
* @returns {string[]} the matching string values or an empty array.
|
|
||||||
*/
|
|
||||||
allMetadataValues(keyOrKeys: string | string[]): string[] {
|
|
||||||
return Metadata.allValues([this.object.hitHighlights, this.dso.metadata], keyOrKeys);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all matching metadata string values from hitHighlights or dso metadata.
|
* Gets all matching metadata string values from hitHighlights or dso metadata.
|
||||||
*
|
*
|
||||||
* @param {string|string[]} keyOrKeys The metadata key(s) in scope. Wildcards are supported; see [[Metadata]].
|
* @param {string|string[]} keyOrKeys The metadata key(s) in scope. Wildcards are supported; see [[Metadata]].
|
||||||
* @returns {string[]} the matching string values or an empty array.
|
* @returns {string[]} the matching string values or an empty array.
|
||||||
*/
|
*/
|
||||||
allMetadataNoExcludingValues(keyOrKeys: string | string[]): string[] {
|
allMetadataValues(keyOrKeys: string | string[]): string[] {
|
||||||
let dsoMetadata: string[] = Metadata.allValues([this.dso.metadata], keyOrKeys);
|
let dsoMetadata: string[] = Metadata.allValues([this.dso.metadata], keyOrKeys);
|
||||||
let highlights: string[] = Metadata.allValues([this.object.hitHighlights], keyOrKeys);
|
let highlights: string[] = Metadata.allValues([this.object.hitHighlights], keyOrKeys);
|
||||||
let removedHighlights: string[] = highlights.map(str => str.replace(/<\/?em>/g, ''));
|
let removedHighlights: string[] = highlights.map(str => str.replace(/<\/?em>/g, ''));
|
||||||
|
Reference in New Issue
Block a user