mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3217] reset previous search settings (#3490)
* reset previous search settings * unit test * remove fit
This commit is contained in:
committed by
Eugenio Romano
parent
1b049f468e
commit
acf73fba54
@@ -57,13 +57,24 @@ export class SearchQueryBuilderService {
|
||||
|
||||
constructor(appConfig: AppConfigService, private alfrescoApiService: AlfrescoApiService) {
|
||||
this.config = appConfig.get<SearchConfiguration>('search');
|
||||
this.resetToDefaults();
|
||||
}
|
||||
|
||||
resetToDefaults() {
|
||||
if (this.config) {
|
||||
this.categories = (this.config.categories || []).filter(category => category.enabled);
|
||||
this.filterQueries = this.config.filterQueries || [];
|
||||
this.categories =
|
||||
(this.config.categories || [])
|
||||
.filter(category => category.enabled)
|
||||
.map(category => { return { ...category }; });
|
||||
|
||||
this.filterQueries =
|
||||
(this.config.filterQueries || [])
|
||||
.map(query => { return {...query}; });
|
||||
|
||||
if (this.config.sorting) {
|
||||
this.sorting = this.config.sorting.defaults || [];
|
||||
this.sorting =
|
||||
(this.config.sorting.defaults || [])
|
||||
.map(sorting => { return { ...sorting }; });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user