Use DSONameService to display DSpaceObjects names

This commit is contained in:
Alexandre Vryghem
2023-02-26 17:10:25 +01:00
parent ca864379c8
commit 2513f91a1a
160 changed files with 608 additions and 288 deletions

View File

@@ -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) }
});
});
}