mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
Use DSONameService to display DSpaceObjects names
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<tbody>
|
||||
<tr *ngFor="let collection of collectionsRD?.payload?.page">
|
||||
<td><input class="collection-checkbox" [ngModel]="getSelected(collection.id) | async" (change)="switch(collection.id)" type="checkbox" name="{{collection.id}}"></td>
|
||||
<td><a [routerLink]="['/collections', collection.id]">{{collection.name}}</a></td>
|
||||
<td><a [routerLink]="['/collections', collection.id]">{{ dsoNameService.getName(collection) }}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@@ -0,0 +1,3 @@
|
||||
table tr th:first-of-type, table tr td:first-of-type, {
|
||||
width: 1rem !important;
|
||||
}
|
@@ -4,10 +4,12 @@ import { ObjectSelectComponent } from '../object-select/object-select.component'
|
||||
import { isNotEmpty } from '../../empty.util';
|
||||
import { ObjectSelectService } from '../object-select.service';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-collection-select',
|
||||
templateUrl: './collection-select.component.html'
|
||||
templateUrl: './collection-select.component.html',
|
||||
styleUrls: ['./collection-select.component.scss'],
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -15,8 +17,11 @@ import { AuthorizationDataService } from '../../../core/data/feature-authorizati
|
||||
*/
|
||||
export class CollectionSelectComponent extends ObjectSelectComponent<Collection> {
|
||||
|
||||
constructor(protected objectSelectService: ObjectSelectService,
|
||||
protected authorizationService: AuthorizationDataService) {
|
||||
constructor(
|
||||
protected objectSelectService: ObjectSelectService,
|
||||
protected authorizationService: AuthorizationDataService,
|
||||
public dsoNameService: DSONameService,
|
||||
) {
|
||||
super(objectSelectService, authorizationService);
|
||||
}
|
||||
|
||||
|
@@ -22,11 +22,13 @@
|
||||
<td><input [disabled]="!(canSelect(item) | async)" class="item-checkbox" [ngModel]="getSelected(item.id) | async" (change)="switch(item.id)" type="checkbox" name="{{item.id}}"></td>
|
||||
<td *ngIf="!hideCollection">
|
||||
<span *ngVar="(item.owningCollection | async)?.payload as collection">
|
||||
<a *ngIf="collection" [routerLink]="['/collections', collection?.id]">{{collection?.name}}</a>
|
||||
<a *ngIf="collection" [routerLink]="['/collections', collection?.id]">
|
||||
{{ dsoNameService.getName(collection) }}
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
<td><span *ngIf="item.hasMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*'])">{{item.firstMetadataValue(['dc.contributor.author', 'dc.creator', 'dc.contributor.*'])}}</span></td>
|
||||
<td><a [routerLink]="[(itemPageRoutes$ | async)[item.id]]">{{item.firstMetadataValue("dc.title")}}</a></td>
|
||||
<td><a [routerLink]="[(itemPageRoutes$ | async)[item.id]]">{{ dsoNameService.getName(item) }}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@@ -8,6 +8,7 @@ import { getAllSucceededRemoteDataPayload } from '../../../core/shared/operators
|
||||
import { map } from 'rxjs/operators';
|
||||
import { getItemPageRoute } from '../../../item-page/item-page-routing-paths';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-select',
|
||||
@@ -34,8 +35,11 @@ export class ItemSelectComponent extends ObjectSelectComponent<Item> {
|
||||
[itemId: string]: string
|
||||
}>;
|
||||
|
||||
constructor(protected objectSelectService: ObjectSelectService,
|
||||
protected authorizationService: AuthorizationDataService ) {
|
||||
constructor(
|
||||
protected objectSelectService: ObjectSelectService,
|
||||
protected authorizationService: AuthorizationDataService,
|
||||
public dsoNameService: DSONameService,
|
||||
) {
|
||||
super(objectSelectService, authorizationService);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user