From d4abed37cafa5ade6cc4fd566a4577f9899df5e8 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 18 Apr 2026 19:13:14 +0200 Subject: [PATCH] Task/sort asset classes and tags of assistant component alphabetically (#6737) * Sort asset classes and tags alphabetically * Update changelog --- CHANGELOG.md | 2 ++ .../src/lib/assistant/assistant.component.ts | 25 ++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b8cd0648..470521134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Sorted the activity types alphabetically on the activities page (experimental) +- Sorted the asset classes of the assistant alphabetically +- Sorted the tags of the assistant alphabetically - Upgraded `angular` from version `21.1.1` to `21.2.7` - Upgraded `Nx` from version `22.5.3` to `22.6.4` - Upgraded `yahoo-finance2` from version `3.13.2` to `3.14.0` diff --git a/libs/ui/src/lib/assistant/assistant.component.ts b/libs/ui/src/lib/assistant/assistant.component.ts index cf1449254..5decd9d66 100644 --- a/libs/ui/src/lib/assistant/assistant.component.ts +++ b/libs/ui/src/lib/assistant/assistant.component.ts @@ -189,13 +189,17 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { } public ngOnInit() { - this.assetClasses = Object.keys(AssetClass).map((assetClass) => { - return { - id: assetClass, - label: translate(assetClass), - type: 'ASSET_CLASS' - }; - }); + this.assetClasses = Object.keys(AssetClass) + .map((assetClass) => { + return { + id: assetClass, + label: translate(assetClass), + type: 'ASSET_CLASS' + } satisfies Filter; + }) + .sort((a, b) => { + return a.label.localeCompare(b.label); + }); this.searchFormControl.valueChanges .pipe( @@ -435,12 +439,15 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { ?.filter(({ isUsed }) => { return isUsed; }) - .map(({ id, name }) => { + ?.map(({ id, name }) => { return { id, label: translate(name), type: 'TAG' - }; + } satisfies Filter; + }) + ?.sort((a, b) => { + return a.label.localeCompare(b.label); }) ?? []; }