From c77f78402142942f560ef05c1c703518fdd551c9 Mon Sep 17 00:00:00 2001 From: Alexander Schreiner Date: Sat, 9 May 2026 18:14:38 +0200 Subject: [PATCH] feat: allow sorting of candidates within assignment-detail-component Signed-off-by: Alexander Schreiner --- .../assignment-detail.component.html | 34 +++++++++++++++++++ .../assignment-detail.component.ts | 28 +++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.html b/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.html index 552488a11c..547c79f6ed 100644 --- a/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.html +++ b/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.html @@ -173,6 +173,40 @@

{{ 'Candidates' | translate }}

@if (assignment?.candidates?.length) {
+ @if (assignmentCandidates.length > 1) { +
+ + + + + +
+ } { + if (this.currentSort === property) { + this.sortAscending = !this.sortAscending; + } else { + this.currentSort = property; + this.sortAscending = true; + } + const sorted = [...this.assignmentCandidates].sort((a, b) => { + const nameA = property === 'first_name' ? (a.user?.first_name ?? '') : (a.user?.last_name ?? ''); + const nameB = property === 'first_name' ? (b.user?.first_name ?? '') : (b.user?.last_name ?? ''); + const comparison = nameA.localeCompare(nameB); + return this.sortAscending ? comparison : -comparison; + }); + this._assignmentCandidates = sorted; + await this.onSortingChange(sorted); + } + /** * Checks if there are any tags available */ @@ -215,6 +242,7 @@ export class AssignmentDetailComponent extends BaseMeetingComponent implements O } }) ); + this.modelRequestService.subscribeTo(getAssignmentDetailSubscriptionConfig(assignmentId)); } /**