mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fix to collection selection window not loading successfully.
In collection dropdown component, moved the return statement that returned the collection list outside the condition that checks if it's the final page
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
aria-labelledby="dropdownMenuButton"
|
aria-labelledby="dropdownMenuButton"
|
||||||
(scroll)="onScroll($event)"
|
(scroll)="onScroll($event)"
|
||||||
infiniteScroll
|
infiniteScroll
|
||||||
[infiniteScrollDistance]="5"
|
[infiniteScrollDistance]="1.5"
|
||||||
[infiniteScrollThrottle]="300"
|
[infiniteScrollThrottle]="0"
|
||||||
[infiniteScrollUpDistance]="1.5"
|
[infiniteScrollUpDistance]="1.5"
|
||||||
[fromRoot]="true"
|
[fromRoot]="true"
|
||||||
[scrollWindow]="false"
|
[scrollWindow]="false"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<button class="dropdown-item disabled" *ngIf="searchListCollection?.length == 0 && !(isLoading | async)">
|
<button class="dropdown-item disabled" *ngIf="searchListCollection?.length == 0 && !(isLoading | async)">
|
||||||
{{'submission.sections.general.no-collection' | translate}}
|
{{'submission.sections.general.no-collection' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<ng-container *ngIf="searchListCollection?.length > 0 && !(isLoading | async)">
|
<ng-container *ngIf="searchListCollection?.length > 0">
|
||||||
<button *ngFor="let listItem of searchListCollection"
|
<button *ngFor="let listItem of searchListCollection"
|
||||||
class="dropdown-item collection-item"
|
class="dropdown-item collection-item"
|
||||||
title="{{ listItem.collection.name }}"
|
title="{{ listItem.collection.name }}"
|
||||||
|
@@ -223,8 +223,9 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy {
|
|||||||
switchMap((collectionsRD: RemoteData<PaginatedList<Collection>>) => {
|
switchMap((collectionsRD: RemoteData<PaginatedList<Collection>>) => {
|
||||||
this.searchComplete.emit();
|
this.searchComplete.emit();
|
||||||
if (collectionsRD.hasSucceeded && collectionsRD.payload.totalElements > 0) {
|
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.hasNextPage = false;
|
||||||
|
}
|
||||||
this.emitSelectionEvents(collectionsRD);
|
this.emitSelectionEvents(collectionsRD);
|
||||||
return observableFrom(collectionsRD.payload.page).pipe(
|
return observableFrom(collectionsRD.payload.page).pipe(
|
||||||
mergeMap((collection: Collection) => collection.parentCommunity.pipe(
|
mergeMap((collection: Collection) => collection.parentCommunity.pipe(
|
||||||
@@ -236,7 +237,6 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy {
|
|||||||
))),
|
))),
|
||||||
reduce((acc: any, value: any) => [...acc, value], []),
|
reduce((acc: any, value: any) => [...acc, value], []),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.hasNextPage = false;
|
this.hasNextPage = false;
|
||||||
return observableOf([]);
|
return observableOf([]);
|
||||||
|
Reference in New Issue
Block a user