Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug information for stop/quay ID and stay-seated transfers #5962

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions client/src/components/ItineraryList/InterchangeInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import logo from '../../static/img/stay-seated.svg';
import { Leg } from '../../gql/graphql.ts';

/**
* Displays an icon if a leg has a stay-seated transfer from the previous one.
*/
export function InterchangeInfo({ leg }: { leg: Leg }) {
if (leg.interchangeFrom?.staySeated) {
return (
<img
alt="Stay-seated transfer"
title="Stay-seated transfer"
src={logo}
width="20"
height="20"
className="d-inline-block align-middle"
/>
);
} else {
return null;
}
}
16 changes: 13 additions & 3 deletions client/src/components/ItineraryList/ItineraryLegDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Leg, Mode } from '../../gql/graphql.ts';
import { LegTime } from './LegTime.tsx';
import { formatDistance } from '../../util/formatDistance.ts';
import { formatDuration } from '../../util/formatDuration.ts';
import { InterchangeInfo } from './InterchangeInfo.tsx';

export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean }) {
return (
Expand All @@ -10,8 +11,12 @@ export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean
{formatDistance(leg.distance)}, {formatDuration(leg.duration)}
</div>
<div>
<LegTime aimedTime={leg.aimedStartTime} expectedTime={leg.expectedStartTime} hasRealtime={leg.realtime} /> -{' '}
<LegTime aimedTime={leg.aimedEndTime} expectedTime={leg.expectedEndTime} hasRealtime={leg.realtime} />
<InterchangeInfo leg={leg} />
<LegTime
aimedTime={leg.aimedStartTime}
expectedTime={leg.expectedStartTime}
hasRealtime={leg.realtime}
/> - <LegTime aimedTime={leg.aimedEndTime} expectedTime={leg.expectedEndTime} hasRealtime={leg.realtime} />
</div>
<div className="mode">
<b>{leg.mode}</b>{' '}
Expand All @@ -24,7 +29,12 @@ export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean
</>
)}{' '}
<div></div>
{leg.mode !== Mode.Foot && <u>{leg.fromPlace.name}</u>} {!isLast && <u>→ {leg.toPlace.name}</u>}
{leg.mode !== Mode.Foot && (
<>
<u title={leg.fromPlace.quay?.id}>{leg.fromPlace.name}</u> →{' '}
</>
)}{' '}
{!isLast && <u title={leg.toPlace.quay?.id}>{leg.toPlace.name}</u>}
</div>
</div>
);
Expand Down
12 changes: 12 additions & 0 deletions client/src/hooks/useTripQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ const query = graphql(`
duration
fromPlace {
name
quay {
id
}
}
toPlace {
name
quay {
id
}
}
toEstimatedCall {
destinationDisplay {
Expand All @@ -71,6 +77,12 @@ const query = graphql(`
pointsOnLink {
points
}
interchangeTo {
staySeated
}
interchangeFrom {
staySeated
}
}
systemNotices {
tag
Expand Down
8 changes: 8 additions & 0 deletions client/src/static/img/stay-seated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading