Browse Source
Task/improve sorting in account selector component (#7670)
* Improve sorting
* Update changelog
pull/7671/head
Thomas Kaul
10 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
15 additions and
1 deletions
-
CHANGELOG.md
-
libs/ui/src/lib/account-selector/account-selector.component.html
-
libs/ui/src/lib/account-selector/account-selector.component.ts
|
|
@ -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/), |
|
|
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). |
|
|
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 |
|
|
## 3.55.0 - 2026-08-19 |
|
|
|
|
|
|
|
|
### Added |
|
|
### Added |
|
|
|
|
|
@ -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 |
|
|
|
|
|
@ -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, { |
|
|
private readonly ngControl = inject(NgControl, { |
|
|
optional: true, |
|
|
optional: true, |
|
|
self: true |
|
|
self: true |
|
|
|