Browse Source

Improve sorting

pull/7670/head
Thomas Kaul 1 week ago
parent
commit
b640c10c04
  1. 2
      libs/ui/src/lib/account-selector/account-selector.component.html
  2. 6
      libs/ui/src/lib/account-selector/account-selector.component.ts

2
libs/ui/src/lib/account-selector/account-selector.component.html

@ -28,7 +28,7 @@
<mat-option [value]="null" /> <mat-option [value]="null" />
} }
@for (account of accounts(); track account.id) { @for (account of sortedAccounts(); track account.id) {
<mat-option [value]="account.id"> <mat-option [value]="account.id">
<div class="d-flex"> <div class="d-flex">
<gf-entity-logo <gf-entity-logo

6
libs/ui/src/lib/account-selector/account-selector.component.ts

@ -61,6 +61,12 @@ export class GfAccountSelectorComponent
}); });
}); });
public readonly sortedAccounts = computed(() => {
return [...this.accounts()].sort((a, b) => {
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
});
});
private readonly ngControl = inject(NgControl, { private readonly ngControl = inject(NgControl, {
optional: true, optional: true,
self: true self: true

Loading…
Cancel
Save