[ACS-4985] Added compatibility of all search filters/facets with SearchFilterTabbedComponent

This commit is contained in:
swapnil.verma
2023-07-27 11:14:48 +05:30
committed by Jatin_Chugh
parent df1801dd44
commit 0bb2e00956
7 changed files with 28 additions and 7 deletions
@@ -48,6 +48,7 @@ export class SearchCheckListComponent implements SearchWidget, OnInit {
pageSize = 5;
isActive = false;
enableChangeUpdate = true;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>();
constructor(private translationService: TranslationService) {
@@ -142,7 +143,9 @@ export class SearchCheckListComponent implements SearchWidget, OnInit {
if (this.id && this.context) {
this.context.queryFragments[this.id] = query;
this.updateDisplayValue();
this.context.update();
if(!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
}
@@ -70,6 +70,7 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit, OnDestroy
isActive = false;
startValue: any;
enableChangeUpdate: boolean;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>();
private onDestroy$ = new Subject<boolean>();
@@ -151,7 +152,9 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit, OnDestroy
this.context.queryFragments[this.id] = `${this.settings.field}:['${start}' TO '${end}']`;
this.updateDisplayValue();
this.context.update();
if(!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
@@ -65,6 +65,7 @@ export class SearchDatetimeRangeComponent implements SearchWidget, OnInit, OnDes
isActive = false;
startValue: any;
enableChangeUpdate: boolean;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>();
private onDestroy$ = new Subject<boolean>();
@@ -138,7 +139,9 @@ export class SearchDatetimeRangeComponent implements SearchWidget, OnInit, OnDes
this.context.queryFragments[this.id] = `${this.settings.field}:['${start}' TO '${end}']`;
this.updateDisplayValue();
this.context.update();
if(!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
@@ -41,6 +41,7 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
id: string;
settings?: SearchWidgetSettings;
context?: SearchQueryBuilderService;
disableUpdateOnSubmit: boolean;
field: string;
format = '[{FROM} TO {TO}]';
@@ -98,7 +99,9 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
const value = this.formatString(this.format, map);
this.context.queryFragments[this.id] = `${this.field}:${value}`;
this.context.update();
if (!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
@@ -50,6 +50,7 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
isActive = false;
startValue: any;
enableChangeUpdate: boolean;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>();
constructor() {
@@ -97,7 +98,9 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
submitValues() {
this.setValue(this.value);
this.updateDisplayValue();
this.context.update();
if(!this.disableUpdateOnSubmit) {
this.context.update();
}
}
hasValidValue() {
@@ -41,6 +41,7 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
max: number;
thumbLabel = false;
enableChangeUpdate: boolean;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>();
/** The numeric value represented by the slider. */
@@ -90,7 +91,9 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
}
submitValues() {
this.updateQuery(this.value);
if(!this.disableUpdateOnSubmit) {
this.updateQuery(this.value);
}
}
hasValidValue() {
@@ -40,6 +40,7 @@ export class SearchTextComponent implements SearchWidget, OnInit {
startValue: string;
isActive = false;
enableChangeUpdate = true;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>();
ngOnInit() {
@@ -91,7 +92,9 @@ export class SearchTextComponent implements SearchWidget, OnInit {
}
submitValues() {
this.updateQuery(this.value);
if(!this.disableUpdateOnSubmit) {
this.updateQuery(this.value);
}
}
hasValidValue() {