mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-26 22:57:32 +00:00
fix(planner): a booked hotel stays in the place list when road trip stops are hidden in Days
Since 4.3.0 every lodging booking types its place as 'hotel', and 'hotel' is one of the road trip stop types. With "Show in Days too" switched off, Days dropped every such place from the trip's place list, so a hotel vanished from the sidebar, from the booking's own place picker and from the Days map the moment it was booked, and a click on it in the day list found nothing. Nothing was deleted: road trip mode kept showing it. Days now leaves out only road trip stops nobody booked. A lodging place stays, and so does any place a stay or a booking points at, on the desktop and on the phone. Trips planned on 4.3.1 show their hotels again without any change to their data. An imported GPX or KML track is no longer offered as the place of a stay, in the booking form, the day's hotel picker and the phone's sheets. A stay that already names a track keeps showing it.
This commit is contained in:
@@ -10,6 +10,7 @@ import { applyStayStops } from '../../../../store/stayStops'
|
||||
import { useTranslation } from '../../../../i18n'
|
||||
import { Eyebrow } from './MTripSheetUi'
|
||||
import type { MTripSheetsProps } from '../MTripShell'
|
||||
import { stayPlaces } from '../../../../utils/stayPlaces'
|
||||
|
||||
interface AccommodationPayload {
|
||||
dayId?: number
|
||||
@@ -97,7 +98,8 @@ export default function MAccommodationSheet({ planner, shell }: MTripSheetsProps
|
||||
: (d.title ? t('planner.dayN', { n: i + 1 }) : undefined),
|
||||
}))
|
||||
|
||||
const filteredPlaces = categoryFilter != null ? places.filter(p => p.category_id === categoryFilter) : places
|
||||
const offeredPlaces = stayPlaces(places, form.place_id)
|
||||
const filteredPlaces = categoryFilter != null ? offeredPlaces.filter(p => p.category_id === categoryFilter) : offeredPlaces
|
||||
|
||||
const save = async () => {
|
||||
setSaving(true)
|
||||
|
||||
@@ -20,6 +20,7 @@ import { useTripStore } from '../../../../store/tripStore'
|
||||
import type { TripMember } from '../../../../types'
|
||||
import type { BookingExpenseRequest } from '../../../../components/Planner/BookingCostsSection.types'
|
||||
import type { TripPlanner } from '../MTripShell'
|
||||
import { stayPlaces } from '../../../../utils/stayPlaces'
|
||||
|
||||
export interface MReservationSheetProps {
|
||||
planner: TripPlanner
|
||||
@@ -212,6 +213,7 @@ export default function MReservationSheet({ planner, onOpenExpense }: MReservati
|
||||
d ? new Date(`${d.slice(0, 10)}T00:00:00Z`).toLocaleDateString(locale, { day: 'numeric', month: 'short', timeZone: 'UTC' }) : undefined
|
||||
|
||||
const placeOptions = [{ value: '', label: '—' }, ...places.map(p => ({ value: p.id, label: p.name }))]
|
||||
const hotelPlaceOptions = [{ value: '', label: '—' }, ...stayPlaces(places, form.hotel_place_id).map(p => ({ value: p.id, label: p.name }))]
|
||||
const dayOptions = days.map(d => ({
|
||||
value: d.id,
|
||||
label: d.title || t('dayplan.dayN', { n: d.day_number }),
|
||||
@@ -449,7 +451,7 @@ export default function MReservationSheet({ planner, onOpenExpense }: MReservati
|
||||
return next
|
||||
})
|
||||
}}
|
||||
options={placeOptions}
|
||||
options={hotelPlaceOptions}
|
||||
placeholder={t('reservations.meta.pickHotel')}
|
||||
searchable
|
||||
size="sm"
|
||||
|
||||
Reference in New Issue
Block a user