@if (creator) {
-
- {{ creator.firstName }} {{ creator.lastName }}
+
+ {{ getUserNameForParticipant(creator) }}
} @else {
Zahlungsempfänger konnte nicht ermittelt werden.
}
diff --git a/frontend/src/app/widgets/expense-split-widget/expense-entry-card/expense-entry-card.component.ts b/frontend/src/app/widgets/expense-split-widget/expense-entry-card/expense-entry-card.component.ts
index 62aaed6..0fa8431 100644
--- a/frontend/src/app/widgets/expense-split-widget/expense-entry-card/expense-entry-card.component.ts
+++ b/frontend/src/app/widgets/expense-split-widget/expense-entry-card/expense-entry-card.component.ts
@@ -1,7 +1,8 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';
import {ExpenseEntry} from "../../../../model/expense-split-widget";
-import {SimpleUser} from "../../../../model/user";
+import {EventParticipant} from "../../../../model/user";
import {Event} from "../../../../model/event";
+import {getUserNameForParticipant} from "../../../../utils/user.utils";
@Component({
selector: 'app-expense-entry-card',
@@ -23,7 +24,7 @@ export class ExpenseEntryCardComponent {
onEdit = new EventEmitter();
get getInvolvedUserNames(): string[] {
- return this.entry.involvedUsers.map(u => [u.user.firstName, u.user.lastName].join(" "));
+ return this.entry.involvedUsers.map(u => getUserNameForParticipant(u.user));
}
get isEveryoneInvolved(): boolean {
@@ -33,8 +34,9 @@ export class ExpenseEntryCardComponent {
eventParticipantIds.every(id => involvedUserIds.includes(id));
}
- get creator(): SimpleUser | undefined {
+ get creator(): EventParticipant | undefined {
return this.eventData.participants.find(p => p.id === this.entry.creatorId);
}
+ protected readonly getUserNameForParticipant = getUserNameForParticipant;
}
diff --git a/frontend/src/app/widgets/expense-split-widget/expense-split-widget.component.ts b/frontend/src/app/widgets/expense-split-widget/expense-split-widget.component.ts
index 8f6d2de..0957417 100644
--- a/frontend/src/app/widgets/expense-split-widget/expense-split-widget.component.ts
+++ b/frontend/src/app/widgets/expense-split-widget/expense-split-widget.component.ts
@@ -37,7 +37,7 @@ export class ExpenseSplitWidgetComponent {
createNewExpenseEntry() {
const dialogRef = this.dialog.open(CreateEditExpenseEntryDialogComponent, {
width: "600px",
- data: {users: this.eventData.participants}
+ data: {users: this.eventData.participants.filter(p => !p.hasLeft)}
});
dialogRef.afterClosed().subscribe(addCommand => {
diff --git a/frontend/src/app/widgets/shopping-list-widget/shopping-list-entry-list-item/shopping-list-entry-list-item.component.html b/frontend/src/app/widgets/shopping-list-widget/shopping-list-entry-list-item/shopping-list-entry-list-item.component.html
index 68a1345..95c02da 100644
--- a/frontend/src/app/widgets/shopping-list-widget/shopping-list-entry-list-item/shopping-list-entry-list-item.component.html
+++ b/frontend/src/app/widgets/shopping-list-widget/shopping-list-entry-list-item/shopping-list-entry-list-item.component.html
@@ -5,7 +5,7 @@
@if (item.buyerId) {
person
- {{ buyer?.firstName }} {{ buyer?.lastName }}
+ {{ buyer ? getUserName(buyer) : '?' }}
}