mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 23:46:35 +00:00
fix(tours): keep the planner page at its size, and format the GPX test
The rail reads the trip's tour ids from the workspace it already gets, so the page line stays as it was; the map's size entry follows the lines it lost.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"src/components/Budget/CostsPanel.tsx": 1816,
|
||||
"src/components/Map/MapView.tsx": 1402,
|
||||
"src/components/Map/MapViewGL.test.tsx": 2920,
|
||||
"src/components/Map/MapViewGL.tsx": 2299,
|
||||
"src/components/Map/MapViewGL.tsx": 2296,
|
||||
"src/components/Map/RouteCalculator.ts": 1195,
|
||||
"src/components/PDF/TripPDF.tsx": 1082,
|
||||
"src/components/Planner/DayDetailPanel.test.tsx": 2333,
|
||||
|
||||
@@ -17,6 +17,8 @@ export interface TourWorkspaceRailParts {
|
||||
trackPaddlePlan?: TrackPaddlePlan;
|
||||
/** The obstacle checklist of the paddle tour open in the planner (PAD-06). */
|
||||
paddleChecklist?: PaddleChecklist;
|
||||
/** The trip's tours, never offered as a stop of another tour (PR1-10). */
|
||||
tourPlaceIds?: ReadonlySet<number>;
|
||||
}
|
||||
|
||||
/** The tours workspace's left rail: the tour editor, or the wanderer trails while those are browsed. */
|
||||
@@ -24,13 +26,10 @@ export default function TourWorkspaceRail({
|
||||
workspace,
|
||||
canEdit,
|
||||
canAssign,
|
||||
tourPlaceIds,
|
||||
}: {
|
||||
workspace: TourWorkspaceRailParts;
|
||||
canEdit: boolean;
|
||||
canAssign: boolean;
|
||||
/** The trip's tours, never offered as a stop of another tour (PR1-10). */
|
||||
tourPlaceIds?: ReadonlySet<number>;
|
||||
}) {
|
||||
const {
|
||||
tourPlanner,
|
||||
@@ -39,6 +38,7 @@ export default function TourWorkspaceRail({
|
||||
recordedTrack,
|
||||
trackPaddlePlan,
|
||||
paddleChecklist,
|
||||
tourPlaceIds,
|
||||
} = workspace;
|
||||
return wanderer.open ? (
|
||||
<WandererBrowserRail browser={wanderer} />
|
||||
|
||||
@@ -646,7 +646,7 @@ function TripPlannerPageDesktop(): React.ReactElement | null {
|
||||
transition: 'width 0.25s ease', opacity: leftHidden ? 0 : 1,
|
||||
}}>
|
||||
{!leftHidden && <PanelResizeHandle side="left" width={leftWidth} min={resizeMin} max={resizeMax} onStart={startResizeLeft} onNudge={nudgeLeft} />}
|
||||
<LazyPanel id="tour-planner-rail"><TourWorkspaceRail workspace={pageState} canEdit={canPlaceEdit} canAssign={canDayEdit} tourPlaceIds={tourPlaceIds} /></LazyPanel>
|
||||
<LazyPanel id="tour-planner-rail"><TourWorkspaceRail workspace={pageState} canEdit={canPlaceEdit} canAssign={canDayEdit} /></LazyPanel>
|
||||
</div>
|
||||
</div>
|
||||
<div className="absolute bottom-[10px] right-[10px] top-[10px] z-20 hidden md:block">
|
||||
|
||||
@@ -292,16 +292,17 @@ describe('buildTourGpx (PR1-06A)', () => {
|
||||
const parser = new XMLParser({ ignoreAttributes: false, attributeNamePrefix: '@_' });
|
||||
|
||||
it('writes the line as one track with the heights it has and none it lacks', () => {
|
||||
const gpx = buildTourGpx(
|
||||
tour(
|
||||
JSON.stringify([
|
||||
[47, 11, 600.4],
|
||||
[47.1, 11.1],
|
||||
[47.2, 11.2, 'x'],
|
||||
[47.3, 11.3, 650],
|
||||
]),
|
||||
),
|
||||
) ?? '';
|
||||
const gpx =
|
||||
buildTourGpx(
|
||||
tour(
|
||||
JSON.stringify([
|
||||
[47, 11, 600.4],
|
||||
[47.1, 11.1],
|
||||
[47.2, 11.2, 'x'],
|
||||
[47.3, 11.3, 650],
|
||||
]),
|
||||
),
|
||||
) ?? '';
|
||||
expect(XMLValidator.validate(gpx)).toBe(true);
|
||||
const doc = parser.parse(gpx).gpx;
|
||||
expect(doc.metadata).toMatchObject({
|
||||
@@ -317,17 +318,18 @@ describe('buildTourGpx (PR1-06A)', () => {
|
||||
});
|
||||
|
||||
it('writes no description or link a tour has not got', () => {
|
||||
const gpx = buildTourGpx({
|
||||
...tour(
|
||||
JSON.stringify([
|
||||
[47, 11],
|
||||
[47.1, 11.1],
|
||||
]),
|
||||
),
|
||||
description: ' ',
|
||||
website: null,
|
||||
stops: [],
|
||||
}) ?? '';
|
||||
const gpx =
|
||||
buildTourGpx({
|
||||
...tour(
|
||||
JSON.stringify([
|
||||
[47, 11],
|
||||
[47.1, 11.1],
|
||||
]),
|
||||
),
|
||||
description: ' ',
|
||||
website: null,
|
||||
stops: [],
|
||||
}) ?? '';
|
||||
const doc = parser.parse(gpx).gpx;
|
||||
expect(doc.metadata).toEqual({ name: 'Grat <Ost>' });
|
||||
expect(doc.trk.desc).toBeUndefined();
|
||||
|
||||
Reference in New Issue
Block a user