QA feedback for customer search

Search error must be deleted on clear
This commit is contained in:
Milos Jovanov
2019-02-14 11:50:36 +01:00
parent 5dd47e6de8
commit ce3800a3d9
3 changed files with 6 additions and 11 deletions

View File

@@ -9,9 +9,9 @@
<app-search
#searchInput
(search)="search($event)"
(input)="searchError = false; createTab()"
(input)="searchError = ''; createTab()"
placeholder="Name, E-Mail, PLZ"
[error]="searchError ? 'Ergibt keine Suchergebnisse' : ''"
[error]="searchError"
></app-search>
</div>
</div>

View File

@@ -39,7 +39,7 @@ export class SearchCustomerCardComponent implements OnInit, AfterViewInit {
products: Product[];
filters: Filter[];
processes: Process[];
searchError = false;
searchError = '';
@Input() searchParams = '';
@ViewChild('searchInput') searchInput: SearchComponent;
@@ -55,7 +55,6 @@ export class SearchCustomerCardComponent implements OnInit, AfterViewInit {
search(searchParams) {
this.searchParams = searchParams;
if (!this.searchParams) {
this.searchError = false;
return;
}
@@ -65,7 +64,7 @@ export class SearchCustomerCardComponent implements OnInit, AfterViewInit {
if (users && users.length > 0) {
this.navigateToRoute('customer-search-result');
} else {
this.searchError = true;
this.searchError = 'Ergibt keine Suchergebnisse';
}
});
}
@@ -75,11 +74,6 @@ export class SearchCustomerCardComponent implements OnInit, AfterViewInit {
this.router.navigate([route]);
}
clear() {
this.searchParams = null;
this.searchError = !this.searchError;
}
loadProcesses() {
this.processes$.subscribe((data: Process[]) => (this.processes = data));
}

View File

@@ -44,7 +44,7 @@ import {
export class SearchComponent implements OnInit {
@Input() placeholder = '';
@Input() input = '';
@Input() error;
@Input() error = '';
@Input() autocompletePlaceHolder = '';
@Output() inputChange = new EventEmitter();
@Output() search = new EventEmitter();
@@ -66,6 +66,7 @@ export class SearchComponent implements OnInit {
clear() {
this.change('');
this.error ='';
}
emitSearch(input: string) {