diff --git a/CHANGELOG.md b/CHANGELOG.md index 5926bd4cc..6b8cd0648 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ 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) - 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/activities-table/activities-table.component.html b/libs/ui/src/lib/activities-table/activities-table.component.html index b8fe962d7..14089f061 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.html +++ b/libs/ui/src/lib/activities-table/activities-table.component.html @@ -5,7 +5,7 @@ Type @for ( - activityType of activityTypesTranslationMap | keyvalue; + activityType of activityTypesTranslationMap | keyvalue: sortByValue; track activityType.key ) { diff --git a/libs/ui/src/lib/activities-table/activities-table.component.ts b/libs/ui/src/lib/activities-table/activities-table.component.ts index ffc07f09c..766abcc23 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.ts +++ b/libs/ui/src/lib/activities-table/activities-table.component.ts @@ -353,6 +353,13 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit { this.activityToUpdate.emit(aActivity); } + public sortByValue( + a: { key: ActivityType; value: string }, + b: { key: ActivityType; value: string } + ) { + return a.value.localeCompare(b.value); + } + public toggleAllRows() { if (this.areAllRowsSelected()) { this.selectedRows.clear();