diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-bulk-import/my-dspace-new-bulk-import.component.html b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-bulk-import/my-dspace-new-bulk-import.component.html index 08bd9cb0359..8e55a4026e3 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-bulk-import/my-dspace-new-bulk-import.component.html +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-bulk-import/my-dspace-new-bulk-import.component.html @@ -22,6 +22,6 @@ class="dropdown-menu" id="entityControlsDropdownMenu" aria-labelledby="dropdownSubmission"> - + diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.html b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.html index 7db6db9a8da..417f50bfca6 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.html +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.html @@ -20,6 +20,6 @@ class="dropdown-menu" id="importControlsDropdownMenu" aria-labelledby="dropdownImport"> - + diff --git a/src/app/shared/entity-dropdown/entity-dropdown.component.ts b/src/app/shared/entity-dropdown/entity-dropdown.component.ts index dcab4cb717e..5a986df9616 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.ts @@ -1,7 +1,6 @@ import { ChangeDetectorRef, Component, - ElementRef, EventEmitter, HostListener, Input, @@ -58,6 +57,12 @@ export class EntityDropdownComponent implements OnInit, OnDestroy { */ @Input() isSubmission: boolean; + /** + * TRUE if the parent operation is a 'Import metadata from an external source' operation, FALSE otherwise (eg.: is an 'Export Item' operation). + */ + @Input() isExternalImport = false; + + /** * The entity to output to the parent component */ @@ -90,13 +95,11 @@ export class EntityDropdownComponent implements OnInit, OnDestroy { * @param {ChangeDetectorRef} changeDetectorRef * @param {EntityTypeDataService} entityTypeService * @param {ItemExportFormatService} itemExportFormatService - * @param {ElementRef} el */ constructor( private changeDetectorRef: ChangeDetectorRef, private entityTypeService: EntityTypeDataService, private itemExportFormatService: ItemExportFormatService, - private el: ElementRef ) { } /** @@ -175,7 +178,21 @@ export class EntityDropdownComponent implements OnInit, OnDestroy { } }) ); - } else { + } else if (this.isExternalImport) { + const findOptions: FindListOptions = { + elementsPerPage: 10, + currentPage: page + }; + searchListEntity$ = this.entityTypeService.getAllAuthorizedRelationshipTypeImport(findOptions) + .pipe( + getFirstSucceededRemoteWithNotEmptyData(), + tap(entityType => { + if ((this.searchListEntity.length + findOptions.elementsPerPage) >= entityType.payload.totalElements) { + this.hasNextPage = false; + } + }) + ); + } else { searchListEntity$ = this.itemExportFormatService.byEntityTypeAndMolteplicity(null, ItemExportFormatMolteplicity.MULTIPLE) .pipe(