Skip to content

Commit 82d17d7

Browse files
committed
add support for dsoNameService
1 parent 52dbb21 commit 82d17d7

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<ng-template #descTemplate>
22
<span class="text-muted">
33
<span class="item-list-project-title">
4-
<span [innerHTML]="mdRepresentation.firstMetadataValue(['dc.title'])"></span>
4+
<span [innerHTML]="dsoNameService.getName(mdRepresentation)"></span>
55
</span>
66
</span>
77
</ng-template>
88
<ds-truncatable [id]="mdRepresentation.id">
99
<a [routerLink]="[itemPageRoute]"
10-
[innerHTML]="mdRepresentation.getValue()"
11-
[ngbTooltip]="mdRepresentation.allMetadata(['dc.title']).length > 0 ? descTemplate : null"></a>
12-
</ds-truncatable>
10+
[innerHTML]="dsoNameService.getName(mdRepresentation)"
11+
[ngbTooltip]="dsoNameService.getName(mdRepresentation).length > 0 ? descTemplate : null"></a>
12+
</ds-truncatable>

src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
22
import { metadataRepresentationComponent } from '../../../../shared/metadata-representation/metadata-representation.decorator';
33
import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model';
44
import { ItemMetadataRepresentationListElementComponent } from '../../../../shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component';
5+
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
56

67
@metadataRepresentationComponent('Project', MetadataRepresentationType.Item)
78
@Component({
@@ -12,4 +13,14 @@ import { ItemMetadataRepresentationListElementComponent } from '../../../../shar
1213
* The component for displaying an item of the type Project as a metadata field
1314
*/
1415
export class ProjectItemMetadataListElementComponent extends ItemMetadataRepresentationListElementComponent {
15-
}
16+
/**
17+
* Initialize instance variables
18+
*
19+
* @param nameService
20+
*/
21+
constructor(
22+
public dsoNameService: DSONameService
23+
) {
24+
super();
25+
}
26+
}

0 commit comments

Comments
 (0)