Browse Source

Sort activity types alphabetically

pull/6736/head
Thomas Kaul 1 month ago
parent
commit
7d2ffec863
  1. 2
      libs/ui/src/lib/activities-table/activities-table.component.html
  2. 7
      libs/ui/src/lib/activities-table/activities-table.component.ts

2
libs/ui/src/lib/activities-table/activities-table.component.html

@ -5,7 +5,7 @@
<mat-label i18n>Type</mat-label> <mat-label i18n>Type</mat-label>
<mat-select multiple [formControl]="typesFilter"> <mat-select multiple [formControl]="typesFilter">
@for ( @for (
activityType of activityTypesTranslationMap | keyvalue; activityType of activityTypesTranslationMap | keyvalue: sortByValue;
track activityType.key track activityType.key
) { ) {
<mat-option [value]="activityType.key"> <mat-option [value]="activityType.key">

7
libs/ui/src/lib/activities-table/activities-table.component.ts

@ -353,6 +353,13 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit {
this.activityToUpdate.emit(aActivity); this.activityToUpdate.emit(aActivity);
} }
public sortByValue(
a: { key: ActivityType; value: string },
b: { key: ActivityType; value: string }
) {
return a.value.localeCompare(b.value);
}
public toggleAllRows() { public toggleAllRows() {
if (this.areAllRowsSelected()) { if (this.areAllRowsSelected()) {
this.selectedRows.clear(); this.selectedRows.clear();

Loading…
Cancel
Save