[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:
Vito
2018-08-13 22:29:14 +01:00
committed by Eugenio Romano
parent cc9548b25a
commit 62f0804205
3 changed files with 17 additions and 4 deletions

View File

@@ -1,6 +1,9 @@
<form [formGroup]="form" novalidate (ngSubmit)="apply(form.value, form.valid)">
<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 }}"
[matDatepicker]="fromDatepicker"
[max]="maxDate"
@@ -19,7 +22,10 @@
</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 }}"
[matDatepicker]="toDatepicker"
[min]="from.value"

View File

@@ -126,4 +126,9 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit {
hasParseError(formControl) {
return formControl.hasError('matDatepickerParse') && formControl.getError('matDatepickerParse').text;
}
forcePlaceholder(event: any) {
event.srcElement.click();
}
}

View File

@@ -162,8 +162,10 @@ export class SearchQueryBuilderService {
async execute() {
const query = this.buildQuery();
const data = await this.alfrescoApiService.searchApi.search(query);
this.executed.next(data);
if (query) {
const data = await this.alfrescoApiService.searchApi.search(query);
this.executed.next(data);
}
}
buildQuery(): QueryBody {