From fd26f19041625cbbb7cc9be85e9f10f08d3da344 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 30 Apr 2019 14:07:01 +0200 Subject: [PATCH] show entity time on item pages and in search results --- resources/i18n/en.json | 28 +++++++++++++++++++ .../item-page-title-field.component.html | 3 ++ .../journal-issue.component.html | 2 +- .../journal-volume.component.html | 2 +- .../item-types/journal/journal.component.html | 2 +- .../item-types/orgunit/orgunit.component.html | 2 +- .../item-types/person/person.component.html | 2 +- .../item-types/project/project.component.html | 2 +- .../publication/publication.component.html | 4 ++- .../data/search-response-parsing.service.ts | 2 +- ...-search-result-list-element.component.html | 3 ++ ...em-search-result-list-element.component.ts | 3 ++ 12 files changed, 47 insertions(+), 8 deletions(-) diff --git a/resources/i18n/en.json b/resources/i18n/en.json index 1952e345d8..f95db83af0 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -288,6 +288,7 @@ }, "person": { "page": { + "titleprefix": "Person: ", "jobtitle": "Job Title", "lastname": "Last Name", "firstname": "First Name", @@ -298,56 +299,83 @@ "link": { "full": "Show all metadata" } + }, + "listelement": { + "badge": "Person" } }, "project": { "page": { + "titleprefix": "Research Project: ", "status": "Status", "id": "ID", "expectedcompletion": "Expected Completion", "description": "Description", "keyword": "Keywords" + }, + "listelement": { + "badge": "Research Project" } }, "orgunit": { "page": { + "titleprefix": "Organizational Unit: ", "dateestablished": "Date established", "city": "City", "country": "Country", "id": "ID", "description": "Description" + }, + "listelement": { + "badge": "Organizational Unit" } }, "journal": { "page": { + "titleprefix": "Journal: ", "issn": "ISSN", "publisher": "Publisher", "description": "Description", "editor": "Editor-in-Chief" + }, + "listelement": { + "badge": "Journal" } }, "journalvolume": { "page": { + "titleprefix": "Journal Volume: ", "volume": "Volume", "issuedate": "Issue Date", "description": "Description" + }, + "listelement": { + "badge": "Journal Volume" } }, "journalissue": { "page": { + "titleprefix": "Journal Issue: ", "number": "Number", "issuedate": "Issue Date", "description": "Description", "keyword": "Keywords", "journal-title": "Journal Title", "journal-issn": "Journal ISSN" + }, + "listelement": { + "badge": "Journal Issue" } }, "publication": { "page": { + "titleprefix": "Publication: ", "journal-title": "Journal Title", "journal-issn": "Journal ISSN", "volume-title": "Volume Title" + }, + "listelement": { + "badge": "Publication" } }, "nav": { diff --git a/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.html b/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.html index aac85d335f..43bd20d0f6 100644 --- a/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.html +++ b/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.html @@ -1,3 +1,6 @@

+
+ {{ type.toLowerCase() + '.page.titleprefix' | translate }} +

diff --git a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html b/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html index 0b7fa2d57b..5d96abb82b 100644 --- a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html +++ b/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html @@ -1,5 +1,5 @@

- + {{'journalissue.page.titleprefix' | translate}}

diff --git a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html b/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html index c4ef7102bd..18bf1701fc 100644 --- a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html +++ b/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html @@ -1,5 +1,5 @@

- + {{'journalvolume.page.titleprefix' | translate}}

diff --git a/src/app/+item-page/simple/item-types/journal/journal.component.html b/src/app/+item-page/simple/item-types/journal/journal.component.html index a872b79507..2ab3430256 100644 --- a/src/app/+item-page/simple/item-types/journal/journal.component.html +++ b/src/app/+item-page/simple/item-types/journal/journal.component.html @@ -1,5 +1,5 @@

- + {{'journal.page.titleprefix' | translate}}

diff --git a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.html b/src/app/+item-page/simple/item-types/orgunit/orgunit.component.html index ba11fce201..ca6d3cecf1 100644 --- a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.html +++ b/src/app/+item-page/simple/item-types/orgunit/orgunit.component.html @@ -1,5 +1,5 @@

- + {{'orgunit.page.titleprefix' | translate}}

diff --git a/src/app/+item-page/simple/item-types/person/person.component.html b/src/app/+item-page/simple/item-types/person/person.component.html index d98991a421..52353219ee 100644 --- a/src/app/+item-page/simple/item-types/person/person.component.html +++ b/src/app/+item-page/simple/item-types/person/person.component.html @@ -1,5 +1,5 @@

- + {{'person.page.titleprefix' | translate}}

diff --git a/src/app/+item-page/simple/item-types/project/project.component.html b/src/app/+item-page/simple/item-types/project/project.component.html index 5cba278252..5cecad5daf 100644 --- a/src/app/+item-page/simple/item-types/project/project.component.html +++ b/src/app/+item-page/simple/item-types/project/project.component.html @@ -1,5 +1,5 @@

- + {{'project.page.titleprefix' | translate}}

diff --git a/src/app/+item-page/simple/item-types/publication/publication.component.html b/src/app/+item-page/simple/item-types/publication/publication.component.html index ab1ce097f5..37135c6036 100644 --- a/src/app/+item-page/simple/item-types/publication/publication.component.html +++ b/src/app/+item-page/simple/item-types/publication/publication.component.html @@ -1,4 +1,6 @@ - +

+ {{'publication.page.titleprefix' | translate}} +

diff --git a/src/app/core/data/search-response-parsing.service.ts b/src/app/core/data/search-response-parsing.service.ts index 0ca793c5ae..0e9d39849b 100644 --- a/src/app/core/data/search-response-parsing.service.ts +++ b/src/app/core/data/search-response-parsing.service.ts @@ -31,7 +31,7 @@ export class SearchResponseParsingService implements ResponseParsingService { const dsoSelfLinks = payload._embedded.objects .filter((object) => hasValue(object._embedded)) - .map((object) => object._embedded.dspaceObject) + .map((object) => object._embedded.indexableObject) // we don't need embedded collections, bitstreamformats, etc for search results. // And parsing them all takes up a lot of time. Throw them away to improve performance // until objs until partial results are supported by the rest api diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.html index d433c7acf2..74aeeeeda7 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.html @@ -1 +1,4 @@ +
+ {{ type.toLowerCase() + '.listelement.badge' | translate }} +
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.ts index 4e43ef2b2c..5bd3c8ff5a 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.ts @@ -1,6 +1,8 @@ import { Component } from '@angular/core'; +import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { Item } from '../../../../core/shared/item.model'; import { focusBackground } from '../../../animations/focus'; +import { hasValue } from '../../../empty.util'; import { renderElementsFor } from '../../../object-collection/shared/dso-element-decorator'; import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; @@ -19,4 +21,5 @@ import { ItemViewMode } from '../../../items/item-type-decorator'; @renderElementsFor(ItemSearchResult, SetViewMode.List) export class ItemSearchResultListElementComponent extends SearchResultListElementComponent { viewMode = ItemViewMode.Element; + }