mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 03:53:02 +00:00
Merge branch 'fix-broken-item-mapper-pagination_contribute-7.6' into fix-broken-item-mapper-pagination_contribute-main
# Conflicts: # src/app/access-control/bulk-access/browse/bulk-access-browse.component.html # src/app/access-control/epeople-registry/epeople-registry.component.html # src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html # src/app/access-control/group-registry/group-form/members-list/members-list.component.html # src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.html # src/app/process-page/overview/process-overview.component.html # src/app/shared/object-select/collection-select/collection-select.component.html # src/app/shared/object-select/collection-select/collection-select.component.ts # src/app/shared/object-select/item-select/item-select.component.html # src/app/shared/object-select/item-select/item-select.component.ts # src/app/shared/object-select/object-select/object-select.component.ts # src/app/shared/pagination/pagination.component.ts
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { getCollectionPageRoute } from '../../../collection-page/collection-page-routing-paths';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { Collection } from '../../../core/shared/collection.model';
|
||||
import { isNotEmpty } from '../../empty.util';
|
||||
import { ObjectSelectService } from '../object-select.service';
|
||||
import { getAllSucceededRemoteDataPayload } from '../../../core/shared/operators';
|
||||
import {
|
||||
hasValueOperator,
|
||||
isNotEmpty,
|
||||
} from '../../empty.util';
|
||||
import { DSpaceObjectSelect } from '../object-select.model';
|
||||
import { ObjectSelectComponent } from '../object-select/object-select.component';
|
||||
|
||||
@Component({
|
||||
@@ -16,21 +25,29 @@ import { ObjectSelectComponent } from '../object-select/object-select.component'
|
||||
/**
|
||||
* A component used to select collections from a specific list and returning the UUIDs of the selected collections
|
||||
*/
|
||||
export class CollectionSelectComponent extends ObjectSelectComponent<Collection> {
|
||||
export class CollectionSelectComponent extends ObjectSelectComponent<Collection> implements OnInit {
|
||||
|
||||
constructor(
|
||||
protected objectSelectService: ObjectSelectService,
|
||||
protected authorizationService: AuthorizationDataService,
|
||||
public dsoNameService: DSONameService,
|
||||
) {
|
||||
super(objectSelectService, authorizationService);
|
||||
}
|
||||
/**
|
||||
* Collection of all the data that is used to display the {@link Collection} in the HTML.
|
||||
* By collecting this data here it doesn't need to be recalculated on evey change detection.
|
||||
*/
|
||||
selectCollections$: Observable<DSpaceObjectSelect<Collection>[]>;
|
||||
|
||||
ngOnInit(): void {
|
||||
super.ngOnInit();
|
||||
if (!isNotEmpty(this.confirmButton)) {
|
||||
this.confirmButton = 'collection.select.confirm';
|
||||
}
|
||||
this.selectCollections$ = this.dsoRD$.pipe(
|
||||
hasValueOperator(),
|
||||
getAllSucceededRemoteDataPayload(),
|
||||
map((collections: PaginatedList<Collection>) => collections.page.map((collection: Collection) => Object.assign(new DSpaceObjectSelect<Collection>(), {
|
||||
dso: collection,
|
||||
canSelect$: this.canSelect(collection),
|
||||
selected$: this.getSelected(collection.id),
|
||||
route: getCollectionPageRoute(collection.id),
|
||||
} as DSpaceObjectSelect<Collection>))),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user