@@ -43,6 +43,7 @@ import {
4343 SortDirection ,
4444 SortOptions ,
4545} from '../../../core/cache/models/sort-options.model' ;
46+ import { FindListOptions } from '../../../core/data/find-list-options.model' ;
4647import { RegistryService } from '../../../core/registry/registry.service' ;
4748import {
4849 getAllSucceededRemoteData ,
@@ -153,7 +154,10 @@ export class MetadataFieldSelectorComponent implements OnInit, OnDestroy, AfterV
153154 /**
154155 * Default page option for this feature
155156 */
156- pageOptions = { elementsPerPage : 20 , sort : new SortOptions ( 'fieldName' , SortDirection . ASC ) } ;
157+ pageOptions : FindListOptions = {
158+ elementsPerPage : 20 ,
159+ sort : new SortOptions ( 'fieldName' , SortDirection . ASC ) ,
160+ } ;
157161
158162
159163 constructor ( protected registryService : RegistryService ,
@@ -209,7 +213,7 @@ export class MetadataFieldSelectorComponent implements OnInit, OnDestroy, AfterV
209213 * Upon subscribing to the returned observable, the showInvalid flag is updated accordingly to show the feedback under the input
210214 */
211215 validate ( ) : Observable < boolean > {
212- return this . registryService . queryMetadataFields ( this . mdField , null , true , false , followLink ( 'schema' ) ) . pipe (
216+ return this . registryService . queryMetadataFields ( this . mdField , Object . assign ( { } , this . pageOptions , { currentPage : 1 } ) , true , false , followLink ( 'schema' ) ) . pipe (
213217 getFirstCompletedRemoteData ( ) ,
214218 switchMap ( ( rd ) => {
215219 if ( rd . hasSucceeded ) {
@@ -263,9 +267,7 @@ export class MetadataFieldSelectorComponent implements OnInit, OnDestroy, AfterV
263267 * @param useCache Whether or not to use the cache
264268 */
265269 search ( query : string , page : number , useCache : boolean = true ) {
266- return this . registryService . queryMetadataFields ( query , {
267- elementsPerPage : this . pageOptions . elementsPerPage , sort : this . pageOptions . sort ,
268- currentPage : page } , useCache , false , followLink ( 'schema' ) )
270+ return this . registryService . queryMetadataFields ( query , Object . assign ( { } , this . pageOptions , { currentPage : page } ) , useCache , false , followLink ( 'schema' ) )
269271 . pipe (
270272 getAllSucceededRemoteData ( ) ,
271273 metadataFieldsToString ( ) ,
0 commit comments