Skip to content

Commit

Permalink
✨ sort suggest values in variants and samples forms
Browse files Browse the repository at this point in the history
  • Loading branch information
bunop committed Jul 3, 2023
1 parent d23f0ea commit 7a4427f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/app/samples/samples.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,19 @@ export class SamplesComponent implements OnInit, AfterViewInit, OnDestroy {
private _filterCountry(value: string): string[] {
// console.log(this.samplesService.countries);
const filterValue = value.toLowerCase();
return this.samplesService.countries.filter(country => country.toLowerCase().includes(filterValue));
return this.samplesService.countries.filter(country => country.toLowerCase().includes(filterValue)).sort();
}

private _filterBreed(value: string): string[] {
// console.log(this.samplesService.breeds);
const filterValue = value.toLowerCase();
return this.samplesService.breeds.filter(breed => breed.toLowerCase().includes(filterValue));
return this.samplesService.breeds.filter(breed => breed.toLowerCase().includes(filterValue)).sort();
}

private _filterCode(value: string): string[] {
// console.log(this.samplesService.breed_codes);
const filterValue = value.toLowerCase();
return this.samplesService.breed_codes.filter(code => code.toLowerCase().includes(filterValue));
return this.samplesService.breed_codes.filter(code => code.toLowerCase().includes(filterValue)).sort();
}

ngOnDestroy() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/variants/variants.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export class VariantsComponent implements OnInit, AfterViewInit, OnDestroy {
}

const filterValue = value.toLowerCase();
return this.variantsService.supportedChips.filter(chip => chip.toLowerCase().includes(filterValue));
return this.variantsService.supportedChips.filter(chip => chip.toLowerCase().includes(filterValue)).sort();
}

ngOnDestroy(): void {
Expand Down

0 comments on commit 7a4427f

Please sign in to comment.