@@ -404,14 +404,6 @@ export class RecordSearchComponent implements OnInit, OnChanges, OnDestroy {
404
404
}
405
405
)
406
406
) ;
407
- // Add default filters on aggregations filters if not exist.
408
- if ( this . _config && this . _config . defaultSearchInputFilters ) {
409
- this . _config . defaultSearchInputFilters . map ( ( filter : { key : string , values : string [ ] } ) => {
410
- if ( ! this . aggregationsFilters . some ( ( e : any ) => e . key === filter . key ) ) {
411
- this . aggregationsFilters . push ( filter ) ;
412
- }
413
- } ) ;
414
- }
415
407
}
416
408
417
409
/**
@@ -871,6 +863,7 @@ export class RecordSearchComponent implements OnInit, OnChanges, OnDestroy {
871
863
* @param type Type of resource
872
864
*/
873
865
private _loadConfigurationForType ( type : string ) {
866
+ const q = this . _buildQueryString ( ) ;
874
867
this . _config = this . recordUiService . getResourceConfig ( type ) ;
875
868
this . recordUiService . canAddRecord$ ( type ) . subscribe ( ( result : ActionStatus ) => {
876
869
this . addStatus = result ;
@@ -899,8 +892,8 @@ export class RecordSearchComponent implements OnInit, OnChanges, OnDestroy {
899
892
// load export options
900
893
this . exportOptions = this . _exportFormats ( ) ;
901
894
902
- // Update filters with default search filters
903
- if ( this . _config . defaultSearchInputFilters ) {
895
+ // Update filters with default search filters only if the q parameter is empty
896
+ if ( ( q === null || q . trim ( ) . length === 0 ) && this . _config . defaultSearchInputFilters ) {
904
897
this . _config . defaultSearchInputFilters . forEach ( ( filter : { key : string , values : any [ ] } ) => {
905
898
this . recordSearchService . updateAggregationFilter ( filter . key , filter . values ) ;
906
899
} ) ;
0 commit comments