94060: added fallback titles for person and orgunit list elements

This commit is contained in:
lotte
2022-09-06 10:11:23 +02:00
parent 72e5909b71
commit 3c5fe8e098
4 changed files with 14 additions and 7 deletions

View File

@@ -2,10 +2,10 @@
<ds-truncatable [id]="dso.id"> <ds-truncatable [id]="dso.id">
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" <a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
[routerLink]="[itemPageRoute]" class="lead" [routerLink]="[itemPageRoute]" class="lead"
[innerHTML]="firstMetadataValue('organization.legalName')"></a> [innerHTML]="firstMetadataValue('organization.legalName') || ('orgunit.listelement.no-title' | translate)"></a>
<span *ngIf="linkType == linkTypes.None" <span *ngIf="linkType == linkTypes.None"
class="lead" class="lead"
[innerHTML]="firstMetadataValue('organization.legalName')"></span> [innerHTML]="firstMetadataValue('organization.legalName') || ('orgunit.listelement.no-title' | translate)"></span>
<span class="text-muted"> <span class="text-muted">
<ds-truncatable-part [id]="dso.id" [minLines]="3"> <ds-truncatable-part [id]="dso.id" [minLines]="3">
<span *ngIf="dso.allMetadata(['dc.description']).length > 0" <span *ngIf="dso.allMetadata(['dc.description']).length > 0"

View File

@@ -2,10 +2,10 @@
<ds-truncatable [id]="dso.id"> <ds-truncatable [id]="dso.id">
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" <a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
[routerLink]="[itemPageRoute]" class="lead" [routerLink]="[itemPageRoute]" class="lead"
[innerHTML]="name"></a> [innerHTML]="name || ('person.listelement.no-title' | translate)"></a>
<span *ngIf="linkType == linkTypes.None" <span *ngIf="linkType == linkTypes.None"
class="lead" class="lead"
[innerHTML]="firstMetadataValue('person.familyName') + ', ' + firstMetadataValue('person.givenName')"></span> [innerHTML]="name || ('person.listelement.no-title' | translate)"></span>
<span class="text-muted"> <span class="text-muted">
<ds-truncatable-part [id]="dso.id" [minLines]="1"> <ds-truncatable-part [id]="dso.id" [minLines]="1">
<span *ngIf="dso.allMetadata(['person.jobTitle']).length > 0" <span *ngIf="dso.allMetadata(['person.jobTitle']).length > 0"

View File

@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { 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) @listableObjectComponent('PersonSearchResult', ViewMode.ListElement)
@Component({ @Component({
@@ -15,8 +16,12 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje
export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent { export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent {
get name() { get name() {
return this.value ? if (hasValue(this.value)) {
this.value : return this.value;
this.firstMetadataValue('person.familyName') + ', ' + this.firstMetadataValue('person.givenName'); }
if (hasValue(this.firstMetadataValue('person.familyName')) || hasValue(this.firstMetadataValue('person.givenName'))) {
return this.firstMetadataValue('person.familyName') + ', ' + this.firstMetadataValue('person.givenName');
}
return undefined;
} }
} }

View File

@@ -2381,6 +2381,8 @@
"orgunit.listelement.badge": "Organizational Unit", "orgunit.listelement.badge": "Organizational Unit",
"orgunit.listelement.no-title": "Untitled",
"orgunit.page.city": "City", "orgunit.page.city": "City",
"orgunit.page.country": "Country", "orgunit.page.country": "Country",