@@ -90,6 +90,12 @@ export class EntityDropdownComponent implements OnInit, OnDestroy {
9090 */
9191 @Input ( ) isSubmission : boolean ;
9292
93+ /**
94+ * TRUE if the main operation is "Import metadata from an external source", FALSE otherwise.
95+ * Used to determine which list type to populate.
96+ */
97+ @Input ( ) isImportFromExternalSource : boolean ;
98+
9399 /**
94100 * The entity to output to the parent component
95101 */
@@ -192,23 +198,26 @@ export class EntityDropdownComponent implements OnInit, OnDestroy {
192198 */
193199 public populateEntityList ( page : number ) {
194200 this . isLoadingList . next ( true ) ;
195- let searchListEntity$ ;
196- if ( this . isSubmission ) {
201+ let searchListEntity$ : Observable < RemoteData < PaginatedList < ItemType > > > ;
202+ if ( this . isSubmission || this . isImportFromExternalSource ) {
197203 // Set the pagination info
198204 const findOptions : FindListOptions = {
199205 elementsPerPage : 10 ,
200206 currentPage : page ,
201207 } ;
202- searchListEntity$ =
203- this . entityTypeService . getAllAuthorizedRelationshipType ( findOptions )
204- . pipe (
205- getFirstSucceededRemoteWithNotEmptyData ( ) ,
206- tap ( entityType => {
207- if ( ( this . searchListEntity . length + findOptions . elementsPerPage ) >= entityType . payload . totalElements ) {
208- this . hasNextPage = false ;
209- }
210- } ) ,
211- ) ;
208+
209+ searchListEntity$ = this . isSubmission ?
210+ this . entityTypeService . getAllAuthorizedRelationshipType ( findOptions ) :
211+ this . entityTypeService . getAllAuthorizedRelationshipTypeImport ( findOptions ) ;
212+
213+ searchListEntity$ = searchListEntity$ . pipe (
214+ getFirstSucceededRemoteWithNotEmptyData ( ) ,
215+ tap ( entityType => {
216+ if ( ( this . searchListEntity . length + findOptions . elementsPerPage ) >= entityType . payload . totalElements ) {
217+ this . hasNextPage = false ;
218+ }
219+ } ) ,
220+ ) ;
212221 } else {
213222 searchListEntity$ =
214223 this . itemExportFormatService . byEntityTypeAndMolteplicity ( null , ItemExportFormatMolteplicity . MULTIPLE )
0 commit comments