Browse Source

Task/improve sorting in account selector component (#7670)

* Improve sorting

* Update changelog
pull/7671/head
Thomas Kaul 8 hours ago
committed by GitHub
parent
commit
89ae246f85
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 2
      libs/ui/src/lib/account-selector/account-selector.component.html
  3. 8
      libs/ui/src/lib/account-selector/account-selector.component.ts

6
CHANGELOG.md

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- Improved the sorting to be case-insensitive in the account selector component
## 3.55.0 - 2026-08-19
### Added

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

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

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

@ -61,6 +61,14 @@ 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, {
optional: true,
self: true

Loading…
Cancel
Save