mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-4985] Removed disableUpdateOnSubmit flag from search widgets
This commit is contained in:
committed by
Jatin_Chugh
parent
0b8a4d9f0f
commit
5574aef240
+2
-7
@@ -48,7 +48,6 @@ 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) {
|
||||||
@@ -95,9 +94,7 @@ 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,9 +142,7 @@ 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();
|
||||||
if(!this.disableUpdateOnSubmit) {
|
this.context.update();
|
||||||
this.context.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-7
@@ -70,7 +70,6 @@ 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>();
|
||||||
@@ -152,9 +151,7 @@ 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();
|
||||||
if(!this.disableUpdateOnSubmit) {
|
this.context.update();
|
||||||
this.context.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,9 +214,7 @@ 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-7
@@ -65,7 +65,6 @@ 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>();
|
||||||
@@ -139,9 +138,7 @@ 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();
|
||||||
if(!this.disableUpdateOnSubmit) {
|
this.context.update();
|
||||||
this.context.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,9 +202,7 @@ 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-8
@@ -41,7 +41,6 @@ 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}]';
|
||||||
@@ -99,9 +98,7 @@ 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}`;
|
||||||
if (!this.disableUpdateOnSubmit) {
|
this.context.update();
|
||||||
this.context.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,10 +158,8 @@ 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-7
@@ -50,7 +50,6 @@ 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() {
|
||||||
@@ -98,9 +97,7 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
|
|||||||
submitValues() {
|
submitValues() {
|
||||||
this.setValue(this.value);
|
this.setValue(this.value);
|
||||||
this.updateDisplayValue();
|
this.updateDisplayValue();
|
||||||
if(!this.disableUpdateOnSubmit) {
|
this.context.update();
|
||||||
this.context.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hasValidValue() {
|
hasValidValue() {
|
||||||
@@ -147,9 +144,7 @@ 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
-7
@@ -41,7 +41,6 @@ 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. */
|
||||||
@@ -91,9 +90,7 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submitValues() {
|
submitValues() {
|
||||||
if(!this.disableUpdateOnSubmit) {
|
this.updateQuery(this.value);
|
||||||
this.updateQuery(this.value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hasValidValue() {
|
hasValidValue() {
|
||||||
@@ -117,9 +114,7 @@ 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ 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() {
|
||||||
@@ -87,16 +86,12 @@ 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) {
|
this.updateQuery(this.value);
|
||||||
this.updateQuery(this.value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hasValidValue() {
|
hasValidValue() {
|
||||||
|
|||||||
-3
@@ -57,8 +57,6 @@ export class SearchWidgetContainerComponent implements OnInit, OnDestroy, OnChan
|
|||||||
@Input()
|
@Input()
|
||||||
value: any;
|
value: any;
|
||||||
|
|
||||||
@Input()
|
|
||||||
disableUpdateOnSubmit = false;
|
|
||||||
|
|
||||||
componentRef: ComponentRef<any>;
|
componentRef: ComponentRef<any>;
|
||||||
|
|
||||||
@@ -92,7 +90,6 @@ export class SearchWidgetContainerComponent implements OnInit, OnDestroy, OnChan
|
|||||||
ref.instance.id = this.id;
|
ref.instance.id = this.id;
|
||||||
ref.instance.settings = {...this.settings};
|
ref.instance.settings = {...this.settings};
|
||||||
ref.instance.context = this.queryBuilder;
|
ref.instance.context = this.queryBuilder;
|
||||||
ref.instance.disableUpdateOnSubmit = this.disableUpdateOnSubmit;
|
|
||||||
if (this.value) {
|
if (this.value) {
|
||||||
ref.instance.isActive = true;
|
ref.instance.isActive = true;
|
||||||
ref.instance.startValue = this.value;
|
ref.instance.startValue = this.value;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export interface SearchWidget {
|
|||||||
settings?: SearchWidgetSettings;
|
settings?: SearchWidgetSettings;
|
||||||
context?: SearchQueryBuilderService;
|
context?: SearchQueryBuilderService;
|
||||||
isActive?: boolean;
|
isActive?: boolean;
|
||||||
disableUpdateOnSubmit?: boolean;
|
|
||||||
startValue: any;
|
startValue: any;
|
||||||
/* stream emit value on changes */
|
/* stream emit value on changes */
|
||||||
displayValue$: Subject<string>;
|
displayValue$: Subject<string>;
|
||||||
|
|||||||
Reference in New Issue
Block a user