diff --git a/src/src/app/components/shared-trip/shared-trip.component.html b/src/src/app/components/shared-trip/shared-trip.component.html index 69e96a1..4c89196 100644 --- a/src/src/app/components/shared-trip/shared-trip.component.html +++ b/src/src/app/components/shared-trip/shared-trip.component.html @@ -3,8 +3,8 @@
-
-

{{ trip.name }}

+
+

{{ trip.name }}

{{ trip.days.length }} {{ trip.days!.length > 1 ? 'days' : 'day'}}
@@ -14,6 +14,7 @@
itskovacs/trip
+ + @if (trip.collaborators.length) { + {{ p.user + }} + }
@@ -415,41 +420,18 @@
-
-

Watchlist

- {{ trip.name }} pending/constraints - - +
+

About

+
itskovacs/trip
- @if (!collapsedTripStatuses) { -
- @defer { - @for (item of getWatchlistData; track item.id) { -
-
- {{ - item.status.label }} -
-
{{ item.text }}
-
- } @empty { -

- Nothing there -

- } - } @placeholder (minimum 0.4s) { -
- -
- } +
+
TRIP is free and always will be. Building it takes a lot of time and effort, and since I'm committed to + keeping it free, your support simply helps keep the project going. Thank you! ❤️
+ + Buy me + a coffee
- }
}
@@ -505,4 +487,40 @@ }
+ + + +
+
+ @for (item of checklistItems; track item.id) { +
+ +
+ } +
+ +
+ @for (item of getWatchlistData; track item.id) { +
+ +
+ } +
+
\ No newline at end of file diff --git a/src/src/app/components/shared-trip/shared-trip.component.ts b/src/src/app/components/shared-trip/shared-trip.component.ts index 577ec8d..54fa5e6 100644 --- a/src/src/app/components/shared-trip/shared-trip.component.ts +++ b/src/src/app/components/shared-trip/shared-trip.component.ts @@ -12,6 +12,7 @@ import { TripItem, TripStatus, PackingItem, + ChecklistItem, } from "../../types/trip"; import { Place } from "../../types/poi"; import { @@ -72,12 +73,14 @@ export class SharedTripComponent implements AfterViewInit { totalPrice = 0; collapsedTripDays = false; collapsedTripPlaces = false; - collapsedTripStatuses = false; packingDialogVisible = false; isExpanded = false; isFilteringMode = false; packingList: PackingItem[] = []; dispPackingList: Record = {}; + checklistDialogVisible = false; + checklistItems: ChecklistItem[] = []; + dispchecklist: ChecklistItem[] = []; map?: L.Map; markerClusterGroup?: L.MarkerClusterGroup; @@ -94,14 +97,15 @@ export class SharedTripComponent implements AfterViewInit { label: "Packing", icon: "pi pi-briefcase", command: () => { - // this.toggleArchiveTrip(); + this.openPackingList(); }, }, { - label: "Reminders", + label: "Checklist", icon: "pi pi-check-square", + iconClass: "text-purple-500!", command: () => { - // this.toggleArchiveTrip(); + this.openChecklist(); }, }, ], @@ -719,4 +723,19 @@ export class SharedTripComponent implements AfterViewInit { {}, ); } + + openChecklist() { + if (!this.trip) return; + + if (!this.checklistItems.length) + this.apiService + .getChecklist(this.trip.id) + .pipe(take(1)) + .subscribe({ + next: (items) => { + this.checklistItems = [...items]; + }, + }); + this.checklistDialogVisible = true; + } }