[ACS-4985] Resolved minor issue where the reset method would still trigger multiple api calls when used with the TabbedComponent

This commit is contained in:
swapnil.verma
2023-07-27 11:14:48 +05:30
committed by Jatin_Chugh
parent 9b38a8b48b
commit 2ae8b4b510
8 changed files with 23 additions and 11 deletions
@@ -95,7 +95,9 @@ export class SearchCheckListComponent implements SearchWidget, OnInit {
this.clearOptions();
if (this.id && this.context) {
this.updateDisplayValue();
this.context.update();
if (!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
@@ -68,7 +68,6 @@ export class SearchDateRangeAdvancedComponent implements SearchWidget, OnInit, O
DateRangeType = DateRangeType;
InLastDateType = InLastDateType;
private enableChangeUpdate: boolean;
private datePickerFormat: string;
private onDestroy$ = new Subject<void>();
@@ -87,7 +86,6 @@ export class SearchDateRangeAdvancedComponent implements SearchWidget, OnInit, O
this.maxDate = moment(this.settings.maxDate).endOf('day');
}
}
this.enableChangeUpdate = this.settings?.allowUpdateOnChange ?? true;
this.userPreferencesService
.select(UserPreferenceValues.Locale)
@@ -164,7 +162,7 @@ export class SearchDateRangeAdvancedComponent implements SearchWidget, OnInit, O
if (this.id && this.context) {
this.context.queryFragments[this.id] = '';
if (this.enableChangeUpdate) {
if (!this.disableUpdateOnSubmit) {
this.updateQuery();
}
}
@@ -217,7 +217,9 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit, OnDestroy
private updateQuery() {
if (this.id && this.context) {
this.updateDisplayValue();
this.context.update();
if (!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
@@ -205,7 +205,9 @@ export class SearchDatetimeRangeComponent implements SearchWidget, OnInit, OnDes
private updateQuery() {
if (this.id && this.context) {
this.updateDisplayValue();
this.context.update();
if (!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
@@ -161,8 +161,10 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
reset() {
this.clear();
if (this.id && this.context) {
this.context.update();
if (!this.disableUpdateOnSubmit) {
if (this.id && this.context) {
this.context.update();
}
}
}
}
@@ -147,7 +147,9 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
if (initialValue !== null) {
this.setValue(initialValue);
this.updateDisplayValue();
this.context.update();
if (!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
}
@@ -117,7 +117,9 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
} else {
this.context.queryFragments[this.id] = `${this.settings.field}:[0 TO ${value}]`;
}
this.context.update();
if (!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}
@@ -87,7 +87,9 @@ export class SearchTextComponent implements SearchWidget, OnInit {
this.displayValue$.next(value);
if (this.context && this.settings && this.settings.field) {
this.context.queryFragments[this.id] = value ? `${this.settings.field}:'${this.getSearchPrefix()}${value}${this.getSearchSuffix()}'` : '';
this.context.update();
if (!this.disableUpdateOnSubmit) {
this.context.update();
}
}
}