94481: Use DSONameService in all other remaining place where dc.title, person.familyName, person.givenName or organization.legalName is used

This commit is contained in:
Alexandre Vryghem
2022-09-19 17:45:05 +02:00
parent 80a1eed63c
commit a4b9a6da1d
20 changed files with 58 additions and 63 deletions

View File

@@ -19,7 +19,7 @@
<div class="card-body">
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
<h4 class="card-title" [innerHTML]="firstMetadataValue('dc.title')"></h4>
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
</ds-truncatable-part>
<p *ngIf="dso.hasMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*'])"
class="item-authors card-text text-muted">

View File

@@ -1,11 +1,16 @@
import { Component } from '@angular/core';
import { focusShadow } from '../../../../animations/focus';
import { ViewMode } from '../../../../../core/shared/view-mode.model';
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
import {
listableObjectComponent
} from '../../../../object-collection/shared/listable-object/listable-object.decorator';
import { SearchResultGridElementComponent } from '../../search-result-grid-element.component';
import { Item } from '../../../../../core/shared/item.model';
import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model';
import { getItemPageRoute } from '../../../../../item-page/item-page-routing-paths';
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
import { TruncatableService } from '../../../../truncatable/truncatable.service';
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
@listableObjectComponent('PublicationSearchResult', ViewMode.GridElement)
@listableObjectComponent(ItemSearchResult, ViewMode.GridElement)
@@ -24,8 +29,19 @@ export class ItemSearchResultGridElementComponent extends SearchResultGridElemen
*/
itemPageRoute: string;
dsoTitle: string;
constructor(
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService,
private dsoNameService: DSONameService,
) {
super(truncatableService, bitstreamDataService);
}
ngOnInit(): void {
super.ngOnInit();
this.itemPageRoute = getItemPageRoute(this.dso);
this.dsoTitle = this.dsoNameService.getName(this.dso);
}
}