mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3467] force the input to be updated when user type for removing … (#3693)
* [ADF-3467] force the input to be updated when user type for removing placeholder * [ADF-3467] fixed error when search page is opened without any parameters to search
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
<form [formGroup]="form" novalidate (ngSubmit)="apply(form.value, form.valid)">
|
<form [formGroup]="form" novalidate (ngSubmit)="apply(form.value, form.valid)">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput [formControl]="from" [errorStateMatcher]="matcher"
|
<input matInput
|
||||||
|
(input)="forcePlaceholder($event)"
|
||||||
|
[formControl]="from"
|
||||||
|
[errorStateMatcher]="matcher"
|
||||||
placeholder="{{ 'SEARCH.FILTER.RANGE.FROM-DATE' | translate }}"
|
placeholder="{{ 'SEARCH.FILTER.RANGE.FROM-DATE' | translate }}"
|
||||||
[matDatepicker]="fromDatepicker"
|
[matDatepicker]="fromDatepicker"
|
||||||
[max]="maxDate"
|
[max]="maxDate"
|
||||||
@@ -19,7 +22,10 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput [formControl]="to" [errorStateMatcher]="matcher"
|
<input matInput
|
||||||
|
(input)="forcePlaceholder($event)"
|
||||||
|
[formControl]="to"
|
||||||
|
[errorStateMatcher]="matcher"
|
||||||
placeholder="{{ 'SEARCH.FILTER.RANGE.TO-DATE' | translate }}"
|
placeholder="{{ 'SEARCH.FILTER.RANGE.TO-DATE' | translate }}"
|
||||||
[matDatepicker]="toDatepicker"
|
[matDatepicker]="toDatepicker"
|
||||||
[min]="from.value"
|
[min]="from.value"
|
||||||
|
@@ -126,4 +126,9 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit {
|
|||||||
hasParseError(formControl) {
|
hasParseError(formControl) {
|
||||||
return formControl.hasError('matDatepickerParse') && formControl.getError('matDatepickerParse').text;
|
return formControl.hasError('matDatepickerParse') && formControl.getError('matDatepickerParse').text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
forcePlaceholder(event: any) {
|
||||||
|
event.srcElement.click();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -162,8 +162,10 @@ export class SearchQueryBuilderService {
|
|||||||
|
|
||||||
async execute() {
|
async execute() {
|
||||||
const query = this.buildQuery();
|
const query = this.buildQuery();
|
||||||
const data = await this.alfrescoApiService.searchApi.search(query);
|
if (query) {
|
||||||
this.executed.next(data);
|
const data = await this.alfrescoApiService.searchApi.search(query);
|
||||||
|
this.executed.next(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildQuery(): QueryBody {
|
buildQuery(): QueryBody {
|
||||||
|
Reference in New Issue
Block a user