fix #6421 javascript error when user input nothing in the filter logs

Signed-off-by: Meina Zhou <meinaz@vmware.com>
This commit is contained in:
Meina Zhou 2018-12-05 16:13:54 +08:00
parent 538082ceb6
commit 87cf6527c7
3 changed files with 5 additions and 2 deletions

View File

@ -46,7 +46,7 @@ export class FilterComponent implements OnInit {
valueChange(): void {
// Send out filter terms
this.filterTerms.next(this.currentValue.trim());
this.filterTerms.next(this.currentValue && this.currentValue.trim());
}
inputFocus(): void {

View File

@ -204,7 +204,7 @@ describe('RecentLogComponent (inline template)', () => {
els = fixture.nativeElement.querySelectorAll('.datagrid-row');
expect(els).toBeTruthy();
expect(els.length).toEqual(16);
expect(els.length).toEqual(4);
});
});

View File

@ -67,6 +67,9 @@ export class RecentLogComponent implements OnInit {
}
public doFilter(terms: string): void {
if (!terms) {
return;
}
this.currentTerm = terms.trim();
// Trigger data loading and start from first page
this.loading = true;