mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
Use DSONameService to display DSpaceObjects names
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload
|
||||
} from '../../core/shared/operators';
|
||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
|
||||
/**
|
||||
* An interface to represent a collection entry
|
||||
@@ -124,7 +125,8 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy {
|
||||
constructor(
|
||||
private changeDetectorRef: ChangeDetectorRef,
|
||||
private collectionDataService: CollectionDataService,
|
||||
private el: ElementRef
|
||||
private el: ElementRef,
|
||||
public dsoNameService: DSONameService,
|
||||
) { }
|
||||
|
||||
/**
|
||||
@@ -233,8 +235,8 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy {
|
||||
mergeMap((collection: Collection) => collection.parentCommunity.pipe(
|
||||
getFirstSucceededRemoteDataPayload(),
|
||||
map((community: Community) => ({
|
||||
communities: [{ id: community.id, name: community.name }],
|
||||
collection: { id: collection.id, uuid: collection.id, name: collection.name }
|
||||
communities: [{ id: community.id, name: this.dsoNameService.getName(community) }],
|
||||
collection: { id: collection.id, uuid: collection.id, name: this.dsoNameService.getName(collection) }
|
||||
})
|
||||
))),
|
||||
reduce((acc: any, value: any) => [...acc, value], []),
|
||||
@@ -301,8 +303,8 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy {
|
||||
take(1)
|
||||
).subscribe((community: Community) => {
|
||||
this.theOnlySelectable.emit({
|
||||
communities: [{ id: community.id, name: community.name, uuid: community.id }],
|
||||
collection: { id: collection.id, uuid: collection.id, name: collection.name }
|
||||
communities: [{ id: community.id, name: this.dsoNameService.getName(community), uuid: community.id }],
|
||||
collection: { id: collection.id, uuid: collection.id, name: this.dsoNameService.getName(collection) }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user