fix: follow-ups from the review of the price, Immich, moving day and import fixes

Saved place price (#2471)
- A price above zero that would be left without a currency is refused
  with a 400, over REST and through update_collection_place alike. A list
  has no base currency, so such an amount was read in each viewer's own
  default currency and went into a trip as the trip's. A price sent alone
  keeps the stored currency, and a zero price or clearing both fields
  still goes through. The check sits in the service because the MCP tool
  spreads the contract's shape, where a refine would never arrive.
- An older row that holds an amount without a currency shows it as a
  bare number instead of in the viewer's own currency.
- The Hungarian hint uses the informal register of its file, which is
  now prettier clean.

Immich certificate switch (#2475)
- The switch trusts one server. Saving a different URL without sending
  it turns it off; saving the same URL keeps it as before. The wiki says
  so.

Moving day (#2476)
- Google Maps and CoMaps are left out only when there is nothing to hand
  over. A day with a single stop opens it as a pin again, on the desktop
  and on the phone, as it did before.
- Desktop: a moving day whose flight or train has no stations shows no
  route tools, since there is nothing left to draw. With stations they
  stay.
- Phone: the drive between two stays on a day without stops or bookings
  shows once at the top instead of again at the bottom.
- The export helpers take the carrier flags as one object instead of two
  booleans in a row.

Import card (#2477)
- The success and error marks use the theme tokens.
- The e2e test names its upload with a made-up booking number.

Tests: COLLECTIONS-SVC-132 and 133, COLLECTIONS-E2E-088,
update_collection_place with a price and no currency, FE-COMP-COLEXTRAS-013
(011 adjusted), IMMICH-TLS-010, IMMICH-103 extended,
FE-PLANNER-DAYPLAN-222 adjusted and 224, FE-MOB-PLTL-051, FE-MOB-PTLM-047,
FE-W4BGT-023 and 024 check the mark colours.
This commit is contained in:
Maurice
2026-09-23 17:39:25 +02:00
parent 0df82185bd
commit a910c2a837
22 changed files with 269 additions and 84 deletions
@@ -12,7 +12,7 @@ import type {
Accommodation, Assignment, Day, DayNote, Reservation, RouteSegment, TranslationFn,
} from '../../../../src/types'
// FE-MOB-PTLM-001 to FE-MOB-PTLM-046
// FE-MOB-PTLM-001 to FE-MOB-PTLM-047
const DAYS = [
{ id: 1, trip_id: 1, day_number: 1, date: '2026-05-01', title: null },
@@ -364,6 +364,14 @@ describe('planTimelineModel — hotel chips and legs', () => {
expect(located.top).toMatchObject({ name: 'Hotel A', seg: { from: [HOTEL_A.lat, HOTEL_A.lng], to: [MUC.lat, MUC.lng] } })
expect(located.bottom).toMatchObject({ name: 'Hotel B', seg: { from: [HAM.lat, HAM.lng], to: [HOTEL_B.lat, HOTEL_B.lng] } })
})
it('FE-MOB-PTLM-047: without a flight the one drive between the two stays shows once, not above and below', () => {
// No stop and no booking: the day is the drive from Munich to Hamburg (#1297).
// That one segment leaves the morning hotel and reaches the evening one.
const legs = legsOf([])
expect(legs.top).toMatchObject({ name: 'Hotel A', seg: { from: [HOTEL_A.lat, HOTEL_A.lng], to: [HOTEL_B.lat, HOTEL_B.lng] } })
expect(legs.bottom).toBeNull()
})
})
})
@@ -12,7 +12,7 @@ import { buildPlanner, buildTripActions } from '../../../helpers/mobileTrip'
import { resetAllStores, seedStore } from '../../../helpers/store'
import { act, renderHook, waitFor } from '../../../helpers/render'
// FE-MOB-PLTL-001 to FE-MOB-PLTL-050
// FE-MOB-PLTL-001 to FE-MOB-PLTL-051
// The connector calculation is its own hook with real OSRM calls — stubbed here so
// the timeline sees exactly the legs a test wants to match against.
@@ -627,6 +627,24 @@ describe('useMPlanTimeline', () => {
)
})
it('FE-MOB-PLTL-051: a day with a single stop still offers the hand-offs, which open that stop as a pin', async () => {
// No stay in TREK: one sight is the whole export. The #2476 gate only drops a day
// with nothing to hand over, not one that opens a pin to navigate to.
const { result } = await renderTimeline(makePlanner({ assignments: { '2': [A_MUSEUM] } }))
expect(result.current.canExportRoute).toBe(true)
act(() => { result.current.exportGoogleMaps() })
expect(window.open).toHaveBeenCalledWith(
'https://www.google.com/maps/search/?api=1&query=48,16.1', '_blank', 'noopener,noreferrer',
)
const vague = buildAssignment({
id: 15, day_id: 2, order_index: 0, place_id: 105,
place: buildPlace({ id: 105, name: 'Idea', lat: null, lng: null }),
})
const nothing = await renderTimeline(makePlanner({ assignments: { '2': [vague] } }))
expect(nothing.result.current.canExportRoute).toBe(false)
})
it('FE-MOB-PLTL-039: renames the day with a trimmed title', async () => {
const planner = makePlanner()
const { result } = await renderTimeline(planner)