Skip to content

Commit a6ee2b8

Browse files
authored
Merge pull request DSpace#1839 from atmire/issue-1833_entity-title-refactor-main
Full item page of entities missing title/name
2 parents 994c9b3 + dc54990 commit a6ee2b8

38 files changed

Lines changed: 113 additions & 162 deletions

File tree

src/app/core/breadcrumbs/dso-name.service.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export class DSONameService {
3131
const givenName = dso.firstMetadataValue('person.givenName');
3232
if (isEmpty(familyName) && isEmpty(givenName)) {
3333
return dso.firstMetadataValue('dc.title') || dso.name;
34+
} else if (isEmpty(familyName) || isEmpty(givenName)) {
35+
return familyName || givenName;
3436
} else {
3537
return `${familyName}, ${givenName}`;
3638
}
@@ -55,11 +57,14 @@ export class DSONameService {
5557
.filter((type) => typeof type === 'string')
5658
.find((type: string) => Object.keys(this.factories).includes(type)) as string;
5759

60+
let name;
5861
if (hasValue(match)) {
59-
return this.factories[match](dso);
60-
} else {
61-
return this.factories.Default(dso);
62+
name = this.factories[match](dso);
6263
}
64+
if (isEmpty(name)) {
65+
name = this.factories.Default(dso);
66+
}
67+
return name;
6368
}
6469

6570
}

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="card-body">
2222
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
2323
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
24-
<h4 class="card-title" [innerHTML]="firstMetadataValue('dc.title')"></h4>
24+
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
2525
</ds-truncatable-part>
2626
<p *ngIf="dso.hasMetadata('creativework.datePublished')"
2727
class="item-date card-text text-muted">

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="card-body">
2222
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
2323
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
24-
<h4 class="card-title" [innerHTML]="dso.firstMetadataValue('dc.title')"></h4>
24+
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
2525
</ds-truncatable-part>
2626
<p *ngIf="dso.hasMetadata('creativework.datePublished')"
2727
class="item-date card-text text-muted">

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="card-body">
2222
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
2323
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
24-
<h4 class="card-title" [innerHTML]="firstMetadataValue('dc.title')"></h4>
24+
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
2525
</ds-truncatable-part>
2626
<p *ngIf="dso.hasMetadata('creativework.editor')"
2727
class="item-publisher card-text text-muted">

src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<div class="d-flex flex-row">
2-
<h2 class="item-page-title-field mr-auto">
3-
{{'journalissue.page.titleprefix' | translate}}<ds-metadata-values [mdValues]="object?.allMetadata(['dc.title'])"></ds-metadata-values>
4-
</h2>
2+
<ds-item-page-title-field [item]="object" class="mr-auto">
3+
</ds-item-page-title-field>
54
<div class="pl-2 space-children-mr">
65
<ds-dso-page-version-button (newVersionEvent)="onCreateNewVersion()" [dso]="object"
76
[tooltipMsgCreate]="'item.page.version.create'"

src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<div class="d-flex flex-row">
2-
<h2 class="item-page-title-field mr-auto">
3-
{{'journalvolume.page.titleprefix' | translate}}<ds-metadata-values [mdValues]="object?.allMetadata(['dc.title'])"></ds-metadata-values>
4-
</h2>
2+
<ds-item-page-title-field [item]="object" class="mr-auto">
3+
</ds-item-page-title-field>
54
<div class="pl-2 space-children-mr">
65
<ds-dso-page-version-button (newVersionEvent)="onCreateNewVersion()" [dso]="object"
76
[tooltipMsgCreate]="'item.page.version.create'"

src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<div class="d-flex flex-row">
2-
<h2 class="item-page-title-field mr-auto">
3-
{{'journal.page.titleprefix' | translate}}<ds-metadata-values [mdValues]="object?.allMetadata(['dc.title'])"></ds-metadata-values>
4-
</h2>
2+
<ds-item-page-title-field [item]="object" class="mr-auto">
3+
</ds-item-page-title-field>
54
<div class="pl-2 space-children-mr">
65
<ds-dso-page-version-button (newVersionEvent)="onCreateNewVersion()" [dso]="object"
76
[tooltipMsgCreate]="'item.page.version.create'"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="card-body">
2222
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
2323
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
24-
<h4 class="card-title" [innerHTML]="firstMetadataValue('organization.legalName')"></h4>
24+
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
2525
</ds-truncatable-part>
2626
<p *ngIf="dso.hasMetadata('organization.foundingDate')"
2727
class="item-date card-text text-muted">

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
<div class="card-body">
2222
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
2323
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
24-
<h4 class="card-title"
25-
[innerHTML]="firstMetadataValue('person.familyName') + ', ' + firstMetadataValue('person.givenName')"></h4>
24+
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
2625
</ds-truncatable-part>
2726
<p *ngIf="dso.hasMetadata('person.email')" class="item-email card-text text-muted">
2827
<ds-truncatable-part [id]="dso.id" [minLines]="1">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="card-body">
2222
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
2323
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
24-
<h4 class="card-title" [innerHTML]="firstMetadataValue('dc.title')"></h4>
24+
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
2525
</ds-truncatable-part>
2626
<p *ngIf="dso.hasMetadata('dc.description')" class="item-description card-text text-muted">
2727
<ds-truncatable-part [id]="dso.id" [minLines]="3">

0 commit comments

Comments
 (0)