@@ -59,6 +59,12 @@ export class EntityDropdownComponent implements OnInit, OnDestroy {
5959 */
6060 @Input ( ) isSubmission : boolean ;
6161
62+ /**
63+ * TRUE if the main operation is "Import metadata from an external source", FALSE otherwise.
64+ * Used to determine which list type to populate.
65+ */
66+ @Input ( ) isImportFromExternalSource : boolean ;
67+
6268 /**
6369 * The entity to output to the parent component
6470 */
@@ -161,23 +167,26 @@ export class EntityDropdownComponent implements OnInit, OnDestroy {
161167 */
162168 public populateEntityList ( page : number ) {
163169 this . isLoadingList . next ( true ) ;
164- let searchListEntity$ ;
165- if ( this . isSubmission ) {
170+ let searchListEntity$ : Observable < RemoteData < PaginatedList < ItemType > > > ;
171+ if ( this . isSubmission || this . isImportFromExternalSource ) {
166172 // Set the pagination info
167173 const findOptions : FindListOptions = {
168174 elementsPerPage : 10 ,
169175 currentPage : page
170176 } ;
171- searchListEntity$ =
172- this . entityTypeService . getAllAuthorizedRelationshipType ( findOptions )
173- . pipe (
174- getFirstSucceededRemoteWithNotEmptyData ( ) ,
175- tap ( entityType => {
176- if ( ( this . searchListEntity . length + findOptions . elementsPerPage ) >= entityType . payload . totalElements ) {
177- this . hasNextPage = false ;
178- }
177+
178+ searchListEntity$ = this . isSubmission ?
179+ this . entityTypeService . getAllAuthorizedRelationshipType ( findOptions ) :
180+ this . entityTypeService . getAllAuthorizedRelationshipTypeImport ( findOptions ) ;
181+
182+ searchListEntity$ = searchListEntity$ . pipe (
183+ getFirstSucceededRemoteWithNotEmptyData ( ) ,
184+ tap ( entityType => {
185+ if ( ( this . searchListEntity . length + findOptions . elementsPerPage ) >= entityType . payload . totalElements ) {
186+ this . hasNextPage = false ;
187+ }
179188 } )
180- ) ;
189+ ) ;
181190 } else {
182191 searchListEntity$ =
183192 this . itemExportFormatService . byEntityTypeAndMolteplicity ( null , ItemExportFormatMolteplicity . MULTIPLE )
0 commit comments