Browse Source

Task/sort asset classes and tags of assistant component alphabetically (#6737)

* Sort asset classes and tags alphabetically

* Update changelog
pull/6729/head^2
Thomas Kaul 3 days ago
committed by GitHub
parent
commit
d4abed37ca
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 15
      libs/ui/src/lib/assistant/assistant.component.ts

2
CHANGELOG.md

@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Sorted the activity types alphabetically on the activities page (experimental) - 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 `angular` from version `21.1.1` to `21.2.7`
- Upgraded `Nx` from version `22.5.3` to `22.6.4` - Upgraded `Nx` from version `22.5.3` to `22.6.4`
- Upgraded `yahoo-finance2` from version `3.13.2` to `3.14.0` - Upgraded `yahoo-finance2` from version `3.13.2` to `3.14.0`

15
libs/ui/src/lib/assistant/assistant.component.ts

@ -189,12 +189,16 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
} }
public ngOnInit() { public ngOnInit() {
this.assetClasses = Object.keys(AssetClass).map((assetClass) => { this.assetClasses = Object.keys(AssetClass)
.map((assetClass) => {
return { return {
id: assetClass, id: assetClass,
label: translate(assetClass), label: translate(assetClass),
type: 'ASSET_CLASS' type: 'ASSET_CLASS'
}; } satisfies Filter;
})
.sort((a, b) => {
return a.label.localeCompare(b.label);
}); });
this.searchFormControl.valueChanges this.searchFormControl.valueChanges
@ -435,12 +439,15 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
?.filter(({ isUsed }) => { ?.filter(({ isUsed }) => {
return isUsed; return isUsed;
}) })
.map(({ id, name }) => { ?.map(({ id, name }) => {
return { return {
id, id,
label: translate(name), label: translate(name),
type: 'TAG' type: 'TAG'
}; } satisfies Filter;
})
?.sort((a, b) => {
return a.label.localeCompare(b.label);
}) ?? []; }) ?? [];
} }

Loading…
Cancel
Save