mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
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:
parent
538082ceb6
commit
87cf6527c7
@ -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 {
|
||||
|
@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user