mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-26 22:57:32 +00:00
fix(tours): city walk gates: entity collection, formatting, a walk's name hint and the tests' visits repository
The day assignments entity carries the station visits that hang off it, as the generator writes it. A city walk gets its own placeholder for an untitled name, the tour service tests hand in the visits repository the service now takes, and the files the walk touched are formatted. The theme icons of the place search overlap by their start margin, so they stack the same way in both reading directions.
This commit is contained in:
@@ -7,9 +7,9 @@ import type { Category, Place } from '../../types';
|
||||
import { formatTime } from '../../utils/formatters';
|
||||
import { fs } from '../shared/DialogShell';
|
||||
import { TourDayRowPills } from '../Tours/TourDayRowFacts';
|
||||
import { WalkProgressPill } from '../Tours/walk/WalkStations';
|
||||
import { movingTimeLabel } from '../Tours/tourFacts';
|
||||
import { formatPlannedTourDuration, type TourPlannedTimes } from '../Tours/tourPresentation';
|
||||
import { WalkProgressPill } from '../Tours/walk/WalkStations';
|
||||
import { TimePill } from './planParts';
|
||||
|
||||
type DayRowTourTimes = TourPlannedTimes & { tour?: TourListItem };
|
||||
@@ -93,7 +93,14 @@ function SublineDescription({ text, isTourPlace }: { text: string; isTourPlace:
|
||||
|
||||
// Second line of a place row in the day plan: time, tour facts or planned
|
||||
// tour durations, then the clamped description.
|
||||
export function DayPlanPlaceSubline({ place, cat, tourTimes, isTourPlace, timeFormat, assignmentId }: DayPlanPlaceSublineProps) {
|
||||
export function DayPlanPlaceSubline({
|
||||
place,
|
||||
cat,
|
||||
tourTimes,
|
||||
isTourPlace,
|
||||
timeFormat,
|
||||
assignmentId,
|
||||
}: DayPlanPlaceSublineProps) {
|
||||
const { locale } = useTranslation();
|
||||
const dayRowTour = tourTimes?.tour;
|
||||
const description = place.description || place.address || cat?.name;
|
||||
|
||||
@@ -79,6 +79,7 @@ export function TourNameField({ planner, locked }: TourFieldProps) {
|
||||
hike: t('tours.planner.namePlaceholder'),
|
||||
bike: t('tours.planner.namePlaceholder.bike'),
|
||||
kayak: t('tours.planner.namePlaceholder.kayak'),
|
||||
walk: t('tours.planner.namePlaceholder.walk'),
|
||||
}[planner.tourType]
|
||||
}
|
||||
className={INPUT}
|
||||
|
||||
@@ -17,8 +17,8 @@ import {
|
||||
Navigation,
|
||||
RefreshCw,
|
||||
Repeat,
|
||||
SquarePen,
|
||||
Spline,
|
||||
SquarePen,
|
||||
Trash2,
|
||||
Unlink,
|
||||
Waves,
|
||||
@@ -47,10 +47,10 @@ import { usePaddleRegionLoad } from '../paddle/usePaddleRegionLoad';
|
||||
import { usePaddleWaypointActions } from '../paddle/usePaddleWaypointActions';
|
||||
import { usePortageRouting, usePortageWay } from '../paddle/usePortageRouting';
|
||||
import { RailCard } from '../tourParts';
|
||||
import { StationDialog } from './StationDialog';
|
||||
import { StationPills } from './stationParts';
|
||||
import { paddlePlanPoints, paddleRolesById } from './paddlePlanOf';
|
||||
import type { PaddleLegFailure } from './paddleRouting';
|
||||
import { StationDialog } from './StationDialog';
|
||||
import { StationPills } from './stationParts';
|
||||
import { lineLengthM } from './tourFixedLegs';
|
||||
import { TripPlacePicker } from './TripPlacePicker';
|
||||
import type { TourPlannerController } from './useTourPlanner';
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import type { PaddleLock, PlannableTourType, StationImportance, TourFixedLeg, TourWaypoint, TourWaypointRole } from '@trek/shared';
|
||||
import type {
|
||||
PaddleLock,
|
||||
PlannableTourType,
|
||||
StationImportance,
|
||||
TourFixedLeg,
|
||||
TourWaypoint,
|
||||
TourWaypointRole,
|
||||
} from '@trek/shared';
|
||||
import type { AutoBase } from './paddleRouting';
|
||||
import { keepJoinedFixedLegs } from './tourFixedLegs';
|
||||
import { alignFreeLegs } from './tourRouteActions';
|
||||
|
||||
@@ -70,13 +70,13 @@ function CategoryPicker({ search }: { search: TourPoiSearch }) {
|
||||
className="flex w-full min-w-0 items-center gap-2 rounded-[10px] border border-edge bg-surface-input px-2.5 py-1.5 text-start hover:border-content-faint"
|
||||
>
|
||||
<span className="sr-only">{t('tours.poi.categories')}: </span>
|
||||
<span className="flex flex-none -space-x-1 rtl:space-x-reverse" aria-hidden="true">
|
||||
{chosen.slice(0, 3).map((category) => {
|
||||
<span className="flex flex-none" aria-hidden="true">
|
||||
{chosen.slice(0, 3).map((category, index) => {
|
||||
const look = TOUR_POI_LOOKS[category];
|
||||
return (
|
||||
<span
|
||||
key={category}
|
||||
className="grid h-5 w-5 place-items-center rounded-full bg-surface-card ring-2 ring-[color:var(--bg-card)]"
|
||||
className={`grid h-5 w-5 place-items-center rounded-full bg-surface-card ring-2 ring-[color:var(--bg-card)] ${index > 0 ? '-ms-1' : ''}`}
|
||||
style={{ color: look.color }}
|
||||
>
|
||||
<look.Icon size={11} strokeWidth={2.2} />
|
||||
|
||||
Reference in New Issue
Block a user