feat(places): notes, visits, tours, history, tags and location in the place sheet, saved lists on the trip map

Both the desktop sheet and the phone sheet of All places show the place's
location as a badge, its notes per list, its visits from trips (hidden without
any), linked tours and bookings, its change history and the reader's own tags
with a tag filter. A trip map can show the places of linked lists and add one
to the trip. All places reloads after a list is added or removed.
This commit is contained in:
Maurice
2026-11-29 21:16:38 +01:00
parent 9abd16b907
commit d008331e5f
84 changed files with 3874 additions and 288 deletions
+9 -1
View File
@@ -8,10 +8,18 @@ import apiClient from './client';
const base = '/addons/collections/library/places';
/** The query as the server reads it: a tag filter (PLC-21) as its ids joined by commas, not `tag_ids[]=`. */
function queryParams(query: PlacesLibraryQueryInput): Record<string, unknown> {
const { tag_ids: tagIds, ...rest } = query;
if (tagIds === undefined) return rest;
const joined = Array.isArray(tagIds) ? tagIds.join(',') : tagIds;
return joined === '' ? rest : { ...rest, tag_ids: joined };
}
/** PLC-07/PLC-08 "All places": one page of entries, and one entry by the trip place or saved place it was opened from. */
export const placesLibraryApi = {
list: (query: PlacesLibraryQueryInput = {}, signal?: AbortSignal): Promise<PlacesLibraryPageResponse> =>
apiClient.get(base, { params: query, signal }).then((r) => r.data),
apiClient.get(base, { params: queryParams(query), signal }).then((r) => r.data),
detail: (kind: PlacesLibraryKind, id: number, signal?: AbortSignal): Promise<PlacesLibraryDetailResponse> =>
apiClient.get(`${base}/${kind}/${id}`, { signal }).then((r) => r.data),
};