Browse Source
Bugfix/fix case-insensitive sorting in accounts table (#6178)
* Fix case-insensitive sorting by account name
* Update changelog
main
Thomas Kaul
1 day ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
15 additions and
3 deletions
-
CHANGELOG.md
-
libs/common/src/lib/helper.ts
-
libs/ui/src/lib/accounts-table/accounts-table.component.ts
|
|
|
@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed the filtering by asset class in the endpoint `GET api/v1/portfolio/holdings` |
|
|
|
- Fixed the case-insensitive sorting in the accounts table component |
|
|
|
|
|
|
|
## 2.228.0 - 2026-01-03 |
|
|
|
|
|
|
|
|
|
|
|
@ -12,6 +12,7 @@ import { |
|
|
|
subDays |
|
|
|
} from 'date-fns'; |
|
|
|
import { ca, de, es, fr, it, nl, pl, pt, tr, uk, zhCN } from 'date-fns/locale'; |
|
|
|
import { get, isNil, isString } from 'lodash'; |
|
|
|
|
|
|
|
import { |
|
|
|
DEFAULT_CURRENCY, |
|
|
|
@ -242,6 +243,16 @@ export function getLocale() { |
|
|
|
return navigator.language ?? locale; |
|
|
|
} |
|
|
|
|
|
|
|
export function getLowercase(object: object, path: string) { |
|
|
|
const value = get(object, path); |
|
|
|
|
|
|
|
if (isNil(value)) { |
|
|
|
return ''; |
|
|
|
} |
|
|
|
|
|
|
|
return isString(value) ? value.toLocaleLowerCase() : value; |
|
|
|
} |
|
|
|
|
|
|
|
export function getNumberFormatDecimal(aLocale?: string) { |
|
|
|
const formatObject = new Intl.NumberFormat(aLocale).formatToParts(9999.99); |
|
|
|
|
|
|
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
import { ConfirmationDialogType } from '@ghostfolio/common/enums'; |
|
|
|
import { getLocale } from '@ghostfolio/common/helper'; |
|
|
|
import { getLocale, getLowercase } from '@ghostfolio/common/helper'; |
|
|
|
import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; |
|
|
|
import { NotificationService } from '@ghostfolio/ui/notifications'; |
|
|
|
import { GfValueComponent } from '@ghostfolio/ui/value'; |
|
|
|
@ -32,7 +32,6 @@ import { |
|
|
|
trashOutline, |
|
|
|
walletOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { get } from 'lodash'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import { Subject, Subscription } from 'rxjs'; |
|
|
|
|
|
|
|
@ -133,8 +132,9 @@ export class GfAccountsTableComponent implements OnChanges, OnDestroy { |
|
|
|
this.isLoading = true; |
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(this.accounts); |
|
|
|
this.dataSource.sortingDataAccessor = getLowercase; |
|
|
|
|
|
|
|
this.dataSource.sort = this.sort; |
|
|
|
this.dataSource.sortingDataAccessor = get; |
|
|
|
|
|
|
|
if (this.accounts) { |
|
|
|
this.isLoading = false; |
|
|
|
|