mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge pull request #1459 from CICBA/fix-collection-load
Fix to collection selection window not loading successfully.
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
aria-labelledby="dropdownMenuButton"
|
||||
(scroll)="onScroll($event)"
|
||||
infiniteScroll
|
||||
[infiniteScrollDistance]="5"
|
||||
[infiniteScrollThrottle]="300"
|
||||
[infiniteScrollDistance]="1.5"
|
||||
[infiniteScrollThrottle]="0"
|
||||
[infiniteScrollUpDistance]="1.5"
|
||||
[fromRoot]="true"
|
||||
[scrollWindow]="false"
|
||||
@@ -21,7 +21,7 @@
|
||||
<button class="dropdown-item disabled" *ngIf="searchListCollection?.length == 0 && !(isLoading | async)">
|
||||
{{'submission.sections.general.no-collection' | translate}}
|
||||
</button>
|
||||
<ng-container *ngIf="searchListCollection?.length > 0 && !(isLoading | async)">
|
||||
<ng-container *ngIf="searchListCollection?.length > 0">
|
||||
<button *ngFor="let listItem of searchListCollection"
|
||||
class="dropdown-item collection-item"
|
||||
title="{{ listItem.collection.name }}"
|
||||
|
@@ -223,20 +223,20 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy {
|
||||
switchMap((collectionsRD: RemoteData<PaginatedList<Collection>>) => {
|
||||
this.searchComplete.emit();
|
||||
if (collectionsRD.hasSucceeded && collectionsRD.payload.totalElements > 0) {
|
||||
if ( (this.searchListCollection.length + findOptions.elementsPerPage) >= collectionsRD.payload.totalElements ) {
|
||||
if (this.searchListCollection.length >= collectionsRD.payload.totalElements) {
|
||||
this.hasNextPage = false;
|
||||
this.emitSelectionEvents(collectionsRD);
|
||||
return observableFrom(collectionsRD.payload.page).pipe(
|
||||
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 }
|
||||
})
|
||||
))),
|
||||
reduce((acc: any, value: any) => [...acc, value], []),
|
||||
);
|
||||
}
|
||||
this.emitSelectionEvents(collectionsRD);
|
||||
return observableFrom(collectionsRD.payload.page).pipe(
|
||||
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 }
|
||||
})
|
||||
))),
|
||||
reduce((acc: any, value: any) => [...acc, value], []),
|
||||
);
|
||||
} else {
|
||||
this.hasNextPage = false;
|
||||
return observableOf([]);
|
||||
|
Reference in New Issue
Block a user