[ACA-3507] [ACA-3523] Fix Filters (#5821)

* fix search one letter
fix navigation
add new property search text prefix and suffix

* fix unit test

* fix unit test

* fix failing test
This commit is contained in:
Eugenio Romano
2020-06-29 17:27:52 +01:00
committed by GitHub
parent 0183f9e7f7
commit 5180493aa8
14 changed files with 102 additions and 64 deletions

View File

@@ -46,6 +46,7 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
context: SearchQueryBuilderService;
options: SearchFilterList<SearchRadioOption>;
pageSize = 5;
isActive = false;
constructor() {
this.options = new SearchFilterList<SearchRadioOption>();
@@ -71,6 +72,8 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
private getSelectedValue(): string {
const options: any[] = this.settings['options'] || [];
if (options && options.length > 0) {
this.isActive = true;
let selected = options.find((opt) => opt.default);
if (!selected) {
selected = options[0];
@@ -91,6 +94,8 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
}
reset() {
this.isActive = false;
const initialValue = this.getSelectedValue();
if (initialValue !== null) {
this.setValue(initialValue);