diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.html b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.html
index 9aa511cb415..7e2f093a32e 100644
--- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.html
+++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.html
@@ -29,9 +29,9 @@
+
+ [innerHTML]="firstMetadataValue('dc.description')">
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts
index 7665b7d64e3..06fff63d181 100644
--- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts
+++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts
@@ -48,7 +48,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign(new ItemSearchResul
value: '2015-06-26'
}
],
- 'dc.description.abstract': [
+ 'dc.description': [
{
language: 'en_US',
value: 'This is the abstract'
@@ -57,6 +57,20 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign(new ItemSearchResul
}
})
});
+const mockItemWithAbstractOnly: ItemSearchResult = Object.assign(new ItemSearchResult(), {
+ indexableObject:
+ Object.assign(new Item(), {
+ bundles: observableOf({}),
+ metadata: {
+ 'dc.description.abstract': [
+ {
+ language: 'en_US',
+ value: 'Legacy abstract only'
+ }
+ ]
+ }
+ })
+});
const mockItemWithoutMetadata: ItemSearchResult = Object.assign(new ItemSearchResult(), {
indexableObject:
Object.assign(new Item(), {
@@ -99,7 +113,7 @@ const mockPerson: ItemSearchResult = Object.assign(new ItemSearchResult(), {
value: '2015-06-26'
}
],
- 'dc.description.abstract': [
+ 'dc.description': [
{
language: 'en_US',
value: 'This is the abstract'
@@ -153,7 +167,7 @@ const mockOrgUnit: ItemSearchResult = Object.assign(new ItemSearchResult(), {
value: '2015-06-26'
}
],
- 'dc.description.abstract': [
+ 'dc.description': [
{
language: 'en_US',
value: 'This is the abstract'
@@ -317,6 +331,18 @@ describe('ItemSearchResultListElementComponent', () => {
});
});
+ describe('When the item has only dc.description.abstract metadata', () => {
+ beforeEach(() => {
+ publicationListElementComponent.object = mockItemWithAbstractOnly;
+ fixture.detectChanges();
+ });
+
+ it('should not show the abstract span', () => {
+ const abstractField = fixture.debugElement.query(By.css('div.item-list-abstract'));
+ expect(abstractField).toBeNull();
+ });
+ });
+
describe('When the item has title', () => {
beforeEach(() => {
publicationListElementComponent.object = mockItemWithMetadata;