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); }) ?? []; }