🐛 Fix Trip days order
This commit is contained in:
parent
4b6d9a19a5
commit
24d85ea44c
@ -1 +1 @@
|
|||||||
__version__ = "1.17.0"
|
__version__ = "1.17.1"
|
||||||
|
|||||||
@ -260,7 +260,7 @@ class Trip(TripBase, table=True):
|
|||||||
user: str = Field(foreign_key="user.username", ondelete="CASCADE")
|
user: str = Field(foreign_key="user.username", ondelete="CASCADE")
|
||||||
|
|
||||||
places: list["Place"] = Relationship(back_populates="trips", link_model=TripPlaceLink)
|
places: list["Place"] = Relationship(back_populates="trips", link_model=TripPlaceLink)
|
||||||
days: list["TripDay"] = Relationship(back_populates="trip", cascade_delete=True)
|
days: list["TripDay"] = Relationship(back_populates="trip", sa_relationship_kwargs={"order_by": "TripDay.label"}, cascade_delete=True)
|
||||||
shares: list["TripShare"] = Relationship(back_populates="trip", cascade_delete=True)
|
shares: list["TripShare"] = Relationship(back_populates="trip", cascade_delete=True)
|
||||||
packing_items: list["TripPackingListItem"] = Relationship(back_populates="trip", cascade_delete=True)
|
packing_items: list["TripPackingListItem"] = Relationship(back_populates="trip", cascade_delete=True)
|
||||||
checklist_items: list["TripChecklistItem"] = Relationship(back_populates="trip", cascade_delete=True)
|
checklist_items: list["TripChecklistItem"] = Relationship(back_populates="trip", cascade_delete=True)
|
||||||
|
|||||||
@ -363,10 +363,6 @@ export class TripComponent implements AfterViewInit {
|
|||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
sortTripDays() {
|
|
||||||
this.trip?.days.sort((a, b) => a.label.localeCompare(b.label));
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleFiltering() {
|
toggleFiltering() {
|
||||||
this.isFilteringMode = !this.isFilteringMode;
|
this.isFilteringMode = !this.isFilteringMode;
|
||||||
if (!this.isFilteringMode) this.flattenTripDayItems();
|
if (!this.isFilteringMode) this.flattenTripDayItems();
|
||||||
@ -412,7 +408,6 @@ export class TripComponent implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
flattenTripDayItems(searchValue?: string) {
|
flattenTripDayItems(searchValue?: string) {
|
||||||
this.sortTripDays();
|
|
||||||
let prevLat: number, prevLng: number;
|
let prevLat: number, prevLng: number;
|
||||||
this.flattenedTripItems = this.trip!.days.flatMap((day) =>
|
this.flattenedTripItems = this.trip!.days.flatMap((day) =>
|
||||||
[...day.items]
|
[...day.items]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user