mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 10:44:23 +00:00
feat(tours): places along the tour picked on the map, stops that keep their kind, and calmer station rows
Along the tour (PLN-02, PLN-03): the list shows one line per place (its icon, name and distance from the route) and scrolls past ten. A place picked in the list or on the map opens its card over the map, where the other cards of the planner sit, with what the source says and the way to take it in as a stop. What taking it in did is one line in the list. The intro, the theme line and the out-of-date note are gone: the themes say what they look for on hover, and the search button says when to search again. A stop taken in from there keeps the kind of place it was found as (migration 045400, poi_category, read back only where the contract knows the kind) and its number carries that kind's icon at the corner, as a via ferrata's end does. City walks (CW-02, CW-03, CW-10): a stay nobody entered says nothing. While no stay is entered at all the walk is planned as its walking time, with no "unknown" and no "at least". A must-see rings its number, an optional stop has a dashed ring, a protected one a shield at the corner; only the stay stays under the name, below the coordinates.
This commit is contained in:
@@ -65,6 +65,7 @@ const UNNUMBERED = [
|
||||
'Migration20200101045100_a_tour_remembers_the_trip_it_was_taken_from',
|
||||
'Migration20200101045200_a_tour_can_be_ridden',
|
||||
'Migration20200101045300_a_tour_can_be_a_city_walk',
|
||||
'Migration20200101045400_a_tour_waypoint_remembers_the_kind_of_place_it_was_found_as',
|
||||
];
|
||||
// The last step the positional runner ever had; planLegacyBaseline refuses a
|
||||
// schema_version past it.
|
||||
|
||||
@@ -196,6 +196,30 @@ describe('TourWaypointsRepository', () => {
|
||||
expect(points[1]).not.toHaveProperty('name');
|
||||
expect(await repo.listForTrip(trip.id)).toEqual(points.map((point) => ({ place_id: place.id, ...point })));
|
||||
});
|
||||
it('TWREPO-011: a point taken in along the tour keeps the kind of place it was found as; a kind no longer known reads as none (PLN-03)', async () => {
|
||||
const { place } = tourInTrip();
|
||||
const restaurant: TourWaypointRow = {
|
||||
lat: 48.1,
|
||||
lng: 11.5,
|
||||
role: 'via',
|
||||
sequence: 1,
|
||||
name: 'Café Luitpold',
|
||||
poi_category: 'restaurant',
|
||||
};
|
||||
await repo.insertForPlace(place.id, [
|
||||
{ lat: 48, lng: 11.4, role: 'start', sequence: 0 },
|
||||
restaurant,
|
||||
{ lat: 48.2, lng: 11.6, role: 'end', sequence: 2 },
|
||||
]);
|
||||
const points = await repo.listForPlace(place.id);
|
||||
expect(points[1]).toEqual(restaurant);
|
||||
expect(points[0]).not.toHaveProperty('poi_category');
|
||||
|
||||
await t.em.nativeUpdate(TourWaypoints, { place: place.id, sequence: 1 }, { poi_category: 'spaceport' });
|
||||
t.clear();
|
||||
expect((await repo.listForPlace(place.id))[1]).not.toHaveProperty('poi_category');
|
||||
});
|
||||
|
||||
it('TWREPO-010: listForPlaces reads the waypoints of the tours asked for, by place and sequence, and none for none (CW-02)', async () => {
|
||||
const { trip, place } = tourInTrip();
|
||||
const second = createPlace(testDb, trip.id);
|
||||
|
||||
Reference in New Issue
Block a user