Add pagination for advanced search

This commit is contained in:
Geomitron
2024-07-27 21:23:42 -05:00
parent ed1aada613
commit b6de0513dc
4 changed files with 47 additions and 16 deletions

View File

@@ -124,9 +124,7 @@ export class ResultTableComponent implements OnInit {
const table = this.resultTableDiv.nativeElement
if (this.router.url === '/browse' && table.scrollHeight - (table.scrollTop + table.clientHeight) < 100) {
// Scrolled near the bottom of the table
if (this.searchService.areMorePages && !this.searchService.searchLoading) {
this.searchService.search(this.searchService.searchControl.value || '*', true).subscribe()
}
this.searchService.getNextSearchPage()
}
}
}

View File

@@ -178,7 +178,7 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
maxMaxNPS: null as number | null,
minYear: null as number | null,
maxYear: null as number | null,
modifiedAfter: this.fb.nonNullable.control('', { validators: dateVaidator }),
modifiedAfter: this.fb.nonNullable.control('', { validators: dateValidator }),
hash: this.fb.nonNullable.control(''),
trackHash: this.fb.nonNullable.control(''),
hasSoloSections: null as boolean | null,
@@ -231,9 +231,9 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
}
}
function dateVaidator(control: AbstractControl) {
function dateValidator(control: AbstractControl) {
if (control.value && isNaN(Date.parse(control.value))) {
return { 'dateVaidator': true }
return { 'dateValidator': true }
}
return null
}