mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
84367: Use DSONameService for ds-dso-selector names
This commit is contained in:
@@ -14,6 +14,7 @@ import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { hasValue } from '../../../empty.util';
|
||||
import { NotificationsService } from '../../../notifications/notifications.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-authorized-collection-selector',
|
||||
@@ -24,11 +25,14 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
* Component rendering a list of collections to select from
|
||||
*/
|
||||
export class AuthorizedCollectionSelectorComponent extends DSOSelectorComponent {
|
||||
constructor(protected searchService: SearchService,
|
||||
protected collectionDataService: CollectionDataService,
|
||||
protected notifcationsService: NotificationsService,
|
||||
protected translate: TranslateService) {
|
||||
super(searchService, notifcationsService, translate);
|
||||
constructor(
|
||||
protected searchService: SearchService,
|
||||
protected collectionDataService: CollectionDataService,
|
||||
protected notifcationsService: NotificationsService,
|
||||
protected translate: TranslateService,
|
||||
protected dsoNameService: DSONameService,
|
||||
) {
|
||||
super(searchService, notifcationsService, translate, dsoNameService);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -22,7 +22,7 @@
|
||||
<button *ngFor="let listEntry of (listEntries$ | async)"
|
||||
class="list-group-item list-group-item-action border-0 list-entry"
|
||||
[ngClass]="{'bg-primary': listEntry.indexableObject.id === currentDSOId}"
|
||||
title="{{ listEntry.indexableObject.name }}"
|
||||
title="{{ getName(listEntry) }}"
|
||||
dsHoverClass="ds-hover"
|
||||
(click)="onSelect.emit(listEntry.indexableObject)" #listEntryElement>
|
||||
<ds-listable-object-component-loader [object]="listEntry" [viewMode]="viewMode"
|
||||
|
@@ -34,6 +34,7 @@ import { SearchResult } from '../../search/search-result.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { NotificationsService } from '../../notifications/notifications.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-dso-selector',
|
||||
@@ -126,9 +127,12 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
public subs: Subscription[] = [];
|
||||
|
||||
constructor(protected searchService: SearchService,
|
||||
protected notifcationsService: NotificationsService,
|
||||
protected translate: TranslateService) {
|
||||
constructor(
|
||||
protected searchService: SearchService,
|
||||
protected notifcationsService: NotificationsService,
|
||||
protected translate: TranslateService,
|
||||
protected dsoNameService: DSONameService,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -257,4 +261,8 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
|
||||
ngOnDestroy(): void {
|
||||
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
|
||||
}
|
||||
|
||||
getName(searchResult: SearchResult<DSpaceObject>): string {
|
||||
return this.dsoNameService.getName(searchResult.indexableObject);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user