Skip to content

Commit

Permalink
add start at ipt as sort criterion
Browse files Browse the repository at this point in the history
  • Loading branch information
ihaveamicroservice committed Mar 8, 2024
1 parent fb59dd5 commit f386ba6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/components/cards/cards.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class CardsComponent {
{ value: CardSort.Duplicates, viewValue: 'Anzahl Dubletten' },
{ value: CardSort.Acronym, viewValue: 'Kürzel' },
{ value: CardSort.Name, viewValue: 'Name' },
{ value: CardSort.Start, viewValue: 'Start bei ipt' },
];

constructor(private readonly store: Store) {
Expand Down
1 change: 1 addition & 0 deletions src/app/models/card-sort.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export enum CardSort {
Duplicates = 'duplicates',
Acronym = 'acronym',
Name = 'name',
Start = 'start',
}
2 changes: 2 additions & 0 deletions src/app/state/card/card.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export const selectCardsSorted = createSelector(
if (!a.last_received) return 1;
if (!b.last_received) return -1;
return b.last_received.localeCompare(a.last_received);
case CardSort.Start:
return b.start_at_ipt.localeCompare(a.start_at_ipt);
default:
return 0;
}
Expand Down

0 comments on commit f386ba6

Please sign in to comment.