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:
Maurice
2026-09-23 21:28:34 +02:00
parent a1d6348c5f
commit b5457d9e6a
16 changed files with 225 additions and 15 deletions
@@ -8,7 +8,7 @@ import { useSettingsStore } from '../../../../src/store/settingsStore'
import { isBlurred } from '../../../helpers/bookingCodeBlur'
import { act, fireEvent, render, screen, waitFor } from '../../../helpers/render'
// FE-MOB-ACCSH-001 to FE-MOB-ACCSH-029
// FE-MOB-ACCSH-001 to FE-MOB-ACCSH-031
// The pickers have their own suites; here they only need to be addressable, so
// they render as plain controls. data-value keeps the requested value readable
@@ -395,4 +395,17 @@ describe('MAccommodationSheet', () => {
expect(update.mock.calls[0][2]).toMatchObject({ confirmation: 'ABC-1' })
})
})
it('FE-MOB-ACCSH-030: an imported track is not offered as the place of a stay', () => {
const track = { id: 103, name: 'Donauradweg', address: null, category_id: null, image_url: null, route_geometry: '[[48.2,16.3],[48.3,16.4]]' }
setup(makePlanner({ places: [...PLACES, track] }))
expect(screen.getByText('Hotel Sacher')).toBeInTheDocument()
expect(screen.queryByText('Donauradweg')).toBeNull()
})
it('FE-MOB-ACCSH-031: a stay already at a track still lists that track', () => {
const track = { id: 103, name: 'Donauradweg', address: null, category_id: null, image_url: null, route_geometry: '[[48.2,16.3],[48.3,16.4]]' }
setup(makePlanner({ places: [...PLACES, track], tripAccommodations: [{ ...EXISTING, place_id: 103 }] }), makeShell({ dayId: 12, accId: 77 }))
expect(placeRow('Donauradweg')).toBeInTheDocument()
})
})
@@ -9,7 +9,7 @@ import { buildPlanner } from '../../../helpers/mobileTrip'
import { resetAllStores } from '../../../helpers/store'
import { act, fireEvent, render, screen, waitFor } from '../../../helpers/render'
// FE-MOB-RESSH-001 to FE-MOB-RESSH-061
// FE-MOB-RESSH-001 to FE-MOB-RESSH-063
// Date/time/select pickers have their own suites — here they only have to be
// addressable, so they render as plain controls.
@@ -469,6 +469,20 @@ describe('MReservationSheet', () => {
expect(screen.getByPlaceholderText('reservations.locationPlaceholder')).toHaveValue('Philharmonikerstrasse 4')
})
it('FE-MOB-RESSH-062: an imported track is not offered as the place of a stay', () => {
const track = { id: 103, name: 'Donauradweg', address: null, route_geometry: '[[48.2,16.3],[48.3,16.4]]' }
setup(makePlanner({ places: [...PLACES, track], editingReservation: HOTEL }))
const hotelOptions = [...screen.getByLabelText('reservations.meta.pickHotel').querySelectorAll('option')].map(o => o.textContent)
expect(hotelOptions).toContain('Hotel Sacher')
expect(hotelOptions).not.toContain('Donauradweg')
})
it('FE-MOB-RESSH-063: a stay already at a track keeps that track selected', () => {
const track = { id: 103, name: 'Donauradweg', address: null, route_geometry: '[[48.2,16.3],[48.3,16.4]]' }
setup(makePlanner({ places: [...PLACES, track], tripAccommodations: [{ ...ACCOMMODATIONS[0], place_id: 103 }], editingReservation: HOTEL }))
expect(screen.getByLabelText('reservations.meta.pickHotel')).toHaveAttribute('data-value', '103')
})
it('FE-MOB-RESSH-023: a hotel without an accommodation falls back to the booking location', () => {
setup(makePlanner({ editingReservation: { ...HOTEL, accommodation_id: null } }))
expect(screen.getByPlaceholderText('reservations.locationPlaceholder')).toHaveValue('fallback address')