@@ -26,6 +26,7 @@ import { of } from 'rxjs/internal/observable/of';
2626import { NotificationsService } from '../../../shared/notifications/notifications.service' ;
2727import { TranslateService } from '@ngx-translate/core' ;
2828import { SortDirection , SortOptions } from '../../../core/cache/models/sort-options.model' ;
29+ import { FindListOptions } from '../../../core/data/find-list-options.model' ;
2930
3031@Component ( {
3132 selector : 'ds-metadata-field-selector' ,
@@ -97,6 +98,11 @@ export class MetadataFieldSelectorComponent implements OnInit, OnDestroy, AfterV
9798 */
9899 showInvalid = false ;
99100
101+ searchOptions : FindListOptions = {
102+ elementsPerPage : 10 ,
103+ sort : new SortOptions ( 'fieldName' , SortDirection . ASC ) ,
104+ } ;
105+
100106 /**
101107 * Subscriptions to unsubscribe from on destroy
102108 */
@@ -129,7 +135,7 @@ export class MetadataFieldSelectorComponent implements OnInit, OnDestroy, AfterV
129135 switchMap ( ( query : string ) => {
130136 this . showInvalid = false ;
131137 if ( query !== null ) {
132- return this . registryService . queryMetadataFields ( query , { elementsPerPage : 10 , sort : new SortOptions ( 'fieldName' , SortDirection . ASC ) } , true , false , followLink ( 'schema' ) ) . pipe (
138+ return this . registryService . queryMetadataFields ( query , this . searchOptions , true , false , followLink ( 'schema' ) ) . pipe (
133139 getAllSucceededRemoteData ( ) ,
134140 metadataFieldsToString ( ) ,
135141 ) ;
@@ -154,7 +160,7 @@ export class MetadataFieldSelectorComponent implements OnInit, OnDestroy, AfterV
154160 * Upon subscribing to the returned observable, the showInvalid flag is updated accordingly to show the feedback under the input
155161 */
156162 validate ( ) : Observable < boolean > {
157- return this . registryService . queryMetadataFields ( this . mdField , null , true , false , followLink ( 'schema' ) ) . pipe (
163+ return this . registryService . queryMetadataFields ( this . mdField , this . searchOptions , true , false , followLink ( 'schema' ) ) . pipe (
158164 getFirstCompletedRemoteData ( ) ,
159165 switchMap ( ( rd ) => {
160166 if ( rd . hasSucceeded ) {
0 commit comments