Skip to content

Commit 66b5398

Browse files
committed
Merge branch 'w2p-94060_Issue-1720_MyDSpace-support-entities_7.0' into w2p-94060_Issue-1720_MyDSpace-support-entities_7.2
2 parents 9ba2807 + 3c5fe8e commit 66b5398

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<ds-truncatable [id]="dso.id">
33
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
44
[routerLink]="[itemPageRoute]" class="lead"
5-
[innerHTML]="firstMetadataValue('organization.legalName')"></a>
5+
[innerHTML]="firstMetadataValue('organization.legalName') || ('orgunit.listelement.no-title' | translate)"></a>
66
<span *ngIf="linkType == linkTypes.None"
77
class="lead"
8-
[innerHTML]="firstMetadataValue('organization.legalName')"></span>
8+
[innerHTML]="firstMetadataValue('organization.legalName') || ('orgunit.listelement.no-title' | translate)"></span>
99
<span class="text-muted">
1010
<ds-truncatable-part [id]="dso.id" [minLines]="3">
1111
<span *ngIf="dso.allMetadata(['dc.description']).length > 0"

src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<ds-truncatable [id]="dso.id">
33
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
44
[routerLink]="[itemPageRoute]" class="lead"
5-
[innerHTML]="name"></a>
5+
[innerHTML]="name || ('person.listelement.no-title' | translate)"></a>
66
<span *ngIf="linkType == linkTypes.None"
77
class="lead"
8-
[innerHTML]="firstMetadataValue('person.familyName') + ', ' + firstMetadataValue('person.givenName')"></span>
8+
[innerHTML]="name || ('person.listelement.no-title' | translate)"></span>
99
<span class="text-muted">
1010
<ds-truncatable-part [id]="dso.id" [minLines]="1">
1111
<span *ngIf="dso.allMetadata(['person.jobTitle']).length > 0"

src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
22
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
33
import { ViewMode } from '../../../../../core/shared/view-mode.model';
44
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
5+
import { hasValue } from '../../../../../shared/empty.util';
56

67
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement)
78
@Component({
@@ -15,8 +16,12 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje
1516
export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent {
1617

1718
get name() {
18-
return this.value ?
19-
this.value :
20-
this.firstMetadataValue('person.familyName') + ', ' + this.firstMetadataValue('person.givenName');
19+
if (hasValue(this.value)) {
20+
return this.value;
21+
}
22+
if (hasValue(this.firstMetadataValue('person.familyName')) || hasValue(this.firstMetadataValue('person.givenName'))) {
23+
return this.firstMetadataValue('person.familyName') + ', ' + this.firstMetadataValue('person.givenName');
24+
}
25+
return undefined;
2126
}
2227
}

src/assets/i18n/en.json5

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,6 +2701,8 @@
27012701

27022702
"orgunit.listelement.badge": "Organizational Unit",
27032703

2704+
"orgunit.listelement.no-title": "Untitled",
2705+
27042706
"orgunit.page.city": "City",
27052707

27062708
"orgunit.page.country": "Country",

0 commit comments

Comments
 (0)