From 366328dbb2024e80029e395592ec4910625e8e1c Mon Sep 17 00:00:00 2001 From: itskovacs Date: Sun, 2 Nov 2025 00:20:08 +0100 Subject: [PATCH] :lipstick: Display attachments icon in table, display attachments in details --- .../app/components/trip/trip.component.html | 42 ++++++++++++++++++- src/src/app/components/trip/trip.component.ts | 9 +++- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/src/app/components/trip/trip.component.html b/src/src/app/components/trip/trip.component.html index ab71ab6..460e27f 100644 --- a/src/src/app/components/trip/trip.component.html +++ b/src/src/app/components/trip/trip.component.html @@ -135,11 +135,15 @@ (click)="onRowClick(tripitem)"> @if (tripTableSelectedColumns.includes('time')) {{{ tripitem.time }}} @if (tripTableSelectedColumns.includes('text')) { -
+
@if (tripitem.status) {
} {{ tripitem.text }}
+ @if (tripitem.attachments.length) { +
+
+ } } @if (tripTableSelectedColumns.includes('place')) { @if (tripitem.place) { @@ -197,11 +201,15 @@ } @if (tripTableSelectedColumns.includes('time')) {{{ tripitem.time }}} @if (tripTableSelectedColumns.includes('text')) { -
+
@if (tripitem.status) {
} {{ tripitem.text }}
+ @if (tripitem.attachments.length) { +
+
+ } } @if (tripTableSelectedColumns.includes('place')) { @if (tripitem.place) { @@ -368,6 +376,36 @@ selectedItem.status.label }}
} + + @if (selectedItem.attachments?.length) { +
+

Attachments

+
+ @for (attachment of selectedItem.attachments; track attachment.id) { +
+
+ + +
+ +
+
{{ + attachment.filename }}
+
+ {{ attachment.file_size | fileSize }} + {{ + attachment.uploaded_by }} +
+
+
+ } +
+
+ }
@if (selectedItem.image) { diff --git a/src/src/app/components/trip/trip.component.ts b/src/src/app/components/trip/trip.component.ts index 019058d..ca5ee5c 100644 --- a/src/src/app/components/trip/trip.component.ts +++ b/src/src/app/components/trip/trip.component.ts @@ -207,7 +207,7 @@ export class TripComponent implements AfterViewInit { ]; readonly menuTripExportItems: MenuItem[] = [ { - label: 'Actions', + label: 'Export', items: [ { label: 'Calendar (.ics)', @@ -427,6 +427,7 @@ export class TripComponent implements AfterViewInit { lng, distance, paid_by: item.paid_by, + attachments: item.attachments, }; }); } @@ -1126,6 +1127,7 @@ export class TripComponent implements AfterViewInit { days: this.trip.days, selectedDay: day_id, members: this.tripMembers, + trip: this.trip, }, })!; @@ -1185,6 +1187,7 @@ export class TripComponent implements AfterViewInit { status: item.status ? (item.status as TripStatus).label : null, }, members: this.tripMembers, + trip: this.trip, }, })!; @@ -2021,6 +2024,10 @@ export class TripComponent implements AfterViewInit { .subscribe({ next: () => { this.trip!.attachments = this.trip?.attachments?.filter((att) => att.id != attachmentId); + if (this.selectedItem?.attachments?.length) { + if (this.selectedItem.attachments.some((a) => a.id == attachmentId)) + this.selectedItem.attachments = this.selectedItem.attachments.filter((a) => a.id != attachmentId); + } }, }); }