mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
94060: added fallback titles for person and orgunit list elements
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
<ds-truncatable [id]="dso.id">
|
||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
[routerLink]="[itemPageRoute]" class="lead"
|
||||
[innerHTML]="firstMetadataValue('organization.legalName')"></a>
|
||||
[innerHTML]="firstMetadataValue('organization.legalName') || ('orgunit.listelement.no-title' | translate)"></a>
|
||||
<span *ngIf="linkType == linkTypes.None"
|
||||
class="lead"
|
||||
[innerHTML]="firstMetadataValue('organization.legalName')"></span>
|
||||
[innerHTML]="firstMetadataValue('organization.legalName') || ('orgunit.listelement.no-title' | translate)"></span>
|
||||
<span class="text-muted">
|
||||
<ds-truncatable-part [id]="dso.id" [minLines]="3">
|
||||
<span *ngIf="dso.allMetadata(['dc.description']).length > 0"
|
||||
|
@@ -2,10 +2,10 @@
|
||||
<ds-truncatable [id]="dso.id">
|
||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
[routerLink]="[itemPageRoute]" class="lead"
|
||||
[innerHTML]="name"></a>
|
||||
[innerHTML]="name || ('person.listelement.no-title' | translate)"></a>
|
||||
<span *ngIf="linkType == linkTypes.None"
|
||||
class="lead"
|
||||
[innerHTML]="firstMetadataValue('person.familyName') + ', ' + firstMetadataValue('person.givenName')"></span>
|
||||
[innerHTML]="name || ('person.listelement.no-title' | translate)"></span>
|
||||
<span class="text-muted">
|
||||
<ds-truncatable-part [id]="dso.id" [minLines]="1">
|
||||
<span *ngIf="dso.allMetadata(['person.jobTitle']).length > 0"
|
||||
|
@@ -2,6 +2,7 @@ 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 { hasValue } from '../../../../../shared/empty.util';
|
||||
|
||||
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement)
|
||||
@Component({
|
||||
@@ -15,8 +16,12 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje
|
||||
export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent {
|
||||
|
||||
get name() {
|
||||
return this.value ?
|
||||
this.value :
|
||||
this.firstMetadataValue('person.familyName') + ', ' + this.firstMetadataValue('person.givenName');
|
||||
if (hasValue(this.value)) {
|
||||
return this.value;
|
||||
}
|
||||
if (hasValue(this.firstMetadataValue('person.familyName')) || hasValue(this.firstMetadataValue('person.givenName'))) {
|
||||
return this.firstMetadataValue('person.familyName') + ', ' + this.firstMetadataValue('person.givenName');
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
@@ -2381,6 +2381,8 @@
|
||||
|
||||
"orgunit.listelement.badge": "Organizational Unit",
|
||||
|
||||
"orgunit.listelement.no-title": "Untitled",
|
||||
|
||||
"orgunit.page.city": "City",
|
||||
|
||||
"orgunit.page.country": "Country",
|
||||
|
Reference in New Issue
Block a user