Merge pull request #6451 from zhoumeina/fix_javascript

fix #6421 javascript error when user input nothing in the filter logs
This commit is contained in:
Mia ZHOU 2018-12-06 09:40:27 +08:00 committed by GitHub
commit 37e9563f09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;