[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; pageSize = 5;
isActive = false; isActive = false;
enableChangeUpdate = true; enableChangeUpdate = true;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>(); displayValue$: Subject<string> = new Subject<string>();
constructor(private translationService: TranslationService) { constructor(private translationService: TranslationService) {
@@ -142,7 +143,9 @@ export class SearchCheckListComponent implements SearchWidget, OnInit {
if (this.id && this.context) { if (this.id && this.context) {
this.context.queryFragments[this.id] = query; this.context.queryFragments[this.id] = query;
this.updateDisplayValue(); this.updateDisplayValue();
this.context.update(); if(!this.disableUpdateOnSubmit) {
this.context.update();
}
} }
} }
} }
@@ -70,6 +70,7 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit, OnDestroy
isActive = false; isActive = false;
startValue: any; startValue: any;
enableChangeUpdate: boolean; enableChangeUpdate: boolean;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>(); displayValue$: Subject<string> = new Subject<string>();
private onDestroy$ = new Subject<boolean>(); 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.context.queryFragments[this.id] = `${this.settings.field}:['${start}' TO '${end}']`;
this.updateDisplayValue(); this.updateDisplayValue();
this.context.update(); if(!this.disableUpdateOnSubmit) {
this.context.update();
}
} }
} }
@@ -65,6 +65,7 @@ export class SearchDatetimeRangeComponent implements SearchWidget, OnInit, OnDes
isActive = false; isActive = false;
startValue: any; startValue: any;
enableChangeUpdate: boolean; enableChangeUpdate: boolean;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>(); displayValue$: Subject<string> = new Subject<string>();
private onDestroy$ = new Subject<boolean>(); 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.context.queryFragments[this.id] = `${this.settings.field}:['${start}' TO '${end}']`;
this.updateDisplayValue(); this.updateDisplayValue();
this.context.update(); if(!this.disableUpdateOnSubmit) {
this.context.update();
}
} }
} }
@@ -41,6 +41,7 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
id: string; id: string;
settings?: SearchWidgetSettings; settings?: SearchWidgetSettings;
context?: SearchQueryBuilderService; context?: SearchQueryBuilderService;
disableUpdateOnSubmit: boolean;
field: string; field: string;
format = '[{FROM} TO {TO}]'; format = '[{FROM} TO {TO}]';
@@ -98,7 +99,9 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
const value = this.formatString(this.format, map); const value = this.formatString(this.format, map);
this.context.queryFragments[this.id] = `${this.field}:${value}`; 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; isActive = false;
startValue: any; startValue: any;
enableChangeUpdate: boolean; enableChangeUpdate: boolean;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>(); displayValue$: Subject<string> = new Subject<string>();
constructor() { constructor() {
@@ -97,7 +98,9 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
submitValues() { submitValues() {
this.setValue(this.value); this.setValue(this.value);
this.updateDisplayValue(); this.updateDisplayValue();
this.context.update(); if(!this.disableUpdateOnSubmit) {
this.context.update();
}
} }
hasValidValue() { hasValidValue() {
@@ -41,6 +41,7 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
max: number; max: number;
thumbLabel = false; thumbLabel = false;
enableChangeUpdate: boolean; enableChangeUpdate: boolean;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>(); displayValue$: Subject<string> = new Subject<string>();
/** The numeric value represented by the slider. */ /** The numeric value represented by the slider. */
@@ -90,7 +91,9 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
} }
submitValues() { submitValues() {
this.updateQuery(this.value); if(!this.disableUpdateOnSubmit) {
this.updateQuery(this.value);
}
} }
hasValidValue() { hasValidValue() {
@@ -40,6 +40,7 @@ export class SearchTextComponent implements SearchWidget, OnInit {
startValue: string; startValue: string;
isActive = false; isActive = false;
enableChangeUpdate = true; enableChangeUpdate = true;
disableUpdateOnSubmit: boolean;
displayValue$: Subject<string> = new Subject<string>(); displayValue$: Subject<string> = new Subject<string>();
ngOnInit() { ngOnInit() {
@@ -91,7 +92,9 @@ export class SearchTextComponent implements SearchWidget, OnInit {
} }
submitValues() { submitValues() {
this.updateQuery(this.value); if(!this.disableUpdateOnSubmit) {
this.updateQuery(this.value);
}
} }
hasValidValue() { hasValidValue() {