workaround for search settings reset (#466)

This commit is contained in:
Denys Vuika
2018-06-27 21:30:05 +01:00
committed by GitHub
parent 04622399c6
commit 959d122ed6

View File

@@ -67,6 +67,7 @@ export class SearchComponent extends PageComponent implements OnInit {
super.ngOnInit();
this.sorting = this.getSorting();
this.resetSettings();
this.subscriptions.push(
this.queryBuilder.updated.subscribe(() => {
@@ -94,6 +95,20 @@ export class SearchComponent extends PageComponent implements OnInit {
}
}
// TODO: workaround for ADF 2.4.0 bug
private resetSettings() {
this.queryBuilder.categories
.map(category => category.component)
.filter(component => component.selector === 'check-list')
.map(component => component.settings.options || [])
.reduce((acc, value) => acc.concat(value), [])
.forEach(value => {
if (value.hasOwnProperty('checked')) {
value.checked = false;
}
});
}
private formatSearchQuery(userInput: string) {
if (!userInput) {
return null;