diff --git a/src/app/core/profile/model/researcher-profile.model.ts b/src/app/core/profile/model/researcher-profile.model.ts index e5098496d3..a07467476e 100644 --- a/src/app/core/profile/model/researcher-profile.model.ts +++ b/src/app/core/profile/model/researcher-profile.model.ts @@ -4,7 +4,7 @@ import { HALLink } from '../../shared/hal-link.model'; import { ResourceType } from '../../shared/resource-type'; import { excludeFromEquals } from '../../utilities/equals.decorators'; import { RESEARCHER_PROFILE } from './researcher-profile.resource-type'; -import {CacheableObject} from "../../cache/cacheable-object.model"; +import {CacheableObject} from '../../cache/cacheable-object.model'; /** * Class the represents a Researcher Profile. diff --git a/src/app/core/profile/researcher-profile.service.ts b/src/app/core/profile/researcher-profile.service.ts index c3383c845d..100fa459a1 100644 --- a/src/app/core/profile/researcher-profile.service.ts +++ b/src/app/core/profile/researcher-profile.service.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-classes-per-file */ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; @@ -30,9 +31,7 @@ import { RESEARCHER_PROFILE } from './model/researcher-profile.resource-type'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; import { PostRequest } from '../data/request.models'; import { hasValue } from '../../shared/empty.util'; -import {CoreState} from "../core-state.model"; - -/* tslint:disable:max-classes-per-file */ +import {CoreState} from '../core-state.model'; /** * A private DataService implementation to delegate specific methods to. diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index a6f64bff1b..32785d7b8a 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -2,6 +2,9 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import {TruncatableService} from '../../../../../shared/truncatable/truncatable.service'; +import {DSONameService} from '../../../../../core/breadcrumbs/dso-name.service'; +import {isNotEmpty} from '../../../../../shared/empty.util'; @listableObjectComponent('PersonSearchResult', ViewMode.ListElement) @Component({ @@ -14,9 +17,15 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje */ export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent { + public constructor(protected truncatableService: TruncatableService, protected dsoNameService: DSONameService) { + super(truncatableService, dsoNameService); + } + get name() { - return this.value ? - this.value : - this.firstMetadataValue('person.familyName') + ', ' + this.firstMetadataValue('person.givenName'); + let personName = this.dsoNameService.getName(this.dso); + if (isNotEmpty(this.firstMetadataValue('person.familyName')) && isNotEmpty(this.firstMetadataValue('person.givenName'))) { + personName = this.firstMetadataValue('person.familyName') + ', ' + this.firstMetadataValue('person.givenName'); + } + return personName; } } diff --git a/src/app/entity-groups/research-entities/item-pages/person/person.component.html b/src/app/entity-groups/research-entities/item-pages/person/person.component.html index 31ad9b2463..d8325d8077 100644 --- a/src/app/entity-groups/research-entities/item-pages/person/person.component.html +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.html @@ -1,10 +1,11 @@
{{'researcher.profile.not.associated' | translate}}