mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-4985] Using widget-composite component now correctly updates the search query on submit. Added optional property to disable update on submit button click for widget-composite.
This commit is contained in:
committed by
Jatin_Chugh
parent
f8455a57cc
commit
df1801dd44
+2
-2
@@ -57,6 +57,7 @@ export class SearchDateRangeAdvancedComponent implements SearchWidget, OnInit, O
|
|||||||
settings?: SearchWidgetSettings;
|
settings?: SearchWidgetSettings;
|
||||||
context?: SearchQueryBuilderService;
|
context?: SearchQueryBuilderService;
|
||||||
startValue: SearchDateRangeAdvanced;
|
startValue: SearchDateRangeAdvanced;
|
||||||
|
disableUpdateOnSubmit: boolean;
|
||||||
maxDate: any;
|
maxDate: any;
|
||||||
dateRangeTypeValue: DateRangeType = DateRangeType.ANY;
|
dateRangeTypeValue: DateRangeType = DateRangeType.ANY;
|
||||||
inLastValue: string;
|
inLastValue: string;
|
||||||
@@ -69,7 +70,6 @@ export class SearchDateRangeAdvancedComponent implements SearchWidget, OnInit, O
|
|||||||
|
|
||||||
private enableChangeUpdate: boolean;
|
private enableChangeUpdate: boolean;
|
||||||
private datePickerFormat: string;
|
private datePickerFormat: string;
|
||||||
private disableUpdateOnSubmit = false;
|
|
||||||
|
|
||||||
private onDestroy$ = new Subject<void>();
|
private onDestroy$ = new Subject<void>();
|
||||||
|
|
||||||
@@ -234,5 +234,5 @@ export class SearchDateRangeAdvancedComponent implements SearchWidget, OnInit, O
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Format dates for Between date range type
|
//TODO: Format dates for Between date range type
|
||||||
|
|
||||||
|
|||||||
+4
@@ -57,6 +57,9 @@ export class SearchWidgetContainerComponent implements OnInit, OnDestroy, OnChan
|
|||||||
@Input()
|
@Input()
|
||||||
value: any;
|
value: any;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
disableUpdateOnSubmit = false;
|
||||||
|
|
||||||
componentRef: ComponentRef<any>;
|
componentRef: ComponentRef<any>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -89,6 +92,7 @@ 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,6 +25,7 @@ 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>;
|
||||||
|
|||||||
@@ -487,12 +487,27 @@ export abstract class BaseQueryBuilderService {
|
|||||||
let query = '';
|
let query = '';
|
||||||
|
|
||||||
this.categories.forEach((facet) => {
|
this.categories.forEach((facet) => {
|
||||||
const customQuery = this.queryFragments[facet.id];
|
let customQuery: string;
|
||||||
if (customQuery) {
|
|
||||||
if (query.length > 0) {
|
if (facet.component.selector === 'widget-composite') {
|
||||||
query += ' AND ';
|
const widgetTabs: any[] = facet.component.settings.tabs;
|
||||||
|
widgetTabs.forEach(tab => {
|
||||||
|
customQuery = this.queryFragments[tab.id];
|
||||||
|
if (customQuery) {
|
||||||
|
if (query.length > 0) {
|
||||||
|
query += ' AND ';
|
||||||
|
}
|
||||||
|
query += `(${customQuery})`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
customQuery = this.queryFragments[facet.id];
|
||||||
|
if (customQuery) {
|
||||||
|
if (query.length > 0) {
|
||||||
|
query += ' AND ';
|
||||||
|
}
|
||||||
|
query += `(${customQuery})`;
|
||||||
}
|
}
|
||||||
query += `(${customQuery})`;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user