mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-13 07:40:59 +00:00
31859651d7
Every help screen checked against the v5 redesign. Tours is documented for the first time, as a screen of its own with twelve screens under it, and notifications get help of their own. All pictures are taken again on a realistic demo trip, with short loops where a still cannot show the motion. The English is plain and every language is written naturally rather than word for word. The switcher shows two levels at most, a screen's overview lists its sub-screens as cards above its guides, each wiki page is linked once, and the help sidebar is wider. Fixes found along the way: Save to Collection keeps a tour's route, a track dropped on the places column opens the Tours import, tour Share on desktop, the unsaved tour draft lives on the account, a route click no longer adds an end point, Trip places leaves the trip's tours out, Escape closes a stage's day menu, confirms before destructive deletes, DWD warnings sharing one id kept apart, a booking's date moves with it, and smaller fixes across notifications, bookings, the day plan, stays, Atlas, Collections, Vacay and the admin screens.
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
import type { Place } from '../../types'
|
|
import { useSaveToCollectionStore, type SaveToCollectionTarget } from '../../store/saveToCollectionStore'
|
|
|
|
/**
|
|
* Build a Save-to-Collection picker target from a trip pool place, carrying the
|
|
* provenance ids so the saved copy remembers its origin trip/place.
|
|
*/
|
|
export function placeToSaveTarget(place: Place): SaveToCollectionTarget {
|
|
return {
|
|
name: place.name,
|
|
source_trip_id: place.trip_id ?? null,
|
|
source_place_id: place.id,
|
|
description: place.description ?? null,
|
|
lat: place.lat ?? null,
|
|
lng: place.lng ?? null,
|
|
address: place.address ?? null,
|
|
category_id: place.category_id ?? null,
|
|
price: place.price ?? null,
|
|
currency: place.currency ?? null,
|
|
notes: place.notes ?? null,
|
|
image_url: place.image_url ?? null,
|
|
google_place_id: place.google_place_id ?? null,
|
|
google_ftid: place.google_ftid ?? null,
|
|
osm_id: place.osm_id ?? null,
|
|
website: place.website ?? null,
|
|
phone: place.phone ?? null,
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Open the right "Save to Collection" flow for a trip place. A tour opens the
|
|
* tour's own keep dialog, the one its card uses, so it is kept with its route;
|
|
* any other place opens the place picker as before.
|
|
*/
|
|
export function openSaveToCollection(place: Place, isTour: boolean, tripId: number | string = place.trip_id): void {
|
|
const store = useSaveToCollectionStore.getState()
|
|
if (isTour) store.openTour({ tripId, placeId: place.id, name: place.name })
|
|
else store.open(placeToSaveTarget(place))
|
|
}
|