mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[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:
committed by
Jatin_Chugh
parent
9b38a8b48b
commit
2ae8b4b510
+2
@@ -95,9 +95,11 @@ export class SearchCheckListComponent implements SearchWidget, OnInit {
|
|||||||
this.clearOptions();
|
this.clearOptions();
|
||||||
if (this.id && this.context) {
|
if (this.id && this.context) {
|
||||||
this.updateDisplayValue();
|
this.updateDisplayValue();
|
||||||
|
if (!this.disableUpdateOnSubmit) {
|
||||||
this.context.update();
|
this.context.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateDisplayValue(): void {
|
updateDisplayValue(): void {
|
||||||
const displayValue = this.options.items
|
const displayValue = this.options.items
|
||||||
|
|||||||
+1
-3
@@ -68,7 +68,6 @@ export class SearchDateRangeAdvancedComponent implements SearchWidget, OnInit, O
|
|||||||
DateRangeType = DateRangeType;
|
DateRangeType = DateRangeType;
|
||||||
InLastDateType = InLastDateType;
|
InLastDateType = InLastDateType;
|
||||||
|
|
||||||
private enableChangeUpdate: boolean;
|
|
||||||
private datePickerFormat: string;
|
private datePickerFormat: string;
|
||||||
|
|
||||||
private onDestroy$ = new Subject<void>();
|
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.maxDate = moment(this.settings.maxDate).endOf('day');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.enableChangeUpdate = this.settings?.allowUpdateOnChange ?? true;
|
|
||||||
|
|
||||||
this.userPreferencesService
|
this.userPreferencesService
|
||||||
.select(UserPreferenceValues.Locale)
|
.select(UserPreferenceValues.Locale)
|
||||||
@@ -164,7 +162,7 @@ export class SearchDateRangeAdvancedComponent implements SearchWidget, OnInit, O
|
|||||||
|
|
||||||
if (this.id && this.context) {
|
if (this.id && this.context) {
|
||||||
this.context.queryFragments[this.id] = '';
|
this.context.queryFragments[this.id] = '';
|
||||||
if (this.enableChangeUpdate) {
|
if (!this.disableUpdateOnSubmit) {
|
||||||
this.updateQuery();
|
this.updateQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -217,9 +217,11 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit, OnDestroy
|
|||||||
private updateQuery() {
|
private updateQuery() {
|
||||||
if (this.id && this.context) {
|
if (this.id && this.context) {
|
||||||
this.updateDisplayValue();
|
this.updateDisplayValue();
|
||||||
|
if (!this.disableUpdateOnSubmit) {
|
||||||
this.context.update();
|
this.context.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onChangedHandler(event: any, formControl: UntypedFormControl) {
|
onChangedHandler(event: any, formControl: UntypedFormControl) {
|
||||||
|
|
||||||
|
|||||||
+2
@@ -205,9 +205,11 @@ export class SearchDatetimeRangeComponent implements SearchWidget, OnInit, OnDes
|
|||||||
private updateQuery() {
|
private updateQuery() {
|
||||||
if (this.id && this.context) {
|
if (this.id && this.context) {
|
||||||
this.updateDisplayValue();
|
this.updateDisplayValue();
|
||||||
|
if (!this.disableUpdateOnSubmit) {
|
||||||
this.context.update();
|
this.context.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onChangedHandler(event: any, formControl: UntypedFormControl) {
|
onChangedHandler(event: any, formControl: UntypedFormControl) {
|
||||||
|
|
||||||
|
|||||||
+2
@@ -161,8 +161,10 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
|
|||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.clear();
|
this.clear();
|
||||||
|
if (!this.disableUpdateOnSubmit) {
|
||||||
if (this.id && this.context) {
|
if (this.id && this.context) {
|
||||||
this.context.update();
|
this.context.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,9 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
|
|||||||
if (initialValue !== null) {
|
if (initialValue !== null) {
|
||||||
this.setValue(initialValue);
|
this.setValue(initialValue);
|
||||||
this.updateDisplayValue();
|
this.updateDisplayValue();
|
||||||
|
if (!this.disableUpdateOnSubmit) {
|
||||||
this.context.update();
|
this.context.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -117,8 +117,10 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
|
|||||||
} else {
|
} else {
|
||||||
this.context.queryFragments[this.id] = `${this.settings.field}:[0 TO ${value}]`;
|
this.context.queryFragments[this.id] = `${this.settings.field}:[0 TO ${value}]`;
|
||||||
}
|
}
|
||||||
|
if (!this.disableUpdateOnSubmit) {
|
||||||
this.context.update();
|
this.context.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,9 +87,11 @@ export class SearchTextComponent implements SearchWidget, OnInit {
|
|||||||
this.displayValue$.next(value);
|
this.displayValue$.next(value);
|
||||||
if (this.context && this.settings && this.settings.field) {
|
if (this.context && this.settings && this.settings.field) {
|
||||||
this.context.queryFragments[this.id] = value ? `${this.settings.field}:'${this.getSearchPrefix()}${value}${this.getSearchSuffix()}'` : '';
|
this.context.queryFragments[this.id] = value ? `${this.settings.field}:'${this.getSearchPrefix()}${value}${this.getSearchSuffix()}'` : '';
|
||||||
|
if (!this.disableUpdateOnSubmit) {
|
||||||
this.context.update();
|
this.context.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
submitValues() {
|
submitValues() {
|
||||||
if(!this.disableUpdateOnSubmit) {
|
if(!this.disableUpdateOnSubmit) {
|
||||||
|
|||||||
Reference in New Issue
Block a user