Add drumsReviewed filter

This commit is contained in:
Geomitron
2025-03-11 22:57:04 -05:00
parent 3881a69176
commit a70f968806
6 changed files with 47 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import dayjs from 'dayjs'
import { distinctUntilChanged, switchMap, throttleTime } from 'rxjs'
import { Difficulty, Instrument } from 'scan-chart'
import { SearchService } from 'src-angular/app/core/services/search.service'
import { difficulties, difficultyDisplay, drumTypeDisplay, DrumTypeName, drumTypeNames, instrumentDisplay, instruments } from 'src-shared/UtilFunctions'
import { difficulties, difficultyDisplay, drumsReviewedDisplay, drumTypeDisplay, DrumTypeName, drumTypeNames, instrumentDisplay, instruments } from 'src-shared/UtilFunctions'
@Component({
selector: 'app-search-bar',
@@ -30,6 +30,7 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
public instrumentDisplay = instrumentDisplay
public difficultyDisplay = difficultyDisplay
public drumTypeDisplay = drumTypeDisplay
public drumsReviewedDisplay = drumsReviewedDisplay
public advancedSearchForm: ReturnType<this['getAdvancedSearchForm']>
public startValidation = false
@@ -103,6 +104,16 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
}
}
get drumsReviewed() {
return this.searchService.drumsReviewed.value
}
setDrumsReviewed(drumsReviewed: boolean, event: MouseEvent) {
this.searchService.drumsReviewed.setValue(drumsReviewed)
if (event.target instanceof HTMLElement) {
event.target.parentElement?.parentElement?.blur()
}
}
get todayDate() {
return dayjs().format('YYYY-MM-DD')
}
@@ -225,6 +236,7 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
instrument: this.instrument,
difficulty: this.difficulty,
drumType: this.drumType,
drumsReviewed: this.drumsReviewed,
sort: this.searchService.sortColumn !== null ? { type: this.searchService.sortColumn, direction: this.searchService.sortDirection } : null,
source: 'bridge' as const,
...this.advancedSearchForm.getRawValue(),