Skip to content

Commit

Permalink
Sort point of order categories in dialog by alphabetical order (#2539)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom authored Jul 25, 2023
1 parent 9c942b3 commit cecd2fa
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ export class PointOfOrderDialogComponent {
private activeMeeting: ActiveMeetingService
) {
this.activeMeeting.meeting.point_of_order_categories_as_observable
.pipe(map(categories => categories.sort((a, b) => a.rank - b.rank)))
.pipe(
map(categories =>
categories.sort((a, b) => {
const comparison = a.text.localeCompare(b.text);
return comparison || a.rank - b.rank;
})
)
)
.subscribe(this.categoriesSubject);

this.editForm = this.fb.group({
Expand Down

0 comments on commit cecd2fa

Please sign in to comment.